diff --git a/src/diffusers/models/attention_processor.py b/src/diffusers/models/attention_processor.py index f83a1753dac5..e2fdde0c058f 100755 --- a/src/diffusers/models/attention_processor.py +++ b/src/diffusers/models/attention_processor.py @@ -325,11 +325,11 @@ def set_use_xla_flash_attention( """ if use_xla_flash_attention: if not is_torch_xla_available: - raise "torch_xla is not available" + raise RuntimeError("torch_xla is not available") elif is_torch_xla_version("<", "2.3"): - raise "flash attention pallas kernel is supported from torch_xla version 2.3" + raise RuntimeError("flash attention pallas kernel is supported from torch_xla version 2.3") elif is_spmd() and is_torch_xla_version("<", "2.4"): - raise "flash attention pallas kernel using SPMD is supported from torch_xla version 2.4" + raise RuntimeError("flash attention pallas kernel using SPMD is supported from torch_xla version 2.4") else: if is_flux: processor = XLAFluxFlashAttnProcessor2_0(partition_spec) diff --git a/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py b/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py index 96f53b16cbe8..36cd0a854090 100644 --- a/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py +++ b/src/diffusers/pipelines/controlnet_sd3/pipeline_stable_diffusion_3_controlnet_inpainting.py @@ -1262,7 +1262,7 @@ def __call__( control_image = control_images else: - assert ValueError("Controlnet not found. Please check the controlnet model.") + raise ValueError("Controlnet not found. Please check the controlnet model.") if controlnet_pooled_projections is None: controlnet_pooled_projections = torch.zeros_like(pooled_prompt_embeds)