Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
backend_empty_cache,
floats_tensor,
load_image,
require_accelerator,
slow,
torch_device,
)
Expand Down Expand Up @@ -184,6 +185,15 @@ def get_dummy_inputs(self):


class TestStableDiffusionXLImg2ImgPipeline(StableDiffusionXLImg2ImgPipelineTesterConfig, PipelineTesterMixin):
# Re-declares the base method's decorators, which overriding would otherwise drop.
@pytest.mark.skipif(torch_device not in ["cuda", "xpu"], reason="half-precision inference requires CUDA or XPU")
@require_accelerator
@pytest.mark.parametrize("dtype", [torch.float16, torch.bfloat16], ids=str)
def test_half_precision_inference_no_nan(self, dtype):
if dtype == torch.bfloat16 and torch_device == "cuda" and torch.cuda.get_device_capability() < (8, 0):
pytest.xfail("produces NaNs in bfloat16 on GPUs without native bfloat16 support (e.g. T4)")
super().test_half_precision_inference_no_nan(dtype)

def test_components_function(self):
# `requires_aesthetics_score` is a config value, not a component, so it is not part of `pipe.components`.
init_components = self.get_dummy_components()
Expand Down
Loading