VAE – explained simply
The VAE translates between visible pixels and the compressed latent that the image model works with.
Also: Variational Autoencoder, VAE Decode, VAE Encode
A VAE has two halves: the encoder shrinks an image into a latent, and the decoder turns a latent back into an image. For text-to-image, only the decoder is needed at the end; for img2img and inpainting, the encoder is also needed at the beginning.
Each model family has its own VAE, and they are not interchangeable. The wrong VAE creates washed-out colors, spots, or total chaos. Some checkpoints already include the VAE; otherwise, you download it separately into the models/vae folder.
Decoding large images can use a lot of VRAM. Tiled decoding processes the image in chunks and saves memory.
What does that mean for you? If images look gray, pale, or blotchy, first check whether the matching VAE is loaded for the model.
Related terms
Errors where that matters
- A1111/Forge: A tensor with NaNs was produced (black image)
- Black images or NaN values (VAE precision)
- CUDA out of memory (VRAM full)
- ERROR: Could not detect model type of: … (Model is in the wrong folder or the wrong loader)
- expected input … to have 4 channels, but got 16 channels instead (latent or VAE does not match the model)
- Forge: You do not have CLIP / T5 / Qwen3 state dict!
- mat1 and mat2 shapes cannot be multiplied (models don’t match)
- Prompt outputs failed validation / Value not in list (Model missing)
- SwarmUI: All available backends failed to load the model (the real error is in the log)
- Warning: Ran out of memory when regular VAE decoding, retrying with tiled VAE decoding (VAE decoding falls back to tiles)