diff --git a/tests/pipelines/controlnet_flux/test_controlnet_flux.py b/tests/pipelines/controlnet_flux/test_controlnet_flux.py index 8607cd6944d9..8208a79904ed 100644 --- a/tests/pipelines/controlnet_flux/test_controlnet_flux.py +++ b/tests/pipelines/controlnet_flux/test_controlnet_flux.py @@ -143,7 +143,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.5 @@ -163,7 +163,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_flux(self): components = self.get_dummy_components() flux_pipe = FluxControlNetPipeline(**components) - flux_pipe = flux_pipe.to(torch_device, dtype=torch.float16) + flux_pipe = flux_pipe.to(torch_device, dtype=torch.float32) flux_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) @@ -174,9 +174,7 @@ def test_controlnet_flux(self): assert image.shape == (1, 32, 32, 3) - expected_slice = np.array( - [0.47387695, 0.63134766, 0.5605469, 0.61621094, 0.7207031, 0.7089844, 0.70410156, 0.6113281, 0.64160156] - ) + expected_slice = np.array([0.6677, 0.6138, 0.5296, 0.6109, 0.5672, 0.6373, 0.5463, 0.6068, 0.5569]) assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2, ( f"Expected: {expected_slice}, got: {image_slice.flatten()}" diff --git a/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py b/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py index 034ef56b0fd3..1f765a1675ae 100644 --- a/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py +++ b/tests/pipelines/controlnet_hunyuandit/test_controlnet_hunyuandit.py @@ -126,7 +126,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 16, 16), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.5 @@ -146,7 +146,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_hunyuandit(self): components = self.get_dummy_components() pipe = HunyuanDiTControlNetPipeline(**components) - pipe = pipe.to(torch_device, dtype=torch.float16) + pipe = pipe.to(torch_device, dtype=torch.float32) pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) @@ -156,14 +156,7 @@ def test_controlnet_hunyuandit(self): image_slice = image[0, -3:, -3:, -1] assert image.shape == (1, 16, 16, 3) - if torch_device == "xpu": - expected_slice = np.array( - [0.6948242, 0.89160156, 0.59375, 0.5078125, 0.57910156, 0.6035156, 0.58447266, 0.53564453, 0.52246094] - ) - else: - expected_slice = np.array( - [0.6953125, 0.89208984, 0.59375, 0.5078125, 0.5786133, 0.6035156, 0.5839844, 0.53564453, 0.52246094] - ) + expected_slice = np.array([0.5925, 0.5392, 0.4450, 0.7140, 0.3954, 0.3553, 0.3842, 0.5994, 0.3765]) assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2, ( f"Expected: {expected_slice}, got: {image_slice.flatten()}" diff --git a/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py b/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py index 072f9aa405d9..28abf122c41b 100644 --- a/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py +++ b/tests/pipelines/controlnet_sd3/test_controlnet_inpaint_sd3.py @@ -156,14 +156,14 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) control_mask = randn_tensor( (1, 1, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.95 @@ -184,7 +184,7 @@ def get_dummy_inputs(self, device, seed=0): def test_controlnet_inpaint_sd3(self): components = self.get_dummy_components() sd_pipe = StableDiffusion3ControlNetInpaintingPipeline(**components) - sd_pipe = sd_pipe.to(torch_device, dtype=torch.float16) + sd_pipe = sd_pipe.to(torch_device, dtype=torch.float32) sd_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) @@ -195,9 +195,7 @@ def test_controlnet_inpaint_sd3(self): assert image.shape == (1, 32, 32, 3) - expected_slice = np.array( - [0.51708984, 0.7421875, 0.4580078, 0.6435547, 0.65625, 0.43603516, 0.5151367, 0.65722656, 0.60839844] - ) + expected_slice = np.array([0.2875, 0.3173, 0.4028, 0.7248, 0.6338, 0.4238, 0.1730, 0.4609, 0.5424]) assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2, ( f"Expected: {expected_slice}, got: {image_slice.flatten()}" diff --git a/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py b/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py index 46b08cf1f00b..4c8e80d38bfa 100644 --- a/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py +++ b/tests/pipelines/controlnet_sd3/test_controlnet_sd3.py @@ -173,7 +173,7 @@ def get_dummy_inputs(self, device, seed=0): (1, 3, 32, 32), generator=generator, device=torch.device(device), - dtype=torch.float16, + dtype=torch.float32, ) controlnet_conditioning_scale = 0.5 @@ -192,7 +192,7 @@ def get_dummy_inputs(self, device, seed=0): def run_pipe(self, components, use_sd35=False): sd_pipe = StableDiffusion3ControlNetPipeline(**components) - sd_pipe = sd_pipe.to(torch_device, dtype=torch.float16) + sd_pipe = sd_pipe.to(torch_device, dtype=torch.float32) sd_pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(torch_device) @@ -204,9 +204,9 @@ def run_pipe(self, components, use_sd35=False): assert image.shape == (1, 32, 32, 3) if not use_sd35: - expected_slice = np.array([0.5767, 0.7100, 0.5981, 0.5674, 0.5952, 0.4102, 0.5093, 0.5044, 0.6030]) + expected_slice = np.array([0.4578, 0.3582, 0.4046, 0.0953, 0.6878, 0.5821, 0.5541, 0.5888, 0.4651]) else: - expected_slice = np.array([1.0000, 0.9072, 0.4209, 0.2744, 0.5737, 0.3840, 0.6113, 0.6250, 0.6328]) + expected_slice = np.array([0.3721, 0.5626, 0.4657, 0.2845, 0.5241, 0.5917, 0.6265, 0.6955, 0.3969]) assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-2, ( f"Expected: {expected_slice}, got: {image_slice.flatten()}"