feat: enhance metadata handling with generation type and source image extraction

This commit is contained in:
LuqP2
2026-03-25 15:18:46 -03:00
parent 6e2db46174
commit 7aa4ffdef2
7 changed files with 140 additions and 0 deletions
+4
View File
@@ -146,6 +146,8 @@ def test_build_imh_metadata_includes_workflow_and_prompt():
"width": 512,
"height": 768,
"lora_list": [],
"generation_type": "img2img",
"source_image": {"fileName": "base.png", "relativePath": "inputs/base.png"},
}
workflow_json = {"workflow": {"nodes": []}, "prompt": {"1": {"class_type": "KSampler"}}}
@@ -154,6 +156,8 @@ def test_build_imh_metadata_includes_workflow_and_prompt():
assert imh["generator"] == "ComfyUI"
assert imh["workflow"] == workflow_json["workflow"]
assert imh["prompt_api"] == workflow_json["prompt"]
assert imh["generation_type"] == "img2img"
assert imh["source_image"]["fileName"] == "base.png"
def test_build_imh_metadata_sanitizes_nan():