Sampling / Sampler

What is Sampling / Sampler?

A Sampler is the algorithm that controls how an AI diffusion model steps from random noise to a finished image. Different samplers reach different quality levels at different speeds, and each has its own visual characteristics.

At a glance

Also known as
Sampling algorithmDiffusion samplerScheduler (related term, sometimes used interchangeably)
Used for
Controlling the denoising trajectory from noise to image in diffusion generationBalancing generation quality against generation speedInfluencing the visual character and texture of generated outputs
Common tools
Automatic1111 (extensive sampler options)ComfyUIInvokeAIAll diffusion-based generation platforms
Related terms
Diffusion modelNoise / noise levelCFG scaleStepsSeedLatent space
How it works in simple terms
The sampler defines the mathematical route the model takes when progressively cleaning up noise to produce the final image. Some routes are faster but rougher; others are slower but produce finer detail. The choice of route affects both how quickly you arrive at the image and what the image looks like when you get there.
Where you encounter this
Sampler selection appears as a dropdown option in most Stable Diffusion interfaces (Automatic1111, ComfyUI, InvokeAI) and some other advanced generation platforms. Consumer-facing platforms often select the sampler automatically, removing it from user control.

Ready to create?

Direct scenes, design characters, and ship full films

All-in-one AI creative platform with simple, transparent pricing, no speed throttles, and an infinite Canvas for max creativity.

How it compares

How it compares

Compared with related concepts

Samplers are related to but distinct from noise schedules. The noise schedule defines how noise is distributed across the denoising timesteps: the mathematical shape of the transition from maximum to minimum noise. The sampler defines the algorithm that implements that transition step by step. Different sampler-scheduler combinations produce different output characteristics, and many advanced generation interfaces allow independent selection of both. The sampler and noise schedule together determine the quality of the denoising trajectory; the model's learned weights determine what is reconstructed along that trajectory.


Think of it like…

A sampler is like the route-planning algorithm used by a navigation app: given the same starting point (noise) and the same destination (the image the prompt describes), different algorithms choose different routes, making different trade-offs between speed and scenic quality, and arriving at somewhat different versions of the destination as a result.


Pro tip

When experimenting with samplers, test them with identical prompts, seeds, and step counts to isolate their effect on the output. Generate the same prompt with five different samplers and the same settings to build a visual understanding of how each affects the specific model you are using. Document the results: which sampler produces the smoothest skin tones, the sharpest edge detail, the most prompt-consistent colour: and use that knowledge to make informed sampler choices for specific generation goals rather than defaulting to a single sampler for everything.

Types and variations

  • DDIM (Denoising Diffusion Implicit Models) was among the first fast samplers, enabling quality generation in fewer steps than the original DDPM approach.
  • Euler and Euler Ancestral are widely used, offering a good balance of quality and speed.
  • DPM-Solver and DPM++ variants are high-efficiency ODE-based samplers that produce high-quality outputs with relatively few steps.
  • Ancestral samplers (marked 'a') introduce randomness at each step, producing outputs that vary between runs.
  • Non-ancestral (deterministic) samplers produce identical outputs for identical seeds.
  • DDPM is the original stochastic sampler, producing high quality but requiring many steps.
  • Karras variants of several samplers implement a specific noise schedule that often improves output quality.

Ready to make your first scene in Morphic?

Try Morphic

Common use cases

  • Sampler selection is relevant in any diffusion model generation workflow where output quality, speed, and character are all important considerations.
  • For rapid prototyping and exploration, faster samplers with lower step counts enable quicker iteration.
  • For final production generation where maximum quality is required, higher-quality samplers with adequate step counts produce optimal results.
  • For creative exploration of how different samplers affect the same prompt, systematic sampler comparison is a useful technique for understanding the output characteristics of a specific model.

Ready to create?

Direct scenes, design characters, and ship full films

All-in-one AI creative platform with simple, transparent pricing, no speed throttles, and an infinite Canvas for max creativity.

FAQs

What is a sampler in AI image generation?

A sampler is the algorithm that governs how a diffusion model iteratively removes noise to produce a finished image from a starting noise field. It defines the mathematical route from maximum noise to resolved image, making trade-offs between generation quality, speed, and the visual character of the output. Different samplers produce noticeably different results from identical prompts and settings.

How does a sampler affect generation quality?

Different samplers produce different quality characteristics: some produce smoother, softer outputs; others produce sharper, more detailed results. Some converge to high quality with fewer steps; others require more steps for optimal results. The sampler also affects how closely the output adheres to the prompt versus diverging into creative interpretation. Quality and speed trade-offs vary significantly between samplers.

What is the difference between ancestral and non-ancestral samplers?

Ancestral samplers introduce a degree of randomness at each denoising step, meaning that even with identical seeds, different runs can produce somewhat different outputs. Non-ancestral (deterministic) samplers produce identical results for identical seeds, step counts, and settings. Ancestral samplers (often marked 'a', e.g. Euler a) can produce more varied and sometimes more creative outputs; non-ancestral samplers offer greater reproducibility.

How many steps do I need with different samplers?

Step requirements vary significantly by sampler. Some older or stochastic samplers require 50–100 steps for good quality. More efficient modern samplers like DPM++ 2M Karras or DDIM can produce excellent results in 20–30 steps. Very fast samplers like LCM can produce acceptable outputs in as few as 4–8 steps. The optimal step count for a given sampler on a given model is best established through empirical testing rather than relying on general guidelines.

What is the relationship between the sampler and the noise schedule?

The noise schedule defines the mathematical distribution of noise across the denoising timesteps: how much noise is present at each step and how rapidly it is reduced. The sampler is the algorithm that implements the denoising process according to that schedule. Different sampler-scheduler combinations produce different quality and speed characteristics. Many advanced interfaces allow independent selection of both; many platforms bundle them together as named presets.

Which sampler should I use?

For most practical purposes, start with the sampler recommended in the specific model's documentation or release notes, as model developers typically test and optimise for specific sampler-model combinations. DPM++ 2M Karras is widely regarded as a strong general-purpose choice for many Stable Diffusion models, offering high quality with moderate step counts. Euler and Euler Ancestral are reliable standards. Beyond defaults, experiment systematically to understand how different samplers affect your specific model and use case.

Do consumer-facing AI generation platforms let me choose the sampler?

Many consumer-facing platforms select the sampler automatically, removing it from direct user control and simplifying the interface for general use. Advanced or developer-oriented platforms (Automatic1111, ComfyUI) expose full sampler control. Some platforms offer a limited selection of presets that correspond to specific sampler-scheduler combinations. If sampler selection is not exposed by your platform, it is being managed for you: the platform has chosen a default that typically reflects good performance on their deployed model.

What is DDIM and why was it significant?

DDIM (Denoising Diffusion Implicit Models) was a landmark development in diffusion model sampling because it demonstrated that high-quality generation was possible with far fewer steps than the original DDPM formulation required. Where DDPM needed hundreds of steps, DDIM could produce comparable results in 20–50, dramatically reducing generation time. DDIM also introduced deterministic sampling, allowing reproducible outputs for the same seed: a property that became standard in subsequent sampler development.

Can't find what you are looking for?
Contact us and let us know.
bg