Sampling steps

Also known as: inference steps

On this page 7

Sampling steps, also called inference steps, are the number of denoising iterations a diffusion model performs to turn random noise into a finished output such as an image, a video frame or an audio clip. In generative AI, the step count is one of the most important generation settings, because it sets how finely the model approximates the reverse diffusion process and therefore controls both quality and compute time.

Each step requires at least one full pass of the denoising network, so generation time grows roughly linearly with the step count. The useful number of steps is not fixed: it depends on the diffusion sampler, the noise schedule, the guidance method and whether the model has been distilled for fast generation.

What happens during each sampling step

A sampling step moves the current sample from one noise level to a slightly lower one. The denoising network, usually a U-Net or a diffusion transformer, receives the noisy latent, the current timestep and the conditioning such as a text prompt, and predicts either the noise, the clean image or a velocity. The diffusion sampler then uses that prediction to compute the next, less noisy latent.

Mathematically, sampling solves a stochastic or ordinary differential equation that runs from pure noise back to data. The step count decides how many points the solver visits along that trajectory. Few steps mean large jumps with more discretization error; many steps follow the curve closely but cost more network evaluations.

The table lists the components that interact within one step and what each contributes.

ComponentRole in the stepEffect on results
Denoising networkPredicts noise, image or velocitySets the quality ceiling
Noise scheduleDefines the noise level at each stepDecides where detail is resolved
Sampler or solverConverts the prediction into the next latentSets how many steps are needed
Classifier-free guidanceCombines conditional and unconditional predictionsOften doubles the cost per step
Random seedFixes the starting noise and any injected noiseMakes results reproducible
Components involved in a single sampling step

Classifier-free guidance usually requires two predictions per step, one with and one without the prompt, so the true cost is measured in network function evaluations rather than steps alone.

Typical step counts by sampler and model type

The number of sampling steps that produces a converged image depends most strongly on the order and design of the solver. The original DDPM sampler simulated the full training chain and needed about 1,000 steps; deterministic DDIM sampling cut this to roughly 50, and higher-order solvers reach similar quality in 20 to 30 steps.

The following ranges are typical starting points for current image models, not hard limits.

Sampler or model typeTypical stepsNotes
DDPM ancestral sampling250-1,000Mostly of historical interest
DDIM25-50Deterministic, good for inversion
Euler and Euler ancestral20-40Simple and robust defaults
DPM-Solver++ variants15-30High-order, efficient at low counts
Flow matching models20-50Straighter paths, Euler often sufficient
Distilled or consistency models1-8Trained specifically for few steps
Typical sampling step ranges

Ancestral and stochastic samplers inject fresh noise at each step, so their output keeps changing as steps increase and never fully converges. Deterministic samplers settle on one image, which makes them easier to tune when the same seed must yield predictable results.

How the step count affects quality and speed

Image quality improves steeply over the first steps and then reaches diminishing returns. Below the useful range, images look blurry, washed out or noisy, and fine textures such as hair or text are missing. Above it, extra steps mainly add time; with stochastic samplers they may even shift composition without improving it.

The table connects symptoms to step counts for a typical non-distilled image model with a modern solver.

Step rangeTypical appearanceRecommended action
Under 10Blurry shapes, residual noiseIncrease steps or use a distilled model
10-20Correct layout, soft detailsAcceptable for previews
20-35Sharp, converged resultDefault range for final images
Over 50Little visible changeReduce steps to save time
Symptoms associated with different step counts

Speed scales almost linearly: halving the steps roughly halves generation time, apart from fixed costs such as text encoding and VAE decoding. For batch production, this makes the step count one of the most direct levers on compute cost per image.

In image-to-image generation and inpainting, the effective number of steps is reduced by the denoising strength. With 30 steps and a strength of 0.4, the sampler starts partway down the schedule and runs only about 12 steps, because the input image already supplies most of the structure.

Diffusion distillation changes the picture fundamentally. Progressive distillation, adversarial distillation and consistency models train a student to reach the result of many teacher steps in one to eight steps. Running such models with high step counts often degrades the output, because they were never trained for small increments.

Video diffusion models make the trade-off sharper, since every step processes many frames at once. Here, fewer steps with a strong solver usually matter more for practical turnaround than any other setting, while too few steps can harm temporal consistency.

Common mistakes when choosing sampling steps

Most problems come from treating the step count as an independent quality dial. In practice it must be tuned together with the sampler, guidance scale and model type.

  • Assuming more steps is always better: beyond convergence, extra steps waste time and rarely add detail.
  • Copying step counts between samplers: 50 DDIM steps and 50 DPM-Solver steps are not equivalent workloads in quality terms.
  • Using high counts on distilled models: few-step models often produce oversaturated or broken images at 30 steps.
  • Comparing seeds across step counts with ancestral samplers: the same seed gives a different image when the step count changes.
  • Ignoring guidance cost: a high guidance scale cannot compensate for too few steps and may add artifacts.

The short version

An image generator does not draw a picture in one go. It starts with pure static, like an untuned television, and cleans it up a little at a time until a clear image appears. Each cleanup round is one sampling step.

More rounds give a cleaner picture, but only up to a point. After that, the picture barely changes and the generator just takes longer. Good settings find the smallest number of rounds that still looks finished.

Where it makes a difference

A marketing studio produces several thousand product images a week with a latent diffusion model on rented GPUs. Its original setting used 60 steps with an ancestral sampler, and each image took about nine seconds. Tests showed that the compositions kept shifting between step counts, which made approvals slow because the art director could not predict the final result.

The team switched to a deterministic multistep solver at 25 sampling steps and kept the same guidance scale. Side-by-side reviews found no meaningful loss of detail, generation time fell to under four seconds per image, and the same seed now produced stable compositions. For quick concept drafts, the studio uses a distilled model at four steps, then regenerates approved concepts at full quality. The outcome was less than half the GPU cost with more predictable review cycles.