↑↓ move Enter open ⌘K find from any page 256 of 256 tabs
Loading the recording…

What a consistency model is

A diffusion model samples by solving an ODE, the probability-flow ODE, from pure noise at down to a clean image, in tens of network calls. Every point on one solution trajectory ends at the same image. A consistency model learns that end point directly: a function that returns the trajectory's start from any point on it, so one call on pure noise gives a sample.

The page records OpenAI's class-conditional ImageNet 64 × 64 model, distilled from an EDM diffusion model with an L2 distance: 296 M parameters, 1,000 classes, noise levels from to , sampled in one call or two.

The consistency function

Song et al. require : at the smallest noise level the image is its own answer. Rather than hoping the network learns this, they build it into the parametrisation, with the network wrapped in noise-dependent scalings as in EDM:

with , the standard deviation of the images. At , and , so the boundary condition holds for any weights; at the output is almost all network. The Skip and out scalings panel draws both curves and marks the levels the page uses; the panel under it splits one into its two terms, followed by a clip to the image range. keeps the U-Net's input at unit variance, and the U-Net reads the noise level as .

Consistency distillation

Training needs pairs of points on the same trajectory. Consistency distillation gets them from a pretrained diffusion model, the teacher . The noise range is cut into levels (Karras spacing, ; for this model). A training image is noised to , the teacher takes one ODE solver step back to , and the model is trained to give the same answer at both points:

is an exponential moving average of , a slowly moving target that keeps training stable; is a distance, here the squared L2 norm (the paper also uses LPIPS). Because is pinned to the identity at , matching neighbours level by level propagates the right answer up to . The same paper also trains consistency models without a teacher (consistency training), replacing the solver step with an unbiased estimate from the clean image.

One call or two

One call maps to an image. Quality improves with a second call: add noise back to a middle level and apply again.

The page uses the two-call schedule the authors' code uses for this model, timesteps [22, 0], so . The One call or two panel shows both images and where they differ: the second call keeps the layout and redraws the detail that noise at covers. The Sampling strip below steps through both calls with their , and .

Consistent only along trajectories

Self-consistency is a property of the probability-flow ODE's trajectories, not of every noisy version of an image. The Consistency along a noising path panel shows this. It takes the two-call image, adds one fixed noise at increasing scale, for = 0.002, 0.256, 1.38, 4.37, 16.78 and 80, and applies at each level. While the noise is small, returns ; once the noise dominates, the straight path has left the trajectory and draws a different image of the class. The RMS distance under each tile measures how far it has moved.

The class-conditional U-Net

is the class-conditional U-Net of Dhariwal and Nichol's ADM, as used by EDM on ImageNet 64: widths 192, 384, 576 and 768 at 64, 32, 16 and 8 pixels, self-attention at 32, 16 and 8 pixels, and ResNet blocks whose second normalisation is scaled and shifted by an embedding. The Class conditioning panel shows how the label enters: its learned 768-wide vector is added to the noise level's embedding. From the same , one call each, the four labels give a macaw, a golden retriever, a volcano and a monarch butterfly.

Where it came from

Consistency models (Song, Dhariwal, Chen and Sutskever, 2023) built on the probability-flow ODE of score-based models and on EDM's parametrisation and noise schedule. Song and Dhariwal's improved techniques later trained consistency models from data alone, with no teacher, no moving-average target and Pseudo-Huber losses in place of LPIPS. Latent consistency models applied consistency distillation to Stable Diffusion's latent space with guidance folded in (see the LCM tab), and adversarial diffusion distillation took a different route to one step (see the Turbo tab).

Papers

  1. Consistency Models Yang Song, Prafulla Dhariwal, Mark Chen, Ilya Sutskever · ICML 2023 Introduces consistency models, their skip/out parametrisation, consistency distillation and training, and multistep sampling; releases the checkpoint this tab records.
  2. Elucidating the Design Space of Diffusion-Based Generative Models Tero Karras, Miika Aittala, Timo Aila, Samuli Laine · NeurIPS 2022 EDM: the teacher, its σ-parametrised preconditioning (c_skip, c_out, c_in) and the Karras noise levels the model is distilled on.
  3. Score-Based Generative Modeling through Stochastic Differential Equations Yang Song et al. · ICLR 2021 The probability-flow ODE whose trajectories a consistency model maps to their end point.
  4. Diffusion Models Beat GANs on Image Synthesis Prafulla Dhariwal, Alex Nichol · NeurIPS 2021 ADM, the class-conditional U-Net with scale-shift normalisation that the model uses as F_θ.
  5. Improved Techniques for Training Consistency Models Yang Song, Prafulla Dhariwal · ICLR 2024 Consistency training from data alone: no EMA target, Pseudo-Huber losses in place of LPIPS, a lognormal noise schedule.
  6. Latent Consistency Models: Synthesizing High-Resolution Images with Few-Step Inference Simian Luo, Yiqin Tan, Longbo Huang, Jian Li, Hang Zhao · arXiv 2023 Consistency distillation in Stable Diffusion's latent space, with classifier-free guidance built in; the LCM tab.

See also