StableDiffusionPipeline is a Diffusers interface for running Stable Diffusion text-to-image generation without manually assembling the diffusion process. It loads a pretrained checkpoint, accepts a prompt, and returns generated images. section 10.1
A typical generation workflow proceeds as follows:
- Call from_pretrained() with a checkpoint such as CompVis/stable-diffusion-v1-4. section 10.1
- Choose float16 with variant="fp16" and torch_dtype=torch.float16 to reduce computation time, then move the pipeline to CUDA. section 10.1
Prompt-controlled generation
A prompt such as “an astronaut in a spacesuit riding a unicorn” produces an image through a few pipeline calls. Multiple prompts can generate a panda eating noodles, a dog with sunglasses, and a cat stretching, then be arranged into a grid. Width, height, and guidance_scale can also be supplied for customized generation.
