Fix Qwen reference image autogrow input names
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ def workflow(prompt,params,seed,family='qwen',references=()):
|
||||
graph['4']['inputs']['vae']=['3',0]
|
||||
for index,name in enumerate(references,1):
|
||||
graph[str(20+index)]={'class_type':'LoadImage','inputs':{'image':name}}
|
||||
graph['4']['inputs'][f'image_{index}']=[str(20+index),0]
|
||||
graph['4']['inputs'][f'images.image_{index}']=[str(20+index),0]
|
||||
graph['6']['inputs']['latent_image']=['4',2]
|
||||
return graph
|
||||
|
||||
|
||||
+3
-2
@@ -19,10 +19,11 @@ class ImageTestTests(unittest.TestCase):
|
||||
p=dict(width=512,height=512,steps=4,guidance=1)
|
||||
graph=workflow('synthetic edit',p,42,references=['reference-1.png','reference-2.jpg'])
|
||||
self.assertEqual(graph['4']['inputs']['vae'],['3',0])
|
||||
self.assertEqual(graph['4']['inputs']['image_1'],['21',0])
|
||||
self.assertEqual(graph['4']['inputs']['image_2'],['22',0])
|
||||
self.assertEqual(graph['4']['inputs']['images.image_1'],['21',0])
|
||||
self.assertEqual(graph['4']['inputs']['images.image_2'],['22',0])
|
||||
self.assertEqual(graph['6']['inputs']['latent_image'],['4',2])
|
||||
self.assertEqual(graph['21']['inputs']['image'],'reference-1.png')
|
||||
self.assertNotIn('image_1',graph['4']['inputs'])
|
||||
with self.assertRaises(ValueError):workflow('test',p,1,'unknown',['reference-1.png'])
|
||||
def test_flux_references_feed_both_conditioning_branches(self):
|
||||
p=dict(width=512,height=512,steps=4,guidance=1)
|
||||
|
||||
Reference in New Issue
Block a user