LandmarkCVPR 2022Peer reviewedAdvanced

High-Resolution Image Synthesis with Latent Diffusion Models

Ran the diffusion process on a compressed version of the image instead of on raw pixels, cutting the cost of training and sampling while keeping quality, and added a way to steer generation with text.

Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer · Ludwig Maximilian University of Munich and IWR, Heidelberg University; Runway ML

TL;DR

Diffusion models made excellent images but were very expensive, because every one of their many steps worked on every pixel. This paper first squeezes images into a much smaller latent space with an autoencoder, runs diffusion there, and decodes the result once at the end.

01 · Problem

Pixel-space diffusion models such as DDPM (previous card) spend most of their effort on fine detail the eye barely notices. The authors note that training the most powerful ones “often takes hundreds of GPU days (e.g. 150 – 1000 V100 days)”, and that producing 50,000 samples took “approximately 5 days” on a single A100 GPU. That put training out of reach for most labs and made sampling slow.

02 · Method

Step one trains an autoencoder (a network that compresses an image to a small code and rebuilds it) that shrinks each side of the image by a factor f. The compressed code lives in a latent space, a smaller set of numbers that keeps the image’s meaningful content. Step two trains a diffusion model with a U-Net in that latent space; a finished sample is turned back into an image “with a single pass” through the decoder. The authors tried f from 1 (plain pixels) to 32 and found “LDM-4 and -8 offer the best conditions” for quality. To steer generation, they feed in text, class labels or layouts through cross-attention, the attention mechanism from the Transformer, letting the U-Net look up the conditioning input at each layer.

03 · Key result

On CelebA-HQ faces the model set “a new state-of-the-art FID of 5.11” (FID compares generated and real images; lower is better). On class-conditional ImageNet it reached an FID of 3.60 with guidance, against 4.59 for the earlier pixel-space diffusion model ADM-G. For text-to-image, a 1.45 billion parameter model trained on the LAION-400M image and caption dataset scored an FID of 12.63 on MS-COCO with guidance. The abstract also claims new state-of-the-art scores for inpainting (filling in masked parts of an image). In the paper’s own inpainting comparison, training throughput rose from 0.11 samples per second in pixel space to 0.32 with a factor-4 latent space.

Why it matters

Latent diffusion is the design behind Stable Diffusion, the openly released text-to-image model that put high-quality image generation on ordinary graphics cards in 2022, and the compress-then-diffuse idea is now standard in image and video generators. Its text conditioning through cross-attention links this path back to the Transformer in path 2. The authors are clear about the limits: the autoencoder can lose fine pixel-level detail, sampling is still step by step and slower than a GAN, and they call generative image models “a double-edged sword”, naming deepfakes, leaks of training data and biases copied from the data as risks.

Deep dive coming

This is a lite card. The full version adds the core idea in technical detail, the choice of compression factor, the conditioning mechanism, the super-resolution and inpainting results, limitations and open questions.