What is Sampling in AI Image Generation? Complete Guide to Samplers and Schedulers
Learn what sampling and schedulers are in Stable Diffusion and other AI models. Beginner-friendly explanation of Euler, DPM++, Karras, and how to choose the right sampler.
Every time you generate an AI image, a sampler is doing the heavy lifting. It's the algorithm that actually removes noise step-by-step to create your image. Understanding samplers unlocks better results and faster generations. Here's everything you need to know.
Quick Answer: Sampling is the iterative process of removing noise from random static to reveal an image. Samplers are the algorithms that decide how to remove noise at each step. Schedulers control how much noise to remove per step. Together, they determine image quality, generation speed, and artistic characteristics. For most users, DPM++ 2M with Karras scheduler offers the best balance of speed and quality.
- Samplers: Algorithms that remove noise (Euler, DPM++, DDIM, etc.)
- Schedulers: Control noise removal rate (Normal, Karras, Exponential)
- More steps = higher quality but slower generation
- Different samplers suit different content types
- DPM++ 2M Karras is a reliable default choice
What Sampling Actually Does
The Noise Removal Process
AI image generation starts with pure random noise, like TV static. The model's job is to progressively remove that noise while following your prompt, eventually revealing an image.
Each "step" in generation:
- Model looks at current noisy image
- Predicts what noise should be removed
- Sampler removes calculated amount of noise
- Process repeats until complete
The sampler determines HOW noise gets removed. Different samplers take different mathematical approaches, producing different results.
Why Samplers Matter
Two samplers with identical prompts and seeds produce noticeably different images:
- Composition may shift
- Colors appear different
- Details vary in sharpness
- Artistic style changes subtly
Choosing the right sampler can mean the difference between okay results and exceptional ones.
Common Samplers Explained
Euler (The Classic)
The simplest sampler, named after mathematician Leonhard Euler.
Characteristics:
- Clean, straightforward results
- Good baseline quality
- Moderate speed
- Predictable behavior
Best for: Learning, testing, when you want predictable results
Steps recommended: 20-30
Euler Ancestral (Euler a)
Euler with added randomness at each step.
Characteristics:
- More creative, varied results
- Higher variability between generations
- Same seed produces slightly different images
- More artistic, less predictable
Best for: Creative exploration, artistic variation
Steps recommended: 20-40
Note: "Ancestral" samplers add randomness, making them less reproducible.
DPM++ 2M
Currently the most popular sampler. "DPM" stands for Diffusion Probabilistic Models.
Characteristics:
- Excellent quality-to-speed ratio
- Converges quickly (needs fewer steps)
- Clean, detailed outputs
- Reliable across different prompts
Best for: General use, production workflows, most content types
Steps recommended: 15-25 (converges fast)
DPM++ 2M SDE
DPM++ 2M with stochastic differential equations, adding controlled randomness.
Characteristics:
- Slightly more detailed than standard DPM++ 2M
- More variation between generations
- Can produce more interesting textures
- Slightly slower
Best for: When you want more variation or texture detail
Steps recommended: 20-30
DPM++ 2S a
Another DPM++ variant using second-order solving with ancestral sampling.
Characteristics:
- Good detail retention
- Ancestral (adds randomness)
- Can produce unique results
- Less predictable than 2M
Best for: Artistic work, creative exploration
Steps recommended: 20-35
DDIM (Denoising Diffusion Implicit Models)
Deterministic sampler that produces consistent results.
Characteristics:
- Completely deterministic (same seed = exact same image)
- Fast at low step counts
- Can feel "flat" compared to others
- Good for reproducibility
Best for: When exact reproducibility matters
Steps recommended: 20-50
UniPC (Unified Predictor-Corrector)
Newer sampler designed for efficiency.
Characteristics:
- Very fast convergence
- Good quality at low step counts
- Works well with 10-15 steps
- Consistent results
Best for: Speed-focused workflows, quick iterations
Steps recommended: 10-20
Heun
Higher-order solver producing detailed results.
Free ComfyUI Workflows
Find free, open-source ComfyUI workflows for techniques in this article. Open source is strong.
Characteristics:
- Excellent detail
- Slower than Euler/DPM++
- Uses more VRAM
- Sharp, crisp outputs
Best for: When maximum detail matters more than speed
Steps recommended: 20-40 (but takes twice as long)
Understanding Schedulers
Schedulers control the RATE of noise removal across steps. Same sampler with different schedulers produces different results.
Normal Scheduler
Linear noise schedule, removes consistent amount per step.
Characteristics:
- Straightforward approach
- Consistent step-to-step changes
- Baseline behavior
Best for: When you want standard behavior
Karras Scheduler
Named after researcher Tero Karras. Removes more noise early, less late.
Characteristics:
- Front-loads noise removal
- Produces sharper results
- Better detail preservation
- Most popular scheduler choice
Best for: Most use cases, especially with DPM++ samplers
Exponential Scheduler
Exponential curve for noise removal.
Characteristics:
- Aggressive early denoising
- Smooth final steps
- Can produce cleaner backgrounds
Best for: Experimentation, specific aesthetic goals
SGM Uniform
Uniform scheduler from Score-based Generative Models.
Characteristics:
- Even distribution across steps
- Predictable behavior
- Works well with specific samplers
Best for: Technical workflows requiring consistency
Sampler + Scheduler Combinations
The combination matters. Here are proven pairings:
Want to skip the complexity? Apatero gives you professional AI results instantly with no technical setup required.
DPM++ 2M + Karras (Recommended Default)
The gold standard combination for most work.
- Fast convergence
- Excellent quality
- Reliable results
- 15-25 steps optimal
Euler + Normal
Classic, predictable combination.
- Baseline behavior
- Good for learning
- 20-30 steps typical
DPM++ SDE + Karras
For when you want variation and detail.
- More texture
- Slight randomness
- 20-30 steps optimal
UniPC + Normal
Speed-focused combination.
- Fastest good results
- 10-15 steps works
- Good for iteration
Choosing the Right Sampler
By Content Type
Portraits:
- Recommended: DPM++ 2M Karras or Euler
- Avoid: Highly ancestral samplers (unpredictable faces)
Landscapes:
- Recommended: DPM++ 2M SDE Karras (good textures)
- Alternative: Euler a for artistic variation
Anime/Illustration:
- Recommended: DPM++ 2M Karras
- Alternative: Euler a for more stylized results
Photorealistic:
- Recommended: DPM++ 2M Karras
- Alternative: Heun for maximum detail (slower)
Abstract/Artistic:
- Recommended: Euler a or DPM++ 2S a
- More randomness suits creative work
By Priority
Speed Priority:
- UniPC (10-15 steps)
- DPM++ 2M Karras (15-20 steps)
Quality Priority:
- Heun (40+ steps)
- DPM++ 2M Karras (25-30 steps)
Balanced:
- DPM++ 2M Karras (20 steps)
- Default choice for most work
Creative Variation:
- Euler a
- DPM++ 2S a
- Any ancestral sampler
Step Count Guide
More steps = more noise removal iterations = better quality (diminishing returns).
Step Count Recommendations
| Steps | Quality | Speed | Use Case |
|---|---|---|---|
| 5-10 | Poor | Very Fast | Quick previews only |
| 15-20 | Good | Fast | Daily production work |
| 25-30 | Very Good | Moderate | Quality-focused work |
| 40-50 | Excellent | Slow | Final renders |
| 50+ | Diminishing | Very Slow | Rarely needed |
Diminishing Returns
Most samplers converge around 20-30 steps. After that, quality improvements are minimal while time increases linearly.
Exception: Some samplers (DDIM, Euler) benefit from higher steps more than others (DPM++, UniPC).
Join 115 other course members
Create Your First Mega-Realistic AI Influencer in 51 Lessons
Create ultra-realistic AI influencers with lifelike skin details, professional selfies, and complex scenes. Get two complete courses in one bundle. ComfyUI Foundation to master the tech, and Fanvue Creator Academy to learn how to market yourself as an AI creator.
Practical Workflow Tips
Testing Samplers
When trying a new sampler:
- Use same seed across tests
- Start with 20 steps
- Compare results side-by-side
- Adjust steps based on convergence
Production Settings
For reliable production work:
- Sampler: DPM++ 2M
- Scheduler: Karras
- Steps: 20
- CFG Scale: 7 (adjust as needed)
This combination works reliably across most content types.
Speed vs Quality Trade-offs
Need maximum speed?
- UniPC, 10 steps
- Accept slightly lower quality
Need maximum quality?
- DPM++ 2M Karras, 30 steps
- Or Heun, 40 steps (much slower)
Need balance?
- DPM++ 2M Karras, 20 steps
- Best overall workflow
Sampler Settings in ComfyUI
In ComfyUI's KSampler node:
- sampler_name: Choose your sampler (euler, dpmpp_2m, etc.)
- scheduler: Choose scheduler (karras, normal, etc.)
- steps: Number of denoising iterations
- cfg: Classifier-free guidance (prompt adherence)
- denoise: For img2img workflows
For ComfyUI workflow optimization, see our workflow organization guide.
Common Problems and Solutions
Blurry Results
Cause: Too few steps or wrong sampler
Solution: Increase steps to 25-30, use DPM++ 2M Karras
Overcooked/Burnt Look
Cause: Too many steps or CFG too high
Solution: Reduce steps, lower CFG scale
Inconsistent Results
Cause: Using ancestral sampler
Solution: Switch to deterministic sampler (DPM++ 2M, DDIM) for consistency
Slow Generation
Cause: High steps or slow sampler
Solution: Use UniPC or DPM++ 2M with fewer steps
Weird Artifacts
Cause: Sampler-model mismatch or extreme settings
Solution: Try different sampler, reset to defaults
Advanced Sampler Concepts
Deterministic vs Ancestral
Deterministic samplers:
- Same seed = exact same result
- Examples: DPM++ 2M, DDIM, UniPC
- Best for reproducibility
Ancestral samplers (marked with 'a'):
- Add randomness at each step
- Same seed = similar but not identical
- Examples: Euler a, DPM++ 2S a
- Best for creative variation
Solver Orders
Some samplers mention "order":
- First-order: Simple, fast (Euler)
- Second-order: More accurate, slower (Heun, some DPM++ variants)
- Higher order generally means better quality at cost of speed
SDE vs ODE
ODE (Ordinary Differential Equations):
- Deterministic
- Consistent results
SDE (Stochastic Differential Equations):
- Add controlled noise
- More variation
- Can produce more interesting details
Frequently Asked Questions
Which sampler is "best"?
DPM++ 2M Karras is best for most use cases. No single sampler is best for everything.
Does sampler affect generation speed?
Yes. Heun is 2x slower than Euler. UniPC is fastest. Most DPM++ variants are moderately fast.
Can I change samplers mid-workflow?
Not directly, but you can use different samplers for img2img refinement passes.
Do samplers work with all models?
Yes, samplers are model-agnostic. Results vary by model though.
What's the difference between sampler and scheduler?
Sampler: HOW noise is removed. Scheduler: HOW MUCH noise per step.
Why do ancestral samplers give different results with same seed?
They intentionally add randomness for creative variation. It's a feature, not a bug.
How do I know when a sampler has converged?
Run same prompt at different step counts. When results stop improving noticeably, you've converged.
Should I always use Karras scheduler?
For DPM++ samplers, usually yes. For others, test both Normal and Karras.
Do video generation models use the same samplers?
Similar concepts apply, but video models often have specialized sampling implementations.
What sampler does Midjourney use?
Midjourney uses proprietary sampling methods not publicly disclosed.
Wrapping Up
Samplers and schedulers are fundamental to AI image generation. Understanding them helps you:
- Generate faster with fewer steps
- Get more consistent results
- Achieve specific artistic effects
- Troubleshoot quality issues
Key recommendations:
- Default to DPM++ 2M Karras at 20 steps
- Use Euler a for creative exploration
- Use UniPC when speed matters most
- Increase steps only when quality requires it
For hands-on generation without worrying about sampler details, Apatero.com handles optimization automatically. For deeper technical control, ComfyUI exposes all sampler options.
Quick Reference: Sampler Comparison
| Sampler | Speed | Quality | Deterministic | Best Steps |
|---|---|---|---|---|
| Euler | Fast | Good | Yes | 20-30 |
| Euler a | Fast | Good | No | 20-40 |
| DPM++ 2M | Fast | Excellent | Yes | 15-25 |
| DPM++ 2M SDE | Medium | Excellent | No | 20-30 |
| DDIM | Fast | Good | Yes | 20-50 |
| UniPC | Very Fast | Good | Yes | 10-20 |
| Heun | Slow | Excellent | Yes | 20-40 |
Start with DPM++ 2M Karras. Experiment from there based on your specific needs and the results you're getting.
Ready to Create Your AI Influencer?
Join 115 students mastering ComfyUI and AI influencer marketing in our complete 51-lesson course.
Related Articles
AI Art Market Statistics 2025: Industry Size, Trends, and Growth Projections
Comprehensive AI art market statistics including market size, creator earnings, platform data, and growth projections with 75+ data points.
AI Creator Survey 2025: How 1,500 Artists Use AI Tools (Original Research)
Original survey of 1,500 AI creators covering tools, earnings, workflows, and challenges. First-hand data on how people actually use AI generation.
AI Deepfakes: Ethics, Legal Risks, and Responsible Use in 2025
The complete guide to deepfake ethics and legality. What's allowed, what's not, and how to create AI content responsibly without legal risk.