sionPipeline

pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5", torch_dtype=torch.float16)
pipe = pipe.to("cuda")

prompt = "a photo of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]
If you want to enable it explicitly (which is not required), you can do so as shown below.


	Copied
import torch
from diffusers import StableDiffusionPipeline
from diffusers.models.cross_attention import AttnProc