Compression shrinks an image before Stable Diffusion does its heavy computational lifting. A Variational Autoencoder (VAE) learns how to preserve useful information while allowing imperfect reconstruction. section 4.3.1
A VAE handles compression in two steps:
- Encoding turns an image into a smaller representation called the latents. section 4.3.1
- Decoding runs the process in reverse, reconstructing an image from the latents. section 4.3.1
- Unlike JPEG or ZIP, a VAE learns compression for a specific balance of file-size reduction and generalization. section 4.3.1
Imperfect memory helps
A child drawing a house from memory cannot reproduce every detail, so the result becomes a general house rather than one exact house. Compression uses a similar trade-off: losing some information can help the model generalize. section 4.3.1
Figure 4.11 Closer look at the variational autoencoder.

Use the diagram to follow how the VAE connects image input, latent representation, and reconstructed output. section 4.3.1














