License YOLO
Back to Ultralytics Glossary

Consistency Models

Consistency models map any noisy point on a diffusion trajectory straight to clean data, so they generate images in one or two steps. How they train.

A consistency model is a generative AI model that maps any point on a diffusion model's denoising trajectory directly to that trajectory's clean starting point, so it can turn pure noise into a sample with a single network evaluation. Diffusion models reach the same result by removing noise over tens to hundreds of small steps, which makes them slow for real-time inference. Yang Song, Prafulla Dhariwal, Mark Chen, and Ilya Sutskever at OpenAI introduced consistency models in March 2023 in the paper Consistency Models, reporting one-step Fréchet Inception Distance (FID) scores of 3.55 on CIFAR-10 and 6.20 on ImageNet 64 x 64, the best one-step results at the time.

The Consistency Property#

Diffusion sampling can be written as a probability flow ordinary differential equation (ODE), which links each noise sample to exactly one data sample along a deterministic path. Every point on that path, from slightly noisy to pure noise, shares the same origin. A consistency function f(x, t) takes a point x at noise level t and returns the origin, and self-consistency means it returns the same output for all points of one trajectory. At the smallest noise level the function must return its input unchanged, a boundary condition built into the network with a skip connection whose weight on the input is 1 at that level and whose weight on the neural network's output is 0.

For one-dimensional Gaussian data the consistency function has a closed form, which shows both properties in a few lines of PyTorch:

import torch

torch.manual_seed(0)
mu, s, T = 2.0, 0.5, 80.0  # data distribution N(2, 0.5^2); noise levels run from 0 to T = 80


def consistency_fn(x, t):
    """Exact consistency function for Gaussian data: map x at noise level t to its trajectory's clean origin."""
    return mu + (x - mu) * s / (s**2 + t**2) ** 0.5


# Points on one probability-flow ODE trajectory, from the clean sample 2.6 out to pure noise
t = torch.tensor([0.0, 1.0, 10.0, 80.0])
x_t = mu + (2.6 - mu) * (s**2 + t**2) ** 0.5 / s
print("x_t:      ", x_t.numpy().round(2))
print("f(x_t, t):", consistency_fn(x_t, t).numpy().round(2))

# One-step generation: draw noise at t = T and map it to data with a single call
samples = consistency_fn(T * torch.randn(100_000), T)
print(f"One-step samples: mean {samples.mean():.2f}, std {samples.std():.2f}")

The four points on the trajectory, at 2.6, 3.34, 14.01, and 98.0, all map back to 2.6, and a single call turns 100,000 draws of pure noise into samples with a mean of 1.99 and a standard deviation of 0.50, matching the data distribution. Images have no such formula, so a network learns f from data.

Training by Distillation or From Scratch#

  • Consistency distillation: A pretrained diffusion model and an ODE solver move a noisy sample one step to a lower noise level, and the loss function pulls the model's outputs at the two points together.
  • Consistency training: Needs no teacher. It creates the two adjacent points by adding the same noise draw to one clean image at two noise levels, which estimates the trajectory without solving the ODE.

In the original paper, the output at the less noisy point came from an exponential moving average (EMA) of the model's own weights, a slowly updated copy that keeps the target from shifting at every step. Ultralytics YOLO26 keeps the same kind of average during training: it updates an EMA copy of the model after every optimizer step, with a decay that ramps up to 0.9999, and validation and the saved last.pt and best.pt checkpoints use that copy. Song and Dhariwal's improved consistency training (iCT) of October 2023 set the EMA decay of that target copy to zero, replaced the LPIPS perceptual loss with a Pseudo-Huber loss, and reached one-step FIDs of 2.51 on CIFAR-10 and 3.25 on ImageNet 64 x 64 without a pretrained diffusion model. Cheng Lu and Yang Song's continuous-time sCM scaled the approach to 1.5 billion parameters in October 2024, with a two-step FID of 1.88 on ImageNet 512 x 512.

Multistep Sampling and Zero-Shot Editing#

One step gives the fastest sample, and a few more steps raise quality. Multistep sampling alternates a jump to clean data with re-noising to a smaller noise level, so each pass refines the previous estimate:

The same loop edits images with no task-specific training. Replacing the known pixels after each jump turns it into image inpainting, and constraining a downsampled or grayscale version turns it into super-resolution or colorization, all three of which the original paper demonstrated.

  • Latent consistency models (LCMs): Distill Stable Diffusion into a model that runs in its latent space, bringing one- to four-step text-to-image generation to open models in October 2023.
  • Diffusion policies: Robot controllers that denoise action sequences. Aaditya Prasad and colleagues at Stanford and Princeton distilled them into a Consistency Policy in 2024, which sped up inference by an order of magnitude over the fastest alternative and ran on a laptop GPU.
  • Rectified flow: Straightens the noise-to-data paths themselves, so an ordinary ODE solver needs few steps.
  • Progressive distillation: Tim Salimans and Jonathan Ho's 2022 method halves a diffusion model's step count in each round of distillation, reaching 4 steps after many rounds, where consistency distillation trains for a one-step jump directly.

Explore solutions

Computer vision in sports

Computer vision in sports

Discover how Ultralytics YOLO powers sports vision with player and ball tracking, performance analytics, coaching insights, and athlete rehabilitation.
Learn more
Computer vision for aerial imagery

Computer vision for aerial imagery

Turn drone and aerial imagery into real-time insights for agriculture, aquaculture, conservation, and geospatial analysis with Ultralytics YOLO.
Learn more
Computer vision in aerospace

Computer vision in aerospace

Apply computer vision in aerospace with Ultralytics YOLO for aircraft inspection, runway FOD detection, airport ground operations, and composite defect detection.
Learn more
Computer vision in security

Computer vision in security

Protect every site with Ultralytics YOLO models. Vision AI powers perimeter monitoring, threat detection, license-plate recognition, and workplace safety.
Learn more
Computer vision in robotics

Computer vision in robotics

Power smarter machines with Ultralytics YOLO models. Vision AI in robotics drives autonomous navigation, perception, object tracking, and real-time control.
Learn more
Computer vision in logistics

Computer vision in logistics

Streamline logistics with Ultralytics YOLO models. Vision AI enables package inspection, sorting, vehicle tracking, and real-time warehouse safety monitoring.
Learn more
Computer vision in retail

Computer vision in retail

Reimagine retail with Ultralytics YOLO models. Vision AI powers inventory tracking, shelf monitoring, queue management, and smarter customer insights.
Learn more
Computer vision in healthcare

Computer vision in healthcare

Build healthcare solutions with Ultralytics YOLO models. Vision AI in healthcare powers faster medical imaging, smarter diagnostics, and patient monitoring.
Learn more
Computer vision in manufacturing

Computer vision in manufacturing

Optimize manufacturing with Ultralytics YOLO models. Vision AI drives quality control, defect detection, PPE compliance, and assembly line automation.
Learn more
Computer vision in automotive

Computer vision in automotive

Apply computer vision in automotive with Ultralytics YOLO models. Vision AI elevates road safety, driver assistance, and vehicle automation for smarter roads.
Learn more
Computer vision in agriculture

Computer vision in agriculture

Bring vision AI to smart agriculture with Ultralytics YOLO models. Power crop monitoring, livestock tracking, and precision farming for higher, smarter yields.
Learn more

Let's build the future of AI together!

Begin your journey with the future of machine learning