Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Jump straight to the end
A diffusion model cleans up noise in many small steps, like walking down a winding path. A consistency model learns where the path ends from any point on it, so it can jump there in one move. It is trained so that two neighbouring points on the same path give the same answer. The demo shows one-jump samples getting sharper as the model is trained with finer steps.
Latent consistency models generate images in 2–4 steps, which makes diffusion fast enough for interactive design tools, real-time video filters and on-board use.
- 1. A consistency model maps any noisy point to…
- 2. Sampling can take…
- 3. Training asks neighbouring points on a path to…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Probability-flow ODE: dx/dσ = (x − D(x, σ)) / σ in EDM form; each noise sample at σ_max = 80 follows a deterministic path to σ_min = ε = 0.002.
- Consistency function: f(x_σ, σ) = x_ε for every point on one trajectory (self-consistency), with boundary condition f(x, ε) = x.
- Parametrisation: f = c_skip(σ) x + c_out(σ) F_θ(x, σ), with c_skip = σ_d² / ((σ − ε)² + σ_d²) and c_out = σ_d (σ − ε) / √(σ_d² + σ²), so the boundary condition holds for any network.
- CD: discretise σ into N levels; take x at σ_(n+1), one ODE solver step with the teacher to σ_n, and minimise d(f_θ(x_(n+1)), f_θ⁻(x̂_n)) with a stop-gradient (EMA) target.
- CT: replace the teacher step by the same noise at both levels: x_(n+1) = x + σ_(n+1) z, x_n = x + σ_n z. This is an unbiased one-sample estimate of the score, so no teacher is needed, but it is consistent only as N → ∞.
- Improved CT (2023): no EMA target, pseudo-Huber loss instead of LPIPS, log-normal noise sampling, an exponential curriculum for N (10 → 1280), reaching FID 2.5 in one step on CIFAR-10.
- Scaling: LCM (2023) and LCM-LoRA distil latent diffusion models for 2–4 step sampling; consistency trajectory models (CTM) learn jumps between any two levels; sCM (2024) trains in continuous time at 1.5B parameters.
- Multistep sampling: x ← f(σ_max z, σ_max); then for τ in a short list, x ← f(x + √(τ² − ε²) n, τ).
- 1. The boundary condition is…
- 2. Consistency training needs…
- 3. LCM applies consistency distillation to…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Training and sampling consistency models
Exercise 1.
- Karras noise levels.
- The c_skip / c_out parametrisation.
- The consistency function from a network.
- Multistep consistency sampling.
Practice.
- For an existing latent diffusion model, use LCM-LoRA or a ready LCM checkpoint with LCMScheduler in diffusers: 4 steps, low guidance.
- For CD, use a good ODE solver (Heun or DDIM with skipping) for the teacher step and guidance-augmented targets.
- For CT, follow iCT: pseudo-Huber loss with c = 0.00054 √d, log-normal σ, curriculum on N, no EMA teacher.
- Use 1–4 steps; pick the intermediate τ values on a validation metric.
- Compare against distillation baselines (H7-15) at equal steps.
import torch
from diffusers import DiffusionPipeline, LCMScheduler
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16).to("cuda")
pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
pipe.load_lora_weights("latent-consistency/lcm-lora-sdxl")
img = pipe("satellite image of a river delta, true colour", num_inference_steps=4, guidance_scale=1.0).images[0]- 1. LCM-LoRA typically samples with…
- 2. iCT replaces LPIPS with…
- 3. Intermediate τ values are chosen…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
What CD converges to. At the optimum f_n(x) = f_(n−1)(Φ(x, σ_n → σ_(n−1))), where Φ is one teacher solver step. Unrolled, f_N is the teacher ODE solved with N solver steps, so the CD fixed point inherits the solver’s discretisation error: O(1/N) with Euler.
What CT converges to. The squared-loss optimum is a conditional expectation: f_n(y) = E[f_(n−1)(x + σ_(n−1) z) | x + σ_n z = y]. Averaging over the posterior of x blurs the map at every level, so the bias shrinks only as σ_(n−1)/σ_n → 1. Song et al. prove that CT and CD agree up to O(Δσ) errors.
One level. With N = 1 both reduce to f(y, σ_max) = E[x | y], the posterior mean at σ = 80, which is almost the data mean for every input: total collapse.
Why multistep helps. Re-noising to a moderate τ and mapping again uses the more accurate low-noise part of f, trading a little stochasticity for less bias.
This page’s model. f_n is stored as a table on a grid for each level, an idealised infinitely flexible network, and its CD and CT fixed points are computed exactly (CT with Gauss–Hermite quadrature over the Gaussian posterior). Real networks add fitting error on top.
- 1. The CD fixed point equals…
- 2. The CT fixed point is a…
- 3. With one level, one-step samples are…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.How fast do consistency distillation and consistency training approach the true ODE map as levels are added?
History.
- Y. Song, P. Dhariwal, M. Chen and I. Sutskever, “Consistency models” (2023).
- Y. Song and P. Dhariwal, “Improved techniques for training consistency models” (2023).
- S. Luo et al., “Latent consistency models” (2023) and “LCM-LoRA” (2023).
- D. Kim et al., “Consistency trajectory models” (2024).
- C. Lu and Y. Song, “Simplifying, stabilizing and scaling continuous-time consistency models” (sCM, 2024).
Exercise 2. 1-D data: three equal Gaussians at −2, 0 and 2 with std 0.2.
- Models: the exact fixed points of CD (Euler teacher step with the exact denoiser) and CT (exact posterior expectation) on N EDM levels from 0.002 to 80, stored as tables on 2001-point grids.
- Sampling: one step f(80 z, 80) for 2000 stratified noise values; two steps re-noise to the level nearest 0.8 and map again.
- Measures: exact W1 distance to the data distribution; RMS distance of one-step samples to the exact ODE map of the same noise (Heun, 200 steps; its own W1 is 0.0007).
| levels N | CD one step | CD two steps | CT one step | CT two steps | CD RMS to ODE | CT RMS to ODE |
|---|---|---|---|---|---|---|
| 1 | 1.358 | 1.358 | 1.358 | 1.358 | 1.612 | 1.612 |
| 5 | 0.472 | 0.363 | 0.634 | 0.47 | 0.618 | 0.768 |
| 20 | 0.121 | 0.101 | 0.336 | 0.255 | 0.271 | 0.399 |
| 80 | 0.03 | 0.047 | 0.192 | 0.098 | 0.103 | 0.267 |
| 160 | 0.017 | 0.022 | 0.136 | 0.065 | 0.065 | 0.216 |
- N = 1 collapses: both reduce to the posterior mean; there is no intermediate level for a second step.
- Distillation converges fast: W1 falls roughly as 1/N, as expected from Euler error.
- Training lags: at 160 levels CT’s one-step W1 (0.136) is 8× CD’s; its bias shrinks slowly, which is why iCT grows N to 1280.
- Two steps halved CT’s error at 80 and 160 levels but did not help CD at N ≥ 80, whose one-step error was already small (the re-noising adds sampling noise).
- Seeds: one-step results are identical across seeds (stratified noise, deterministic tables). Two-step W1 on seeds 1 and 2: CT at N = 160 0.059 and 0.069; CD at N = 80 0.041 and 0.023.
- Caveat: tables are ideal networks in 1-D; real consistency models also suffer fitting error and training instability.
Consistency models in AI, robotics and aerospace
- Fast image tools: LCM-LoRA and SDXL-based consistency checkpoints give real-time sketch-to-image and video filters.
- Robot policies: Consistency Policy (Prasad et al., 2024) distils diffusion policies into one- to three-step controllers for real-time manipulation.
- Science: consistency models accelerate diffusion-based weather and super-resolution samplers where many ensemble members are needed.
References
- Y. Song, P. Dhariwal, M. Chen and I. Sutskever (2023). “Consistency models.” ICML.
- Y. Song and P. Dhariwal (2024). “Improved techniques for training consistency models.” ICLR.
- S. Luo, Y. Tan, L. Huang, J. Li and H. Zhao (2023). “Latent consistency models: synthesizing high-resolution images with few-step inference.” arXiv.
- D. Kim et al. (2024). “Consistency trajectory models.” ICLR.
- C. Lu and Y. Song (2025). “Simplifying, stabilizing and scaling continuous-time consistency models.” ICLR.
- A. Prasad et al. (2024). “Consistency Policy: accelerated visuomotor policies via consistency distillation.” RSS.