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

SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis

  • Problem Earlier Stable Diffusion models had a comparatively small UNet, discarded or upscaled small training images, and learned cropping artifacts from random crops. Standard zero-shot metrics also fail to track the human preference gains.
  • Method Scales the UNet to 2.6B parameters with a redistributed transformer allocation, adds size and crop conditioning and multi-aspect finetuning, retrains the autoencoder, and adds an SDEdit-based refinement model.
  • Results SDXL with refinement reached a 48.44% win rate in the user study, against 7.91% for Stable Diffusion 1.5 and 6.71% for Stable Diffusion 2.1.

Figure 9: Results from 17,153 user preference comparisons between SDXL v0.9 and Midjourney v5.1, which
was the latest version available at the time. The compar…

Figure 9 : Results from 17,153 user preference comparisons between SDXL v0.9 and Midjourney v5.1, which was the latest version available at the time. The comparisons span all “categories” and “challenges” in the PartiPrompts (P2) benchmark. Notably, SDXL was favored 54.9% of the time over Midjourney V5.1. Preliminary testing indicates that the recently-released Midjourney V5.2 has lower prompt comprehension than its predecessor, but the laborious process of generating multiple prompts hampers the speed of conducting broader tests.

Original paper · CC BY 4.0 · Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, Robin Rombach · SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis · Original paper figure · Extracted the figure area from page 13 of the original PDF.

What SDXL changes and why

SDXL is a latent text-to-image diffusion model built on the Stable Diffusion line, and users prefer its samples over those of Stable Diffusion 1.5 and 2.1. Three weak points of the earlier recipe are targeted: the backbone capacity, the handling of training images that are too small, and the cropping that random crops leak into generated samples.

The design changes are a larger UNet, two conditioning schemes that need no extra supervision, and a separate refinement model that re-noises and denoises the latents. The study asks whether conditioning on original size and crop offsets, together with multi-aspect finetuning, improves latent text-to-image samples, and whether a refinement pass improves local detail.

Evaluation is the second concern: standard zero-shot metrics do not reflect the preference gains, so human preference results are read alongside FID and CLIP-score.

Denoising objective and guidance

The denoiser \(D_\theta(x;\sigma)\) is trained to recover a clean sample from a noisy input, and the score model is read off as \(s_\theta(x;\sigma)=(D_\theta(x;\sigma)-x)/\sigma^2\). Training uses a weighted squared error \[\mathbb{E}\left[\lambda_\sigma \lVert D_\theta(x_0+n;\sigma,c)-x_0\rVert_2^2\right]\] where the noise level is drawn from a discrete distribution over 1000 levels and the weight is \(\lambda_\sigma=\sigma^{-2}\), with \(c\) as the conditioning signal.

Classifier-free guidance mixes conditional and unconditional denoiser outputs as \(D_w(x;\sigma,c)=(1+w)D(x;\sigma,c)-wD(x;\sigma)\), with guidance strength \(w\ge 0\). The unconditional branch is learned in the same network by replacing the condition with a null embedding for a fraction of training examples, given in the text as 10% of the time.

Scaling the UNet and text conditioning

The extra capacity sits at the lower-resolution feature levels: the highest level has no transformer block, the two lower levels use 2 and 10 blocks, and the lowest level at 8× downsampling is removed. This follows the trend of moving transformer computation toward lower-level features, as in the work of Hoogeboom et al. Text is encoded by OpenCLIP ViT-bigG and CLIP ViT-L; the penultimate outputs of both are concatenated along the channel axis for cross-attention, and the pooled OpenCLIP embedding is added as a further condition.

Together the two text encoders total 817M parameters.

Conditioning on the original image size

Latent diffusion training needs a minimum image size, so the usual choices are to drop small training images or to upscale them, and each choice has a cost. Dropping images below 512 pixels, as Stable Diffusion 1.4/1.5 did, discards data and likely hurts generalization, while upscaling introduces artifacts that can appear as blur in samples.

On the SDXL pretraining data, discarding everything below 256 pixels would remove 39% of the samples.

Instead, SDXL conditions on the original height and width before any rescaling, written as \(c_{\text{size}}=(h_{\text{original}},w_{\text{original}})\). Each value gets a Fourier feature encoding, the two encodings are concatenated, and the result is added to the timestep embedding. Training uses the true sizes, but at inference the user sets the size, so a chosen apparent resolution steers the output.

Samples conditioned on sizes from 64 by 64 up to 512 by 512 show image quality rising with the conditioned size, although that figure was made with the 512 × 512 base model rather than the final SDXL.

ImageNet test of size conditioning

Three class-conditional LDMs were trained on ImageNet at 512 by 512: one only on images whose edges are all at least 512 pixels, which leaves about 70k images; one on all images without size conditioning; and one on all images with size conditioning. Each model generated 5k samples with 50 DDIM steps and classifier-free guidance scale 5, and FID-5k and IS-5k were computed, with FID measured against the full validation set.

Relative to training without it, size conditioning lowered FID-5k from 39.76 to 36.53 (lower is better) and raised IS-5k from 211.50 to 215.34 (higher is better). The model trained only on images of at least 512 pixels scored worst, with FID-5k of 43.84 and IS-5k of 110.64, which the authors attribute to overfitting on its small dataset.

The authors explain the lower FID of the unconditioned model compared with the small-data model by blurry samples in its distribution. This experiment is on class-conditional ImageNet at 512 by 512, not on text-to-image generation, and the authors keep FID and IS here because their feature networks were trained on ImageNet.

Crop offsets as conditioning

Earlier SD models often cut objects off, such as a cat's head at the frame edge, and the authors trace this to random cropping during training. A batch needs equal-sized tensors, so each image is resized until its shorter side matches the target and is then randomly cropped along the longer axis, which lets crops leak into the samples. Earlier SD models and SDXL are compared in the figure below on two prompts, which shows the cut-off behavior the crop conditioning targets.

SDXL instead samples the crop offsets \(c_{\text{top}}\) and \(c_{\text{left}}\), the pixels cropped from the top and from the left, uniformly during data loading, and feeds them through Fourier feature embeddings as with the size condition. In Algorithm 1 the image is resized first; if height is at most width, only \(c_{\text{left}}\) is sampled and \(c_{\text{top}}=0\), and otherwise only \(c_{\text{top}}\) is sampled and \(c_{\text{left}}=0\).

When combined with size conditioning, the two embeddings are concatenated along the channel dimension before being added to the timestep embedding.

At inference the offsets are set to (0, 0), which produces object-centered samples, and other offsets simulate different amounts of cropping. The authors call this conditioning augmentation and contrast it with data bucketing, which tackles the same aspect problem; crop conditioning keeps the augmentation benefit without letting the cropping leak into samples.

The authors note that the technique is not tied to LDMs and could be used for any diffusion model.

Training on several aspect ratios

Real images vary in size and aspect ratio, while text-to-image models usually target square 512 by 512 or 1024 by 1024 outputs; the authors argue that landscape and portrait formats are the more natural targets. SDXL is finetuned on buckets of aspect ratios, each keeping the pixel count close to 1024 × 1024, with height and width varied in multiples of 64.

A batch draws from one bucket, the bucket changes between training steps, and the target size is given to the model as a conditioning tuple embedded in Fourier space in the same way as the other conditions. Multi-aspect training is a finetuning stage after pretraining at a fixed aspect ratio and resolution, and the bucket size is concatenated with the size and crop conditions along the channel axis; Appendix J gives code for this operation.

Crop conditioning only works within bucket boundaries, which are usually 64 pixels, and the authors keep it for ease of implementation.

Retraining the autoencoder

The autoencoder fixes the latent space in which the LDM works, and the authors argue that local high-frequency detail depends on it, so they retrain the same architecture. The retraining used batch size 256 against 9 for the original, and kept an exponential moving average of the weights; the autoencoder was trained from scratch. Stable Diffusion 2.x used an autoencoder whose decoder was finetuned with a reduced perceptual loss weight and more compute, so its recipe differs from the one used here.

SD-VAE 1.x scores 23.4, 0.69, 0.96 and 5.0, and SD-VAE 2.x scores 24.5, 0.71, 0.92 and 4.7 on the same metrics. SDXL-VAE has higher PSNR and SSIM, and lower LPIPS and rFID, than both SD autoencoders; for LPIPS and rFID, lower is better. These reconstruction numbers come from one resolution and one dataset, and they measure the autoencoder alone rather than the full SDXL pipeline.

Staged training schedule

The final model is trained in stages, starting from the autoencoder of Section 2.4 and a discrete-time diffusion schedule with 1000 steps. The base model is pretrained at 256 × 256 pixels for 600 000 optimization steps with batch size 2048, on an internal dataset, using size and crop conditioning. Training then continues for 200 000 optimization steps at 512 × 512 pixels.

Multi-aspect finetuning with offset-noise at level 0.05 then trains the model on aspect ratios near 1024 × 1024 pixel area.

Refinement with SDEdit

Base samples sometimes show low local quality, so a separate LDM in the same latent space is trained on high-quality, high-resolution data. At run time, base latents are noised and then denoised by the refinement model with the same text input, which is the SDEdit procedure. The refinement model is specialized on the first 200 discrete noise scales.

Refinement is optional; the authors report that it mostly improves detailed backgrounds and human faces.

In the two-stage pipeline of Figure 1, SDXL produces initial latents of size 128 × 128, and the refinement model then works on those latents with the same autoencoder.

Win rates against earlier Stable Diffusion

Users chose a favorite among four models: SDXL, SDXL with refiner, Stable Diffusion 1.5 and Stable Diffusion 2.1. Win rates were 48.44% for SDXL with refinement, 36.93% for SDXL base, 7.91% for Stable Diffusion 1.5 and 6.71% for Stable Diffusion 2.1. The refined pipeline is the top-rated choice, and both SDXL variants are picked far more often than the two earlier models.

The paper reports these win rates without a confidence interval.

FID and CLIP-score on COCO

FID and CLIP-score were computed on 10k COCO text-image pairs at several cfg scales, with CLIP-score measured using OpenCLIP ViT g-14. SDXL has the worst FID of the three compared models, while its CLIP-score is only slightly higher than the earlier versions. Human assessors prefer SDXL samples in the user study, so the metric result runs against the human result.

The authors connect this to Kirstain et al., who found that zero-shot COCO FID is negatively correlated with visual aesthetics, and argue that text-to-image foundation models need supplementary quantitative scores.

Comparison with Midjourney v5.1

The study draws prompts from PartiPrompts (P2), with five random prompts per category and four 1024 × 1024 images per prompt from Midjourney v5.1 (seed 2) and from SDXL. The AWS GroundTruth taskforce voted on prompt adherence, and the authors report a slight preference for SDXL.

A larger set of 17,153 comparisons between SDXL v0.9 and Midjourney v5.1, spanning all categories and challenges, favored SDXL in 54.9% of cases. Preliminary testing suggested that Midjourney v5.2 has lower prompt comprehension than v5.1, and broader tests were not run because generating the prompts is laborious.

Without the refinement model, SDXL outperforms Midjourney v5.1 in all but two of the six categories.

With refinement, SDXL outperforms or is statistically equal to Midjourney v5.1 in seven of the ten challenges.

Limitations and open problems

Complex prompts with detailed spatial arrangements are still hard, hands are not always generated correctly, and two concepts sometimes bleed into one another. The authors add that hands vary widely across photographs, which makes it hard for the model to learn their underlying 3D shape. Outputs are not perfectly photorealistic: subtle lighting effects and minute texture variations can be absent or weakly rendered.

Training on large-scale data can introduce social and racial biases, and the model may exacerbate them when generating images.

Concept bleeding occurs when attributes of several objects merge: a penguin requested with a blue hat and red gloves came out with blue gloves and a red hat. The authors attribute part of the cause to pretrained text encoders that compress information into a single token, and to the contrastive loss, which needs negatives with different bindings in the same batch.

The authors cite Feng et al. as one route that encodes word relationships explicitly.

Long legible text is still unreliable, and random characters or inconsistencies can appear. The authors point to character-level tokenizers as one route, citing Liu et al., and cite prior work suggesting that scaling the model helps text synthesis.

The two-stage pipeline requires loading two large models into memory, which limits accessibility and sampling speed; a single-stage model of equal or better quality is left as future work. Compared with the original Stable Diffusion, the improvements come at a higher inference cost in VRAM and sampling speed, and the authors plan distillation to reduce it.

Transformer-based architectures such as UViT and DiT gave no immediate benefit in the exploration stage. The model is trained in the discrete-time formulation and needs offset-noise for aesthetically pleasing results; the EDM framework is suggested as a candidate for future training. The failure cases are shown as random samples, and no failure rates are reported for them.

Paper info

Authors
Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, Robin Rombach
Venue
arXiv · Preprint
First published
2023-7-4
Added
2026-10-20
Updated
2023-7-4
Version
v1
arXiv
2307.01952
Category
cs.CV · cs.AI
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

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.

Abstract

We present SDXL, a latent diffusion model for text-to-image synthesis. Compared to previous versions of Stable Diffusion, SDXL leverages a three times larger UNet backbone: The increase of model parameters is mainly due to more attention blocks and a larger cross-attention context as SDXL uses a second text encoder. We design multiple novel conditioning schemes and train SDXL on multiple aspect ratios. We also introduce a refinement model which is used to improve the visual fidelity of samples generated by SDXL using a post-hoc image-to-image technique. We demonstrate that SDXL shows drastically improved performance compared the previous versions of Stable Diffusion and achieves results competitive with those of black-box state-of-the-art image generators. In the spirit of promoting open research and fostering transparency in large model training and evaluation, we provide access to code and model weights at https://github.com/Stability-AI/generative-models

Quote from the paper

Dustin Podell, Zion English, Kyle Lacey, Andreas Blattmann, Tim Dockhorn, Jonas Müller, Joe Penna, Robin Rombach (2023). SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis. arXiv:2307.01952v1. https://arxiv.org/abs/2307.01952v1

BibTeX
@misc{podell2023sdxl,
  title = {{SDXL: Improving Latent Diffusion Models for High-Resolution Image Synthesis}},
  author = {Dustin Podell and Zion English and Kyle Lacey and Andreas Blattmann and Tim Dockhorn and Jonas Müller and Joe Penna and Robin Rombach},
  year = {2023},
  eprint = {2307.01952},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2307.01952v1}
}

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