Normalize Qwen reference image inputs

This commit is contained in:
Mikei386 committed 2026-09-21 10:57:26 +02:00
1 parent 7407611e3e
commit ff20307d15
2 files changed
+5 -3

No files matched your search

+2 -2
View File
@@ -27,8 +27,8 @@ class QwenImageWorkerTests(unittest.TestCase):
encode = workflow["4"]["inputs"] encode = workflow["4"]["inputs"]
self.assertEqual(workflow["6"]["inputs"]["latent_image"], ["4", 2]) self.assertEqual(workflow["6"]["inputs"]["latent_image"], ["4", 2])
self.assertEqual(encode["vae"], ["3", 0]) self.assertEqual(encode["vae"], ["3", 0])
self.assertEqual(encode["image_1"], ["9", 0]) self.assertEqual(encode["images.image_1"], ["9", 0])
self.assertEqual(encode["image_2"], ["10", 0]) self.assertEqual(encode["images.image_2"], ["10", 0])
self.assertNotIn("5", workflow) self.assertNotIn("5", workflow)
def test_router_contract_is_fixed_to_production_parameters(self): def test_router_contract_is_fixed_to_production_parameters(self):
@@ -135,7 +135,9 @@ def make_workflow(prompt: str, seed: int, steps: int, width: int, height: int,
for index, name in enumerate(references, 1): for index, name in enumerate(references, 1):
node = str(8 + index) node = str(8 + index)
workflow[node] = {"class_type": "LoadImage", "inputs": {"image": name}} workflow[node] = {"class_type": "LoadImage", "inputs": {"image": name}}
encode_inputs[f"image_{index}"] = [node, 0] # ComfyUI V3 dynamic inputs use the parent path as a prefix. The
# normalizer turns images.image_N back into the execute() dict.
encode_inputs[f"images.image_{index}"] = [node, 0]
else: else:
workflow["5"] = {"class_type": "EmptyLatentImage", "inputs": { workflow["5"] = {"class_type": "EmptyLatentImage", "inputs": {
"width": width, "height": height, "batch_size": 1}} "width": width, "height": height, "batch_size": 1}}