hoto of an astronaut riding a horse on mars"
image = pipe(prompt).images[0]
This should be as fast and memory efficient as xFormers. More details in our benchmark.
torch.compile
To get an additional speedup, we can use the new torch.compile feature. To do so, we simply wrap our unet with torch.compile. For more information and different options, refer to the
torch compile docs.


	Copied
import torch
from diffusers import StableDiffusionPipelin