Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions tests/test_pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,10 +1208,9 @@ def test_stable_diffusion_img2img_pipeline(self):
)
image = output.images[0]

Image.fromarray((image * 255).round().astype("uint8")).save("fantasy_landscape.png")

assert image.shape == (512, 768, 3)
assert np.abs(expected_image - image).max() < 1e-2
# img2img is flaky across GPUs even in fp32, so using MAE here
assert np.abs(expected_image - image).mean() < 1e-2

@slow
@unittest.skipIf(torch_device == "cpu", "Stable diffusion is supposed to run on GPU")
Expand Down Expand Up @@ -1253,10 +1252,9 @@ def test_stable_diffusion_img2img_pipeline_k_lms(self):
)
image = output.images[0]

Image.fromarray((image * 255).round().astype("uint8")).save("fantasy_landscape_k_lms.png")

assert image.shape == (512, 768, 3)
assert np.abs(expected_image - image).max() < 1e-2
# img2img is flaky across GPUs even in fp32, so using MAE here
assert np.abs(expected_image - image).mean() < 1e-2

@slow
@unittest.skipIf(torch_device == "cpu", "Stable diffusion is supposed to run on GPU")
Expand Down Expand Up @@ -1299,8 +1297,6 @@ def test_stable_diffusion_inpaint_pipeline(self):
)
image = output.images[0]

Image.fromarray((image * 255).round().astype("uint8")).save("red_cat_sitting_on_a_park_bench.png")

assert image.shape == (512, 512, 3)
assert np.abs(expected_image - image).max() < 1e-2

Expand Down