mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 23:25:43 -03:00
feat: Enhance checkpoint processing in format_metadata to handle non-string types safely
This commit is contained in:
@@ -159,11 +159,20 @@ class SaveImage:
|
|||||||
|
|
||||||
# Model info
|
# Model info
|
||||||
if 'checkpoint' in metadata_dict:
|
if 'checkpoint' in metadata_dict:
|
||||||
# Extract basename without path
|
# Ensure checkpoint is a string before processing
|
||||||
checkpoint = os.path.basename(metadata_dict.get('checkpoint', ''))
|
checkpoint = metadata_dict.get('checkpoint')
|
||||||
# Remove extension if present
|
if checkpoint is not None:
|
||||||
checkpoint = os.path.splitext(checkpoint)[0]
|
# Handle both string and other types safely
|
||||||
params.append(f"Model: {checkpoint}")
|
if isinstance(checkpoint, str):
|
||||||
|
# Extract basename without path
|
||||||
|
checkpoint = os.path.basename(checkpoint)
|
||||||
|
# Remove extension if present
|
||||||
|
checkpoint = os.path.splitext(checkpoint)[0]
|
||||||
|
else:
|
||||||
|
# Convert non-string to string
|
||||||
|
checkpoint = str(checkpoint)
|
||||||
|
|
||||||
|
params.append(f"Model: {checkpoint}")
|
||||||
|
|
||||||
# Add LoRA hashes if available
|
# Add LoRA hashes if available
|
||||||
if lora_hashes:
|
if lora_hashes:
|
||||||
|
|||||||
Reference in New Issue
Block a user