
stable_diffusion_unet
Diffusion and generative1,209 ops859.5M params
The latent diffusion denoising UNet, conditioned through cross-attention on text or other tokens.
Diffusion and generative · 1,209 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
UNet2DConditionModel is the denoising backbone of a latent diffusion model, a time-conditional UNet, here in the diffusers port. Latent diffusion models apply diffusion in the latent space of a powerful pretrained autoencoder rather than in pixel space, which lets them train on limited computational resources while retaining quality and flexibility. Diffusion models themselves are read as an equally weighted sequence of denoising autoencoders, each trained to predict a denoised variant of a noisy input.
The Condition in the name is cross-attention: the UNet backbone is augmented with cross-attention layers so that conditioning inputs such as text or bounding boxes can steer generation. A domain specific encoder first projects the conditioning to an intermediate representation, which is then mapped into the intermediate layers of the UNet through cross-attention. The paper describes this as a general-purpose conditioning mechanism that enables multi-modal training.
The authors used it to train class-conditional, text-to-image and layout-to-image models, and released pretrained latent diffusion and autoencoding models in the CompVis latent-diffusion repository. That repository later added a 1.45B latent diffusion model trained on the LAION-400M database, with a web demo on Hugging Face Spaces.
Key idea. Connecting transformers to the diffusion UNet through cross-attention, so arbitrary token-based conditioning such as text can drive image synthesis in a compressed latent space.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{rombach2022highresolutionimagesynthesislatent,
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={2022},
eprint={2112.10752},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2112.10752},
}