diff --git a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py index c8c6247960af..02b5f63e3940 100644 --- a/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py +++ b/src/diffusers/pipelines/stable_diffusion_xl/pipeline_stable_diffusion_xl.py @@ -1106,6 +1106,9 @@ def __call__( # 4. Prepare timesteps timesteps, num_inference_steps = retrieve_timesteps(self.scheduler, num_inference_steps, device, timesteps) + # Helpful when using `torch.compile()` to get a nice graph. + if hasattr(self.scheduler, "sigmas") and self.scheduler.sigmas.device.type == "cuda": + self.scheduler.sigmas = self.scheduler.sigmas.tolist() # 5. Prepare latent variables num_channels_latents = self.unet.config.in_channels