Unverified Commit fa1ac50a authored by Yao Matrix's avatar Yao Matrix Committed by GitHub
Browse files

make test_stable_diffusion_karras_sigmas pass on XPU (#11310)


Signed-off-by: default avatarMatrix Yao <matrix.yao@intel.com>
parent aa541b9f
......@@ -21,6 +21,7 @@ import torch
from diffusers import StableDiffusionXLKDiffusionPipeline
from diffusers.utils.testing_utils import (
Expectations,
backend_empty_cache,
enable_full_determinism,
require_torch_accelerator,
......@@ -106,7 +107,38 @@ class StableDiffusionXLKPipelineIntegrationTests(unittest.TestCase):
image_slice = image[0, -3:, -3:, -1]
assert image.shape == (1, 512, 512, 3)
expected_slice = np.array([0.6418, 0.6424, 0.6462, 0.6271, 0.6314, 0.6295, 0.6249, 0.6339, 0.6335])
expected_slices = Expectations(
{
("xpu", 3): np.array(
[
0.6128,
0.6108,
0.6109,
0.5997,
0.5988,
0.5948,
0.5903,
0.597,
0.5973,
]
),
("cuda", 7): np.array(
[
0.6418,
0.6424,
0.6462,
0.6271,
0.6314,
0.6295,
0.6249,
0.6339,
0.6335,
]
),
}
)
expected_slice = expected_slices.get_expectation()
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment