diff --git a/tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py b/tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py index d5d4c20e47..bad03ff801 100644 --- a/tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py +++ b/tests/pipelines/ip_adapters/test_ip_adapter_stable_diffusion.py @@ -34,6 +34,7 @@ from diffusers import ( from diffusers.image_processor import IPAdapterMaskProcessor from diffusers.utils import load_image from diffusers.utils.testing_utils import ( + Expectations, backend_empty_cache, enable_full_determinism, is_flaky, @@ -664,7 +665,50 @@ class IPAdapterSDXLIntegrationTests(IPAdapterNightlyTestsMixin): images = pipeline(**inputs).images image_slice = images[0, :3, :3, -1].flatten() - expected_slice = np.array([0.2323, 0.1026, 0.1338, 0.0638, 0.0662, 0.0000, 0.0000, 0.0000, 0.0199]) + expected_slices = Expectations( + { + ("xpu", 3): np.array( + [ + 0.2520, + 0.1050, + 0.1510, + 0.0997, + 0.0893, + 0.0019, + 0.0000, + 0.0000, + 0.0210, + ] + ), + ("cuda", 7): np.array( + [ + 0.2323, + 0.1026, + 0.1338, + 0.0638, + 0.0662, + 0.0000, + 0.0000, + 0.0000, + 0.0199, + ] + ), + ("cuda", 8): np.array( + [ + 0.2518, + 0.1059, + 0.1553, + 0.0977, + 0.0852, + 0.0000, + 0.0000, + 0.0000, + 0.0220, + ] + ), + } + ) + expected_slice = expected_slices.get_expectation() max_diff = numpy_cosine_similarity_distance(image_slice, expected_slice) assert max_diff < 5e-4