Papers · 2021 · Reading: 24 min, plus 2 in closed details · +3h 55m of resources.
Paper · CVPR 2022 (oral) · arXiv 2112.10752

High-Resolution Image Synthesis with Latent Diffusion Models (LDM / Stable Diffusion)

Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer
Ludwig Maximilian University of Munich and IWR, Heidelberg University; Runway ML · December 2021 (arXiv v1 20 December 2021; v2 13 April 2022)

In one line: Runs DDPM in a mildly compressed autoencoder latent space with cross-attention conditioning, matching pixel-space quality at a fraction of the compute; became Stable Diffusion and made latent diffusion the default generative recipe.

≥ 2.7× faster
latent (f = 4) against pixel-space diffusion, same parameters
train and sample throughput on inpainting, with 1.55 to 1.65× lower FID · Table 6
3.60 FID
class-conditional ImageNet 256², guided LDM-4
against 4.59 for pixel-space ADM-G, with 3.5× less training compute (Table 18) · Table 3
12.63 FID
text-to-image on MS-COCO, 1.45B parameters
against 12.24 (GLIDE) and 11.84 (Make-A-Scene) at 4 to 6B · Table 2

How far to trust it: Believe the idea and the efficiency: the compute ratios recompute from the paper's own tables, and every large image and video model since generates in a latent. Read the individual FIDs as single runs, several printed inconsistently between tables and figures, and "on par" in text-to-image as slightly behind GLIDE and Make-A-Scene. The evidence, point by point.

The idea in one sentence

Train an autoencoder once to squeeze away the detail you cannot see (a 256² image becomes a 64 × 64 × 3 or 32 × 32 × 4 grid), run ordinary diffusion in that small latent with cross-attention to a text or other condition, and decode once at the end: about the same quality as pixel-space diffusion for a few times less compute, which is what made Stable Diffusion run on a consumer GPU.

The denoiser never sees a pixel: encode once, diffuse the small tensor, decode once. Fig. 1 is the paper's Figure 3 run by this page's toy models: every grid is drawn one tile per number at one cell size, so the image and its latent are to scale. Drag it to turn it.

  1. The image: 3,072 numbers. A 32 × 32 picture of "red circle, top left" as three channel layers, R, G and B (each layer shades from black to its own colour). Pixel-space diffusion would denoise every one of these numbers at every step.
  2. The encoder ℰ squeezes it to 192 numbers. The toy's f = 4 autoencoder maps it to z = ℰ(x), three 8 × 8 maps (orange positive, blue negative): 16 times fewer numbers, still a 2-D grid (§3.1). Training noises this z, never the pixels (Eq. 2).
  3. Sampling starts from 192 numbers of noise. To generate, the encoder is not needed: zT is drawn from 𝒩(0, I) at the latent's shape.
  4. τθ turns the prompt into vectors. The condition encoder reads the three prompt tokens and returns one 24-number vector each (the real values, drawn as signed bars): these become the keys and values of every cross-attention layer (§3.3).
  5. εθ denoises the small tensor, reading the prompt. The UNet works on 8 × 8 maps (16 channels, then 4 × 4 × 28, then 8 × 8 again, with a skip); each level's cross-attention pulls from the tokens, the streams' density set by the attention the toy actually paid, averaged over positions and steps (first 8 × 8 level: red, circle and top left). The latent plates replay the 20 guided DDIM steps: the chain's multiply-adds in all.
  6. The decoder 𝒟 runs once. One pass (a few million multiply-adds) turns the final 192 numbers back into a 32 × 32 × 3 image; the page's checker reads it back.
  7. The whole pipeline, to scale. 3,072 numbers in, 192 through every denoising step, 3,072 out. The toy's pixel-space model, at a matched parameter count, would spend about four times as many multiply-adds on the same 20 guided steps (two network evaluations each).

ℰ and 𝒟 are the stage-1 autoencoder, trained once and frozen; εθ is the stage-2 UNet; τθ encodes the condition y into the keys and values of every cross-attention layer, while spatially aligned inputs are concatenated to the latent instead (§3). The arXiv paper is not CC BY, so no copy of the original figure. Toy models: the f = 4 autoencoder and the latent model of the Generate tab (seed 3, guidance 3, the chain the Idea animation replays), counted live in your browser; the pixel-space figure is the toy pixel model's measured multiply-adds per evaluation times 40.

You need how a diffusion model trains and samples (DDPM, Diffusion from zero: DDPM, samplers and guidance). How today's latent models are built (DiT, MMDiT, text encoders) is on Latent diffusion and diffusion transformers.

New terms. Perceptual compression: removing imperceptible high-frequency detail (the autoencoder's job). Semantic compression: learning what the image is (the diffusion model's job). f: the autoencoder's downsampling factor per side; LDM-f is a model in that latent, LDM-1 is pixel space. KL-reg. and VQ-reg.: the two mild regularisers of the latent. τθ: the condition encoder.

Problem

§1 Introduction, Figures 1 and 2

By late 2021 diffusion models led image synthesis, class-conditional ImageNet and super-resolution among them, but they ran in pixel space and were very expensive: "training the most powerful DMs often takes hundreds of GPU days (e.g. 150 - 1000 V100 days)", and because the same network runs "sequentially for a large number of steps (e.g. 25 - 1000 steps)", "producing 50k samples takes approximately 5 days on a single A100" (§1, both citing ADM). That last figure checks out: Table 18 gives pixel-space ADM 0.12 samples per second, and 50,000 / 0.12 s is days (Table 18, recomputed independently).

The root cause, the authors argue, is where a likelihood model spends its effort. Being mode-covering, such models "spend excessive amounts of capacity (and thus compute resources) on modeling imperceptible details" (§1). A rate-distortion plot of a trained pixel-space DDPM makes it visible: most bits of an image encode details you cannot see, and the semantic composition costs few. Learning splits into a perceptual compression stage that removes high-frequency detail and a semantic compression stage that learns what the image is (Figure 2, with data from DDPM). The DDPM page rebuilds that rate-distortion curve from DDPM's own table: more than half of the 3.75 bits per dimension describe imperceptible distortion. Yet the network and its gradients "still need to be evaluated on all pixels" (Figure 2).

Earlier two-stage models already worked on a compressed space, but for autoregressive transformers, which force heavy compression into a 1-D token sequence: VQ-VAE-2, VQGAN with a transformer, DALL-E. "The high compression rates required for feasible ARM training ... limit the overall performance" (§2). Figure 1 puts numbers on the cost of that compression, reconstructing ImageNet images: this paper's f = 4 autoencoder reaches PSNR 27.4 and reconstruction FID 0.58; DALL-E's f = 8 tokenizer 22.8 and 32.01; VQGAN's f = 16 19.9 and 4.98 (Figure 1, Table 8).

The question: can a diffusion model skip the imperceptible bits, keep the fidelity, and train and sample on a budget an ordinary lab can afford?

Compress less and keep the detail: the f = 4 autoencoder reconstructs far better than the tokenizers built for autoregressive models

Figure 1's numbers as printed in Table 8 (VQ-reg. f = 4 with an 8,192-entry codebook; DALL-E's f = 8 tokenizer; VQGAN f = 16, 16,384 entries). Every autoencoder of the table is in the f sweep chart below.

Prompt: ; 20 DDIM steps, guidance 3, seed .

Each step of the chain is computed live by the toy network (DDIM, η = 0, as the paper samples; classifier-free guidance doubles the network evaluations). At the paper's scale the same picture is 256 × 256 × 3 = 196,608 numbers against 64 × 64 × 3 = 12,288 for LDM-4 or 32 × 32 × 4 = 4,096 for LDM-8; Stable Diffusion's 512 × 512 × 3 image is a 64 × 64 × 4 latent, 48 times fewer numbers (Table 13, SD config).

Idea

§3 Method

Separate the two kinds of compression and give each to the model that is good at it. First train an autoencoder once, so its latent space is "perceptually equivalent" to the image space but much smaller; then run ordinary diffusion in that latent, and decode once at the end (§3). Because a UNet is built for 2-D grids, the latent can stay a 2-D grid and the compression can be mild (a factor f of 4 or 8 per side, not 16 to 32), which keeps the details the earlier token models lost (§3). The authors call the result Latent Diffusion Models, LDMs.

In the animation, two real toy models trained for this page (the Generate tab has the details) generate the same prompt: one diffuses 32 × 32 × 3 pixels, the other the 8 × 8 × 3 latent of an f = 4 autoencoder, both with about 50,000 parameters, the same training steps and the same sampler. Every number is drawn as one cell at the same size, so the two chains are to scale; the counters are the actual multiply-adds the JavaScript performs. It plays once when scrolled into view; the toggle switches chains and any control stops it.

  1. The space. Pixel-space diffusion works on the image itself: 32 × 32 × 3 = 3,072 numbers here (196,608 at 256² in the paper). Every cell is one number.
  2. Start from noise. xT is 3,072 numbers of pure Gaussian noise. Every denoising step must process all of them.
  3. Steps 1 to 5: layout first. The UNet predicts the noise in all 3,072 numbers, twice per step (with and without the prompt, for guidance). The small image is the current guess of the clean image, x̂0: where the shape is and its colour appear first.
  4. Steps 6 to 10. The same network keeps refining every pixel, including the background grain nobody can see.
  5. Steps 11 to 15. The edges sharpen. Most of the remaining work is perceptual detail.
  6. Steps 16 to 20. The last steps change the image very little, yet cost as much as the first.
  7. Nothing to decode. The final x0 is already the image. All the cost was in the 20 steps.
  8. Check. The deterministic checker reads the shape, colour and position from the pixels.
LDM-4's latent has 16 times fewer spatial positions than the image. With the UNets matched in parameter count, how much faster does it sample than pixel-space diffusion in the paper's measurement?

Stage 1: perceptual image compression

§3.1, Appendix G

The autoencoder follows VQGAN: an encoder ℰ maps an RGB image x ∈ ℝH×W×3 to z = ℰ(x) ∈ ℝh×w×c, a decoder 𝒟 reconstructs x̃ = 𝒟(ℰ(x)), and the downsampling factor is f = H/h = W/w = 2m (§3.1). It is trained with a perceptual loss (LPIPS) plus a patch-based adversarial loss, which keeps reconstructions "confined to the image manifold by enforcing local realism and avoids bluriness introduced by relying solely on pixel-space losses such as L2 or L1" (§3.1).

LAutoencoder = minℰ,𝒟 maxψ ( Lrec(x, 𝒟(ℰ(x))) − Ladv(𝒟(ℰ(x))) + log Dψ(x) + Lreg(x; ℰ, 𝒟) )
Equation 25 (Appendix G): Dψ is the patch discriminator, Lreg one of the two regularisers below.

To avoid "arbitrarily high-variance latent spaces" the latent gets one of two mild regularisers (§3.1, Appendix G):

  • KL-reg.: a KL penalty towards a standard normal, as in a VAE, but weighted by about 10−6, so it is a barely regularised VAE (the released config sets kl_weight: 0.000001, autoencoder config).
  • VQ-reg.: a vector-quantisation layer with a large codebook, "absorbed by the decoder": the diffusion model works on z before quantisation, so the model "can be interpreted as a VQGAN" with the quantiser as the first layer of 𝒟.

Two choices make this different from earlier tokenizers. The latent keeps its 2-D layout, where VQGAN and DALL-E impose "an arbitrary 1D ordering" for an autoregressive model; and the compression is mild, f = 4 to 8 (a 256² image becomes 64 × 64 × 3 or 32 × 32 × 4), so reconstructions stay faithful (§3.1, Table 8). The autoencoder is "trained only once" and reused for every diffusion model and task (§1). The paper's own autoencoders are on the Tables tab; here is the toy's.

Try: build an image in the explorer, then see what the toy f = 4 autoencoder keeps. The latent is three 8 × 8 maps, 16 times fewer numbers; the decoder turns it back into 32 × 32 × 3. Note what is lost: the faint grain of the background, the "imperceptible detail" the second stage never has to model.

Rescaling the latent: where the 0.18215 in every Stable Diffusion v1 config comes from

A KL-reg. latent is not unit-variance, and its scale sets the signal-to-noise ratio the diffusion model sees. The paper divides z by its component-wise standard deviation σ̂, estimated from the first batch (Appendix G); without it the ratio is "very high, such that the model allocates a lot of semantic detail early on in the reverse denoising process", which shows up in convolutional sampling (D.1, Figure 15). VQ latents have variance close to 1 and need no rescaling. This is the scale_factor: 0.18215 in every Stable Diffusion v1 config (config); FLUX's 16-channel autoencoder uses 0.3611 (FLUX code, beyond the paper). The toy's encoder needed 1 / σ̂ = .

Stage 2: diffusion in the latent space

§3.2, Eq. 1 and 2, Appendix B

The diffusion part is DDPM unchanged (DDPM page, which runs it and explains the chain). A diffusion model is "an equally weighted sequence of denoising autoencoders" εθ(xt, t), trained to predict the noise in a noised input, with the reweighted bound (§3.2):

LDM = 𝔼x, ε∼𝒩(0,1), t [ ‖ε − εθ(xt, t)‖²2 ]
Equation 1 (§3.2), t uniform on {1, …, T}; Appendix B derives it from the ELBO in signal-to-noise form, SNR(t) = αt² / σt² (Appendix B).

The only change is the space:

LLDM := 𝔼ℰ(x), ε∼𝒩(0,1), t [ ‖ε − εθ(zt, t)‖²2 ]
Equation 2 (§3.2). εθ(∘, t) is a time-conditional UNet.

"Since the forward process is fixed, zt can be efficiently obtained from ℰ during training, and samples from p(z) can be decoded to image space with a single pass through 𝒟" (§3.2). For a KL latent, training draws z = ℰμ(x) + ℰσ(x) · ε, then rescales it (Appendix G). Why it is cheap: every one of the tens to hundreds of denoising steps runs on f² fewer spatial positions (16 times for f = 4, 64 for f = 8), while the latent stays a grid, so the UNet keeps its 2-D convolutional inductive bias (§3.2). Unlike earlier two-stage work, the prior is learned separately from a frozen first stage, so there is no "delicate weighting of reconstruction and generative abilities" as in LSGM, which trains both jointly (§1, §4.2).

Conditioning via cross-attention

§3.3, Eq. 3, Figure 3, Appendix E.2.1

To make the model conditional on arbitrary inputs y (text, semantic maps, layouts), a domain-specific encoder τθ turns y into a sequence τθ(y) ∈ ℝM×dτ, and cross-attention layers inside the UNet let every position of a flattened feature map look at that sequence (§3.3):

Attention(Q, K, V) = softmax(QKT / √d) · V,   Q = WQ(i) · φi(zt),   K = WK(i) · τθ(y),   V = WV(i) · τθ(y)
φi(zt) ∈ ℝN×dεi is the UNet's flattened intermediate map: queries come from the image, keys and values from the condition (§3.3, Figure 3).
LLDM := 𝔼ℰ(x), y, ε∼𝒩(0,1), t [ ‖ε − εθ(zt, t, τθ(y))‖²2 ]
Equation 3 (§3.3): τθ and εθ are trained jointly.

These layers sit inside εθ in Fig. 1 at the top (its step 5 shows the toy's three of them reading the prompt). What τθ is depends on the condition:

  • Text and classes: τθ is a transformer trained from scratch on BERT tokens for text, one learned embedding for an ImageNet class, both read through cross-attention.
  • Spatially aligned conditions (super-resolution, inpainting, semantic maps) are simply concatenated to the UNet input channel-wise (§4.3.2). Because such a model is convolutional, one trained at 256² generalises at sampling time to larger images, "up to the megapixel regime", about 1,024² (§4.3.2, Figure 9); with rescaled latents and guidance the text model also renders beyond 256² (Figure 13).
The text encoder and the layout tokens, exactly
  • Text: τθ is an unmasked transformer over BERT-tokenised prompts, trained from scratch with the UNet: 32 layers of width 1,280, 77 tokens (§4.3.1, Table 17, Eq. 18 to 23). In the UNet, each self-attention layer of the "ablated UNet" becomes a small transformer block of self-attention, an MLP and cross-attention (Table 16).
  • Layouts: each bounding box becomes a (top-left, bottom-right, class) token; class labels: τθ is one learned 512-dimensional embedding, so ImageNet conditioning is also cross-attention (E.2.1).

The best numbers also use classifier-free guidance at a scale s (Ho and Salimans, the paper's [32]; how it works and what it costs: Diffusion from zero). The v2 changelog says both the text-to-image and ImageNet models were updated to use it (Appendix A).

The same 1.45B text-to-image LDM, sampled with and without classifier-free guidance (s = 1.5). What happens to its MS-COCO FID (lower is better)?

How much compression: the f sweep

§4.1, Figures 6 and 7, Tables 8 and 13

The central experiment trains class-conditional ImageNet LDMs at f ∈ {1, 2, 4, 8, 16, 32} (LDM-1 is pixel space) with the computational resources fixed: "a single NVIDIA A100 for all experiments in this section", the same number of steps and the same number of parameters (§4.1). Fig. 4 draws the tensor each model diffuses, to scale: one length per number on every axis, so a box's volume is its count of numbers. Shapes from Table 13; reconstruction FIDs (rFID, lower is better) are the range over Table 8's autoencoders with that f; the verdicts are Figure 6's, after 2M steps (Figure 6).

  1. LDM-1, pixel space: 196,608 numbers. A 256² image is 256 × 256 × 3. f = 1 and 2 "result in slow training progress": the diffusion model is left with most of the perceptual compression. On one A100 it trained with a batch of 7.
  2. f = 2: 128 × 128 × 2 = 32,768. 6 times fewer numbers, 4 times fewer positions. It reconstructs almost perfectly (rFID 0.086 to 0.40), yet still trains slowly; batch 9.
  3. f = 4: 64 × 64 × 3 = 12,288. 16 times fewer numbers and positions; rFID 0.27 to 1.06; batch 40. LDM-4 is the paper's main ImageNet, super-resolution and inpainting model.
  4. f = 8: 32 × 32 × 4 = 4,096. 48 times fewer numbers, 64 times fewer positions; rFID 0.90 to 1.49; batch 64. The sweep shows "a significant FID gap of 38 between pixel-based diffusion (LDM-1) and LDM-8 after 2M training steps"; the text-to-image model, and later Stable Diffusion, use this f.
  5. f = 16: 16 × 16 × 8 = 2,048. 96 times fewer numbers; rFID 0.87 to 5.15; batch 112. f = 4 to 16 "strike a good balance" between efficiency and perceptually faithful results.
  6. f = 32: 8 × 8 × 32 = 2,048. As many numbers as f = 16 but 1,024 times fewer positions: the channels grow into a tower. rFID 2.04 to 31.83. f = 32 causes "stagnating fidelity after comparably few training steps": the first stage has thrown information away. (Table 13 prints this shape as "88 × 8 × 32", a misprint.)
  7. What fits on one A100. The columns behind are the batch each LDM trained with on the same GPU at about the same parameter count (Table 13): 7 in pixel space, 112 at f = 16 and 32. The orange pair, LDM-4 and LDM-8, is the paper's choice.

Against sampling speed (DDIM with 10 to 200 steps), LDM-4 and LDM-8 give the best trade-off on CelebA-HQ and ImageNet, and "complex datasets such as ImageNet require reduced compression rates" (Figure 7). The summary: "LDM-4 and -8 offer the best conditions for achieving high-quality synthesis results" (§4.1). Figures 6 and 7 exist only as images, so their curves are not rebuilt here; the chart uses what is printed: the reconstruction quality of every autoencoder (Table 8) and, as a measure of cost, the batch size each LDM could afford on the same A100 (Table 13).

Results

§4 Experiments, Tables 1 to 7
  • Unconditional generation: a new state-of-the-art FID of 5.11 on CelebA-HQ 256², ahead of GANs and LSGM; competitive but not first on FFHQ (4.98 against ProjectedGAN's 3.08), LSUN-Churches (4.02 against 1.59) and LSUN-Bedrooms (2.95 against 1.52 and ADM's 1.90). Precision and recall are as good as or better than the GANs' everywhere (Table 1, §4.2). On Bedrooms it comes close to ADM with half the parameters and about 4 times less training compute (recomputed on the Tables tab).
  • Text-to-image: a 1.45B-parameter KL-reg. LDM-8 trained on LAION-400M reaches FID 12.63 on MS-COCO 256² with classifier-free guidance (23.31 without), against 12.24 for GLIDE and 11.84 for Make-A-Scene, which have 4 to 6 times the parameters (Table 2). Table 2 lists GLIDE at 6B; the GLIDE paper describes a 3.5B model plus a 1.5B upsampler, 5B in all (GLIDE §4). This model is the direct ancestor of Stable Diffusion.
  • Class-conditional ImageNet 256²: FID 3.60 with guidance, against pixel-space ADM-G's 4.59, with 400M parameters against 608M (Table 3) and 271 V100-days against 962 (Table 18).
LDM-4-G beats ADM-G on ImageNet (3.60 against 4.59 FID). How much training compute did it use, relative to ADM-G?
  • Efficiency against a matched pixel model: on inpainting with parameters fixed, "a speed-up of at least 2.7× between pixel- and latent-based diffusion models while improving FID scores by a factor of at least 1.6×" (§4.5, Table 6). The speed-up holds; the FID factor holds for the two rows with attention (1.63× and 1.65×) but is 1.55× for the attention-free one. The old page stated this as a general result; it is measured on the inpainting task only.
  • Super-resolution (×4, ImageNet, bicubic degradation as in SR3): FID 2.8 against SR3's 5.2, while SR3 has the better IS (180.1 against 166.3), and a plain regression model wins PSNR and SSIM, metrics that "favor blurriness" (Table 5). The user study is against the paper's own pixel-space baseline, not SR3: LDM-4 preferred in 70.6% of pairs (Table 4). A model trained with more varied degradations, LDM-BSR, generalises to real images up to 1,024² (D.6.1).
  • Inpainting on Places: FID 1.50 on 512² test crops for the larger 387M model fine-tuned at 512², against LaMa's 2.21 and CoModGAN's 1.82; LPIPS is slightly worse than LaMa's, which the authors attribute to LaMa producing one average-looking result against the LDM's diverse ones; people preferred the LDM in 68.1% of pairs (Table 7, Table 4).
  • Layouts and semantic maps: layout-to-image on COCO at 40.91 FID, ahead of the GAN baselines when fine-tuned from OpenImages (Table 9); semantic synthesis generalises convolutionally to megapixel landscapes (Figure 9).
Every table, sortable, with the derived numbers recomputed

The Tables tab has Tables 1 to 11 and 18 as printed, with distances from the best row, the Table 6 ratios and the Table 18 compute converted to A100-days, plus 18 checks of the paper's own numbers against each other.

Limitations and societal impact

§5

The authors' own caveats: sampling is still sequential and "slower than that of GANs", and the autoencoder's reconstruction "can become a bottleneck for tasks that require fine-grained accuracy in pixel space"; they assume the super-resolution models are "already somewhat limited in this respect" (§5). On impact, cheaper training "democratize[s]" the technology and also makes it easier "to create and disseminate manipulated data or spread misinformation and spam", deep fakes disproportionately affect women, generative models can reveal their training data, and the two-stage approach may misrepresent the data in ways that remain "an important research question" (§5).

How much of this to believe

the paper's evidence, judged

What holds up.

  • The efficiency claim recomputes from the paper's own tables: Table 6's speed-ups are 2.7× to 4.9×, Table 18 has LDM-4-G at 3.5× less compute than ADM-G and LSUN-Bedrooms at 3.9× less than ADM, and the 5-day sampling figure matches ADM's printed throughput (Tables tab).
  • The f sweep is the right experiment: one GPU, the same steps and parameters for every f, and the learning rates "maximize[d] ... such that they still train stably" per model rather than fixed in a way that favours one (E.3.5).
  • Later history is the strongest evidence: Stable Diffusion, SDXL, SD3, FLUX, DiT and Sora all generate in an autoencoder's latent (Why it matters, below).
  • The authors are candid: they report where they are not first (FFHQ, the LSUN sets, Make-A-Scene), that LPIPS is worse than LaMa's, that two FID implementations disagree (7.76 against 7.77, 2.95 against 3.0, E.3.1), and their own limitations.

Weaknesses.

  • Single runs, no error bars on FID. Every FID is one trained model; IS has ± values, FID never does. Figures 6 and 7 use 5,000 samples "for efficiency reasons", so they "might vary from those shown in Tab. 1 and 10" (E.3.5). Margins such as 12.63 against 12.24 are within what an FID implementation alone moves.
  • Not like for like. Rival numbers are copied from other papers, not rerun (Table 2's GLIDE and Make-A-Scene from [26], Table 18's compute from ADM); the LDM compute is A100-days converted at an assumed 2.2× (Table 18). The ImageNet win uses classifier-free guidance at a chosen scale against ADM's classifier guidance. The inpainting record is the bigger, fine-tuned model; the matched 215M models land at LaMa's level (2.15 and 2.37 against 2.21).
  • The headline text-to-image model is under-documented: its hyperparameters are in Table 15, but its training compute appears nowhere, and "on par" means slightly behind: Make-A-Scene's 11.84 is the table's bold best (Table 2).
  • The cost argument is in time, not FLOPs. The paper never counts the UNets' FLOPs; it measures throughput on one GPU setup, and the authors note Table 6 deviates from Figure 7 "due to varying GPU settings/batch sizes".

The tables also disagree with each other in a handful of copied details (step counts, parameter counts, one compute row); none changes a conclusion.

The cross-table inconsistencies, each located
  • LSUN-Churches LDM-8 appears as 200 steps (Table 1) and 100 steps at 410K iterations (Table 18) against 500k (Table 12), with 294M or 256M parameters, and Figure 30 prints FID 4.48 for the 4.02 model; CelebA-HQ is 5.11 in Table 1 and 5.15 in Figure 28; Table 18's Bedrooms row has overall compute (55) below generator compute (60); Table 13 prints the LDM-32 latent as "88 × 8 × 32" (Tables tab).

Verdict. Believe the idea and the efficiency: they are measured, they recompute, and the field adopted them wholesale. Treat individual FIDs as single runs good to about ±0.5, the cross-table details as carelessly copied, and the text-to-image comparison as "close", not "better". The toy on this page agrees in direction at small scale and says where it cannot test the claim (Generate tab).

"What it takes to use this" is left out: the method is the standard recipe of every open image model, and Then and now covers what replaced each part. Code: CompVis/latent-diffusion (MIT); Stable Diffusion weights: CreativeML OpenRAIL-M, a licence "which contains specific use-based restrictions" (SD README).

Why it matters (beyond the paper)

This is the paper that became Stable Diffusion. The CompVis README describes it as "a Latent Diffusion Model on 512x512 images from a subset of the LAION-5B database", with "a frozen CLIP ViT-L/14 text encoder", "its 860M UNet and 123M text encoder", running "on a GPU with at least 10GB VRAM"; v1 uses "a downsampling-factor 8 autoencoder" and "was pretrained on 256x256 images and then finetuned on 512x512 images" (SD README); its licence is dated August 22, 2022. The config is this paper's: an f = 8 KL autoencoder with 4 latent channels, a cross-attention UNet with context dimension 768, the same 0.18215 scale factor (v1 config). Open weights put a text-to-image model on consumer GPUs.

The deeper contribution is the recipe: generate in a perceptually compressed latent and let a cheap decoder handle the last octave of detail. SD 2 and SDXL kept the latent UNet (SDXL's is 2.6B parameters with two text encoders, SDXL Table 1). DiT replaced the UNet with a Transformer on latent patches, using "an off-the-shelf pre-trained variational autoencoder (VAE) model from Stable Diffusion" (DiT §5). Stable Diffusion 3 moved to a rectified-flow objective and a Transformer but still denoises an f = 8 latent, now with 16 channels because "increasing the number of latent channels d significantly boosts reconstruction performance" (SD3 §5.2.1); FLUX.1 is "a 12 billion parameter rectified flow transformer" on a 16-channel latent (model card). How those successors are built is taught on Latent diffusion and diffusion transformers.

Beyond images: video and audio latent models (as of October 2026)

Video and audio followed: Sora is "trained on and subsequently generates videos within this compressed latent space" (Sora report); Stable Video Diffusion (arXiv 2311.15127), AudioLDM (arXiv 2301.12503) and Stable Audio (arXiv 2402.04825) are latent diffusion models by name. The old version of this page also counted Veo and many 3D and molecule systems; those are not checked against a source here (unconfirmed).

The cross-attention interface became the standard plug for conditions: ControlNet adds spatial control by copying the encoder of a "locked" Stable Diffusion (ControlNet), and IP-Adapter adds image prompts through a "decoupled cross-attention mechanism" (IP-Adapter). And the democratisation the paper aimed at happened: hobbyists fine-tune Stable Diffusion with low-rank adapters on its attention layers (Hugging Face, LoRA for Stable Diffusion).

Connections

  • DDPM (2020-06): supplies the entire diffusion objective and the ε-predicting UNet; LDM changes only where the chain runs.
  • CLIP (2021-02): this paper uses a BERT-tokenised transformer trained from scratch, but Stable Diffusion swapped in CLIP's frozen text encoder as τθ.
  • ViT (2020-10): the DiT successors replace LDM's UNet with a Transformer while keeping its latent space.
  • Attention Is All You Need (2017-06): cross-attention conditioning is the Transformer's encoder-decoder attention grafted into a UNet.
  • LoRA (2021-06): the usual way Stable Diffusion is fine-tuned on a small budget.
  • Topics: generative-and-multimodal (diffusion, VAEs, text-to-image).