with enable_attention_slicing() or enable_xformers_memory_efficient_attention() to further minimize memory use.
To perform the VAE decode one image at a time, invoke enable_vae_slicing() in your pipeline before inference. For example:


	Copied
import torch
from diffusers import StableDiffusionPipeline

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