mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 07:05:43 -03:00
fix(civitai): improve metadata parsing for nested structures, see #700
- Refactor metadata detection to handle nested "meta" objects - Add support for lowercase "lora:" hash keys - Extract metadata from nested "meta" field when present - Update tests to verify nested metadata parsing - Handle case-insensitive LORA hash detection The changes ensure proper parsing of Civitai image metadata that may be wrapped in nested structures, improving compatibility with different API response formats.
This commit is contained in:
@@ -107,6 +107,12 @@ class RecipeAnalysisService:
|
||||
raise RecipeDownloadError("No image URL found in Civitai response")
|
||||
await self._download_image(image_url, temp_path)
|
||||
metadata = image_info.get("meta") if "meta" in image_info else None
|
||||
if (
|
||||
isinstance(metadata, dict)
|
||||
and "meta" in metadata
|
||||
and isinstance(metadata["meta"], dict)
|
||||
):
|
||||
metadata = metadata["meta"]
|
||||
else:
|
||||
await self._download_image(url, temp_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user