use_safetensors=True).to("cuda")
+ pipe.unet.set_default_attn_processor()

  prompt = "a photo of an astronaut riding a horse on mars"
  image = pipe(prompt).images[0]  torch.compile The torch.compile function can often provide an additional speed-up to your PyTorch code. In 🤗 Diffusers, it is usually best to wrap the UNet with torch.compile because it does most of the heavy lifting in the pipeline.   Copied from diffusers import DiffusionPipel