Skip to content

Commit 93cc35f

Browse files
authored
Merge branch 'main' into issue221
2 parents 23385b2 + fa1ac50 commit 93cc35f

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

tests/pipelines/kandinsky2_2/test_kandinsky_combined.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def test_inference_batch_single_identical(self):
388388
super().test_inference_batch_single_identical(expected_max_diff=1e-2)
389389

390390
def test_float16_inference(self):
391-
super().test_float16_inference(expected_max_diff=5e-1)
391+
super().test_float16_inference(expected_max_diff=8e-1)
392392

393393
def test_dict_tuple_outputs_equivalent(self):
394394
super().test_dict_tuple_outputs_equivalent(expected_max_difference=5e-4)

tests/pipelines/stable_diffusion_xl/test_stable_diffusion_xl_k_diffusion.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
from diffusers import StableDiffusionXLKDiffusionPipeline
2323
from diffusers.utils.testing_utils import (
24+
Expectations,
2425
backend_empty_cache,
2526
enable_full_determinism,
2627
require_torch_accelerator,
@@ -106,7 +107,38 @@ def test_stable_diffusion_karras_sigmas(self):
106107
image_slice = image[0, -3:, -3:, -1]
107108

108109
assert image.shape == (1, 512, 512, 3)
109-
expected_slice = np.array([0.6418, 0.6424, 0.6462, 0.6271, 0.6314, 0.6295, 0.6249, 0.6339, 0.6335])
110+
expected_slices = Expectations(
111+
{
112+
("xpu", 3): np.array(
113+
[
114+
0.6128,
115+
0.6108,
116+
0.6109,
117+
0.5997,
118+
0.5988,
119+
0.5948,
120+
0.5903,
121+
0.597,
122+
0.5973,
123+
]
124+
),
125+
("cuda", 7): np.array(
126+
[
127+
0.6418,
128+
0.6424,
129+
0.6462,
130+
0.6271,
131+
0.6314,
132+
0.6295,
133+
0.6249,
134+
0.6339,
135+
0.6335,
136+
]
137+
),
138+
}
139+
)
140+
141+
expected_slice = expected_slices.get_expectation()
110142

111143
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
112144

0 commit comments

Comments
 (0)