fix: skip LoRAs without proper identification in Civitai metadata parser

This commit is contained in:
Will Miao
2025-08-11 11:14:45 +08:00
parent 65a1aa7ca2
commit b03420faac

View File

@@ -101,6 +101,11 @@ class CivitaiApiMetadataParser(RecipeMetadataParser):
if resource.get("type", "lora") == "lora":
lora_hash = resource.get("hash", "")
# Skip LoRAs without proper identification (hash or modelVersionId)
if not lora_hash and not resource.get("modelVersionId"):
logger.debug(f"Skipping LoRA resource '{resource.get('name', 'Unknown')}' - no hash or modelVersionId")
continue
# Skip if we've already added this LoRA by hash
if lora_hash and lora_hash in added_loras:
continue