@@ -153,9 +153,14 @@ def test_controlnet_hunyuandit(self):
153153 image_slice = image [0 , - 3 :, - 3 :, - 1 ]
154154 assert image .shape == (1 , 16 , 16 , 3 )
155155
156- expected_slice = np .array (
157- [0.6953125 , 0.89208984 , 0.59375 , 0.5078125 , 0.5786133 , 0.6035156 , 0.5839844 , 0.53564453 , 0.52246094 ]
158- )
156+ if torch_device == "xpu" :
157+ expected_slice = np .array (
158+ [0.6376953 , 0.84375 , 0.58691406 , 0.48046875 , 0.43652344 , 0.5517578 , 0.54248047 , 0.5644531 , 0.48217773 ]
159+ )
160+ else :
161+ expected_slice = np .array (
162+ [0.6953125 , 0.89208984 , 0.59375 , 0.5078125 , 0.5786133 , 0.6035156 , 0.5839844 , 0.53564453 , 0.52246094 ]
163+ )
159164
160165 assert (
161166 np .abs (image_slice .flatten () - expected_slice ).max () < 1e-2
@@ -351,6 +356,7 @@ def test_multi_controlnet(self):
351356 assert image .shape == (1024 , 1024 , 3 )
352357
353358 original_image = image [- 3 :, - 3 :, - 1 ].flatten ()
359+
354360 expected_image = np .array (
355361 [0.43652344 , 0.44018555 , 0.4494629 , 0.44995117 , 0.45654297 , 0.44848633 , 0.43603516 , 0.4404297 , 0.42626953 ]
356362 )
0 commit comments