What Is a VAE in Stable Diffusion? Encoding and Decoding Images
Diffusion models do not work on full-resolution pixels; that would be too expensive. A VAE compresses images into a much smaller latent representation and expands them back afterwards.
Encode and decode
- Encode: used for image-to-image and inpainting, turning your picture into latents.
- Decode: the last step of every generation, turning the final latent into the image you see.
Model-specific VAEs
Each model family has a matching VAE: SD 1.5, SDXL and FLUX-family models use different ones, and newer models often ship their own. The wrong VAE causes washed-out colours, artefacts or noise.
VAE and memory
The decode step can be one of the most memory-hungry moments, especially at high resolution. If generation finishes but crashes at the end, use tiled VAE decoding, which most UIs offer.
Baked-in VAEs
Many checkpoints include their VAE. Some workflows load it separately; check the model card.
Common questions
Why are my images washed out or grey?
Usually the wrong VAE or no VAE is being used for that model family. Load the VAE recommended on the model card.
What is tiled VAE decoding?
Decoding the image in tiles to reduce peak VRAM, useful at high resolutions where a full decode would run out of memory.
Related
More terms: ControlNet · Denoising strength · FP8 · Hires fix · IP-Adapter · Sampler · Full glossary