feat: enhance LoRA metadata handling by adding model IDs and updating recipe data structure. Fixes #246

This commit is contained in:
Will Miao
2025-06-24 11:12:21 +08:00
parent f6ef428008
commit d0ed1213d8
9 changed files with 38 additions and 58 deletions

View File

@@ -147,7 +147,7 @@ class ExifUtils:
"file_name": lora.get("file_name", ""),
"hash": lora.get("hash", "").lower() if lora.get("hash") else "",
"strength": float(lora.get("strength", 1.0)),
"modelVersionId": lora.get("modelVersionId", ""),
"modelVersionId": lora.get("modelVersionId", 0),
"modelName": lora.get("modelName", ""),
"modelVersionName": lora.get("modelVersionName", ""),
}

View File

@@ -142,7 +142,7 @@ def calculate_recipe_fingerprint(loras):
# Get the hash - use modelVersionId as fallback if hash is empty
hash_value = lora.get("hash", "").lower()
if not hash_value and lora.get("isDeleted", False) and lora.get("modelVersionId"):
hash_value = lora.get("modelVersionId")
hash_value = str(lora.get("modelVersionId"))
# Skip entries without a valid hash
if not hash_value: