
sampler
or sampling method
.
Sampling is just one part of the Stable Diffusion model. Read the article “How Does Stable Diffusion Work?” if you want to understand the entire model.
Below is a sampling process in action. The sampler gradually produces cleaner and cleaner images.

Samplers Overview
As of this writing, there are 19 samplers available in Novita AI, and this number seems to be growing over time. What are the differences?
Old-School ODE Solvers
Let’s start with the easier ones. Some of the samplers on the list were invented more than a hundred years ago. They are old-school solvers for ordinary differential equations (ODE).- Euler – The simplest possible solver.
- Heun – A more accurate but slower version of Euler.
- LMS (Linear Multi-Step Method) – Same speed as Euler but supposedly more accurate.
Ancestral Samplers
Do you notice that some sampler names have a single letter “a”?- Euler a
- DPM2 a
- DPM++ 2S a
- DPM++ 2S a Karras


Karras Noise Schedule
The samplers labeled “Karras” use the noise schedule recommended in the Karras article. If you look closely, you will see that the noise step sizes are smaller near the end. This adjustment improves the quality of the images.DDIM and PLMS
DDIM (Denoising Diffusion Implicit Model) and PLMS (Pseudo Linear Multi-Step Method) were the samplers included with the original Stable Diffusion v1. DDIM is one of the first samplers designed for diffusion models, while PLMS is a newer and faster alternative to DDIM. They are generally considered outdated and are not widely used anymore.DPM and DPM++
DPM (Diffusion Probabilistic Model Solver) and DPM++ are new samplers designed for diffusion models released in 2022. They represent a family of solvers with similar architecture. DPM and DPM2 are similar, with DPM2 being second-order (more accurate but slower). DPM++ is an improvement over DPM. DPM adaptive adjusts the step size adaptively. It can be slow since it doesn’t guarantee completion within the specified number of sampling steps.UniPC
UniPC (Unified Predictor-Corrector) is a new sampler released in 2023. Inspired by the predictor-corrector method in ODE solvers, it can achieve high-quality image generation in 5-10 steps.How to Pick a Sampler
In this section, I will provide some objective comparisons to help you decide.Image Convergence
In this section, I will generate the same image using different samplers with up to 40 sampling steps. The last image at the 40th step will be used as a reference for evaluating how quickly the sampling converges, with the Euler method serving as the benchmark.Euler, DDIM, PLMS, LMS Karras and HeunFirst, let’s look at Euler, DDIM, PLMS, LMS Karras, and Heun as a group since they represent old-school ODE solvers or original diffusion solvers. DDIM converges at about the same number of steps as Euler but with more variations due to the injection of random noise during its sampling steps.

Ancestral SamplersIf a stable, reproducible image is your goal, you should avoid using ancestral samplers, as they all fail to converge.

DPM and DPM2DPM fast did not converge well. DPM2 and DPM2 Karras performs better than Euler but again in the expense of being two times slower. DPM adaptive performs deceptively well because it uses its own adaptive sampling steps. It can be very slow.

DPM++ solversDPM++ SDE and DPM++ SDE Karras suffer the same shortcoming as ancestral samplers. They not only don’t converge, but the images also fluctuate significantly as the number of steps changes. DPM++ 2M and DPM++ 2M Karras perform well. The Karras variant converges faster when the number of steps is high enough.

UniPCUniPC converges a bit slower than Euler, but not too bad.

Speed

Quality
Of course, speed and convergence mean nothing if the images look crappy. Final images Let’s first look at samples of the image.
So… which one is the best?
Here are my recommendations:- If you want to use something fast, converging, new, and with decent quality, excellent choices are
- DPM++ 2M Karras with 20 – 30 steps
- UniPC with 20-30 steps.
- If you want good quality images and don’t care about convergence, good choices are
- DPM++ SDE Karras with 10-15 steps (Note: This is a slower sampler)
- DDIM with 10-15 steps.
- Avoid using any ancestral samplers if you prefer stable, reproducible images.
- Euler and Heun are fine choices if you prefer something simple. Reduce the number of steps for Heun to save time.