Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

High-Resolution Image Synthesis with Latent Diffusion Models

  • Problem Pixel-space diffusion models need hundreds of GPU days to train and many sequential network passes to sample, so their cost grows with image resolution.
  • Method Trains diffusion models in the latent space of a pretrained perceptual autoencoder and adds cross-attention conditioning to the UNet backbone.
  • Results Reached FID 5.11 on CelebA-HQ at 256×256 with LDM-4 and 500-s sampling, and FID 3.60 for LDM-4-G with classifier-free guidance at s = 1.5 on class-conditional ImageNet.

Why pixel-space diffusion is expensive

Diffusion models (DMs) produce strong image synthesis, but training and sampling them directly in pixel space is expensive. The work cited as [15] needed between 150 - 1000 V100 days of training, and about 5 days on a single A100 to produce 50k samples. Sampling is also slow because the same network runs sequentially for many steps, 25 - 1000 steps in [15].

Training at this scale is open only to a small part of the field and carries a large carbon footprint. Each gradient and each evaluation in pixel space touches every pixel of a high-dimensional RGB image, so the cost follows the image resolution. The goal is therefore to lower the compute for both training and sampling without losing sample quality.

Separating compression from generative learning

Looking at a trained pixel-space model, the authors see learning fall into two stages. The first is perceptual compression, which removes high-frequency detail while learning little semantic variation; the second is semantic compression, where the generative model learns the composition of the data. The plan follows from this split: find a space that is perceptually equivalent to the image space but cheaper to model, and train the diffusion model there.

Training therefore has two phases: an autoencoder first yields a lower-dimensional latent space that is perceptually equivalent to the data, and then the diffusion model is trained on that latent space. Because the diffusion model runs on the latent space, the autoencoder does not need heavy spatial downsampling, since the latent space scales better with spatial dimensionality.

The autoencoder is trained once and can be reused for several diffusion trainings and for other tasks. Once the diffusion model is trained, a sample is generated in latent space and then decoded to an image in a single network pass.

The perceptual compression autoencoder

The autoencoder follows earlier work and combines a perceptual loss with a patch-based adversarial objective. The adversarial term keeps reconstructions on the image manifold, because pixel-only L2 or L1 objectives produce blur. For an RGB image x, the encoder gives a latent z and the decoder maps it back, as in \[ z = E(x), \qquad \tilde{x} = D(z) = D(E(x)), \qquad z \in \mathbb{R}^{h \times w \times c}.

\] The downsampling factor is \( f = H/h = W/w \), and the authors study factors \( f = 2^m \) with m in N.

Two regularizers keep the latent from becoming arbitrarily high-variance. KL-reg. adds a slight KL penalty that pulls the learned latent toward a standard normal, similar to a VAE, while VQ-reg. places a vector quantization layer inside the decoder. The VQ-reg. variant can be read as a VQGAN in which the quantization layer is absorbed by the decoder.

Since the diffusion model works on the two-dimensional latent, moderate compression still gives good reconstructions; earlier work instead flattened the latent into a 1D order for an autoregressive prior.

Training the diffusion model on latents

Diffusion models are trained as a sequence of denoising autoencoders, each predicting a denoised version of its noisy input. The simplified objective is the expected squared error between the Gaussian noise and the network's noise prediction, with t drawn uniformly from {1,...,T}: \[ \mathbb{E}_{x,\epsilon\sim\mathcal{N}(0,1),t}\left[\lVert \epsilon-\epsilon_\theta(x_t,t)\rVert_2^2\right].

\] In latent space the same objective uses z = E(x) in place of x, with the reweighted bound written as \[ \mathbb{E}_{\mathcal{E}(x),\epsilon\sim\mathcal{N}(0,1),t}\left[\lVert \epsilon-\epsilon_\theta(z_t,t)\rVert_2^2\right]. \]

The backbone epsilon_theta is a time-conditional UNet built mainly from 2D convolutional layers, so the objective focuses on the perceptually relevant parts of the data. Since the forward process is fixed, z_t can be obtained from the encoder during training, and no further encoding is needed in the denoising loss.

Cross-attention conditioning

Diffusion models can in principle model conditional distributions p(z|y), so the denoiser can take an input y that steers synthesis. Concatenation is one route, feeding spatially aligned conditioning into the UNet input, and it is used for semantic synthesis and super-resolution. Cross-attention is the more general route, and Figure 3 contrasts the two.

A domain-specific encoder tau_theta maps the conditioning input y, such as a language prompt, to an intermediate representation tau_theta(y) in R^{M x d_tau}. The UNet's intermediate features act as queries, while the encoded condition supplies keys and values, through learned projections. The layer computes \[ \mathrm{Attention}(Q,K,V)=\mathrm{softmax}\left(\frac{QK^{T}}{\sqrt{d}}\right)\cdot V, \qquad Q=W_Q^{(i)}\,\phi_i(z_t),\quad K=W_K^{(i)}\,\tau_\theta(y),\quad V=W_V^{(i)}\,\tau_\theta(y).

\] Here phi_i(z_t) is a flattened intermediate representation of the UNet, and the W matrices are learnable projections.

The conditional objective is \[ \mathbb{E}_{\mathcal{E}(x),y,\epsilon\sim\mathcal{N}(0,1),t}\left[\lVert \epsilon-\epsilon_\theta(z_t,t,\tau_\theta(y))\rVert_2^2\right], \] and tau_theta and epsilon_theta are optimized jointly under it. The encoder can be domain-specific, for example a transformer when y is a text prompt. Each conditional model is trained for one conditioning type, since the authors train class-conditional, text-to-image and layout-to-image models.

Choosing the downsampling factor

The authors compare LDM-f for f in {1, 2, 4, 8, 16, 32}, where LDM-1 is the pixel-based diffusion model. All models use a single NVIDIA A100, the same number of steps and the same number of parameters, so the factor is the only change.

Small factors such as LDM-1 and LDM-2 train slowly, while very large factors stagnate early, with LDM-32 limiting overall sample quality.

The authors attribute the slow progress of small factors to leaving most of the perceptual compression to the diffusion model, and the plateau of large factors to information loss in the first stage. LDM-4 to LDM-16 balance efficiency against faithful results, and the FID gap between pixel-based LDM-1 and LDM-8 is 38 after 2M training steps.

Figure 7 plots FID against the number of DDIM steps, from 10 to 200, on CelebA-HQ and ImageNet. Models with LDM-4 and LDM-8 give the lowest FID at each sampling budget, and FID is computed on 5000 samples after 500k steps on CelebA-HQ or 2M steps on ImageNet. The authors conclude that ImageNet needs reduced compression to avoid losing quality, and that LDM-4 and -8 offer the best conditions for high-quality synthesis.

Unconditional generation results

Figure 4 shows samples from the LDMs on CelebA-HQ, FFHQ, LSUN-Churches, LSUN-Bedrooms and ImageNet.

On CelebA-HQ, LDM-4 with 500-s sampling reached FID 5.11, against 7.22 for LSGM and 7.16 for UDM in the same table. The authors describe this as a new state of the art on CelebA-HQ, and they note that LSGM trains its latent model jointly with the first stage, whereas the LDM is trained in a fixed space.

On LSUN-Bedrooms, LDM-4 with 200 steps reached FID 2.95, against 1.90 for ADM. This is the one dataset where the authors do not outperform prior diffusion approaches; they note that their score is close to ADM despite using half its parameters and requiring 4-times less training resources.

Class-conditional ImageNet synthesis

Table 3 compares LDM-4 and LDM-4-G with ADM and ADM-G, and with BigGAN-deep, on ImageNet.

The authors report these numbers as outperforming the ADM diffusion model while reducing computational requirements and parameter count.

Text-to-image and layout conditioning

LDM-KL-8 has 1.45B parameters, uses a transformer text encoder with a BERT tokenizer, and is trained on LAION-400M. Figure 5 shows samples from it for user-defined prompts, generated with 200 DDIM steps and eta = 1.0, with unconditional guidance at s = 10.0.

The authors describe the guided model as on par with recent autoregressive and diffusion models for text-to-image synthesis while using far fewer parameters. The same cross-attention route is also used for layout-to-image synthesis, trained on OpenImages and fine-tuned on COCO.

Super-resolution with concatenated conditioning

The setup follows SR3 with bicubic ×4 downsampling on ImageNet, and LDM-SR uses the f = 4 VQ-reg. autoencoder pretrained on OpenImages. The low-resolution input is concatenated with the UNet input, so the conditioning encoder tau_theta is the identity.

Table 5 reports LDM-4 with 100 steps at FID 2.8, IS 166.3, PSNR 24.4 and SSIM 0.69, against SR3 at FID 5.2, IS 180.1, PSNR 26.4 and SSIM 0.762. The FID for LDM-4 uses features from the validation split, and the authors note that LDM-SR outperforms SR3 in FID while SR3 has the better IS.

Plain image regression reaches the highest PSNR and SSIM, and the authors argue that these metrics favor blurriness and do not align well with human perception. In a user study, subjects preferred LDM-4 over the pixel baseline in 70.6% of comparisons against 29.4% for the pixel baseline, and the authors use this as their main perceptual check.

Inpainting efficiency and comparison with LaMa

The efficiency study compares LDM-1 with LDM-4 under KL and VQ regularization, with and without attention, at a fixed parameter count. Table 6 shows training throughput, sampling throughput, hours per epoch and FID after six epochs. LDM-4 (KL, w/ attn) took 7.66 hours per epoch against 20.66 for LDM-1, and its FID after six epochs was 15.21 against 24.74 for LDM-1.

On all samples, LDM-4 (big, w/ ft) reached FID 1.50 and LPIPS 0.137, against 2.21 and 0.14 for LaMa. On the 40-50% masked subset, the same model reached FID 9.39 against 12.0 for LaMa, and Table 7 lists the comparison on 30k crops of size 512×512 from Places test images.

The authors note that LPIPS between unmasked images and their samples is slightly higher than for LaMa, which they attribute to LaMa producing a single result that tends toward an average image.

Limitations

The authors assume their super-resolution models are already somewhat limited in this respect.

Paper info

Authors
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer
Venue
arXiv · Preprint
First published
2021-12-20
Added
2026-10-20
Updated
2022-4-13
Version
v2
arXiv
2112.10752
Category
cs.CV
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, Björn Ommer (2021). High-Resolution Image Synthesis with Latent Diffusion Models. arXiv:2112.10752v2. https://arxiv.org/abs/2112.10752v2

BibTeX
@misc{rombach2021high,
  title = {{High-Resolution Image Synthesis with Latent Diffusion Models}},
  author = {Robin Rombach and Andreas Blattmann and Dominik Lorenz and Patrick Esser and Björn Ommer},
  year = {2021},
  eprint = {2112.10752},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.10752v2}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up