mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-06-29 05:51:16 -03:00
fix(import): request withMeta=true from CivitAI API, fix checkpoint type guard and CivArchive version lookup
- Add &withMeta=true to image info URL so API returns full generation metadata (resources with hash/type) instead of null meta - Fix checkpoint assignment guard: check modelId instead of id so non- checkpoint types (upscaler) are not wrongly set as recipe checkpoint - Skip modelVersionIds loop when resources/civitaiResources already provided LoRAs, preventing hash-resolved duplicates - Fix int/str type comparison in CivArchive get_model_version so version ID matching works correctly
This commit is contained in:
@@ -568,7 +568,7 @@ async def test_get_image_info_prefers_red_host_for_red_source(monkeypatch, downl
|
||||
|
||||
assert result == {"id": 124950237, "name": "target"}
|
||||
assert requested_urls == [
|
||||
"https://civitai.red/api/v1/images?imageId=124950237&nsfw=X"
|
||||
"https://civitai.red/api/v1/images?imageId=124950237&nsfw=X&withMeta=true"
|
||||
]
|
||||
|
||||
|
||||
@@ -589,7 +589,7 @@ async def test_get_image_info_uses_red_host_even_for_red_source(monkeypatch, dow
|
||||
|
||||
assert result == {"id": 124950237, "name": "target"}
|
||||
assert requested_urls == [
|
||||
"https://civitai.red/api/v1/images?imageId=124950237&nsfw=X",
|
||||
"https://civitai.red/api/v1/images?imageId=124950237&nsfw=X&withMeta=true",
|
||||
]
|
||||
|
||||
|
||||
@@ -610,7 +610,7 @@ async def test_get_image_info_does_not_fall_back_after_request_failure(monkeypat
|
||||
|
||||
assert result is None
|
||||
assert requested_urls == [
|
||||
"https://civitai.red/api/v1/images?imageId=124950237&nsfw=X",
|
||||
"https://civitai.red/api/v1/images?imageId=124950237&nsfw=X&withMeta=true",
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user