[Stable Diffusion] What are sampling steps? Compare the difference for each step!

  • What are the Sampling steps on the Stable Diffusion screen?
  • How much do the sampling steps affect the ai illustration?
  • Tell me how many I should set it to!

We will answer these questions for you.

[Stable Diffusion] What are sampling steps? Compare the difference for each step!
[Stable Diffusion] What are sampling steps? Compare the difference for each step!

[Stable Diffusion] What are sampling steps? Compare the difference for each step!

Sampling steps play an important role in generating illustrations with Stable Diffusion. The higher the number of steps, the higher the quality of the illustration.

After all, you want to know how many steps you should set.

In this article, We'll discuss these :

  • What are the Sampling steps in Stable Diffusion?
  • [Conclusion] Recommended number of sampling steps
  • If you want to generate illustrations more smoothly...
  • How to easily manage a large number of generated illustrations

We'll discuss these so that by the end, you'll be able to determine the appropriate Sampling steps values ​​for you.

If you are a beginner or have any questions about Stable Diffusion, please read the following articles. It explains in detail how to download and use Stable Diffusion.

>> [Complete Beginner's Guide] Thorough explanation of how to use Stable Diffusion!

What are the Sampling steps in Stable Diffusion?

Roughly explaining the sampling steps is "the number of times to remove noise".

Stable Diffusion generates illustrations by removing noise from noise images.

I don't paint on a blank canvas :

What are the Sampling steps in Stable Diffusion?
What are the Sampling steps in Stable Diffusion?

Illustration generation starts from an image full of noise like this.

The more Sampling steps entered in Stable Diffusion, the less noise is removed per operation. Therefore, the image can be more carefully removed noise.

For example, if Sampling steps is "1"


The illustrations are of such poor quality.

On the other hand, if the Sampling steps are set to "40" under the same conditions :


It's like, "It's written very carefully."

The higher the number of sampling steps like this, the higher the quality of the ai illustration that can be generated. On the other hand, it takes time depending on the number of steps, so I would like to decide the number of steps depending on whether quality or time is prioritized.

The mechanism of noise removal by the sampling method is explained in detail in the following article.

[Conclusion] Recommended number of sampling steps

[Conclusion] Recommended number of sampling steps
[Conclusion] Recommended number of sampling steps

As conclusion :
  • Sampling method belonging to the normal group: 15 to 20 steps.
  • Sampling method belonging to quadratic solver: 10-15 steps.
It is recommended to set it like this.

2nd order solvers are a general term for sampling methods that perform noise removal twice in one operation. The feature is that it takes about twice as much time instead of doing two jobs in one step.

So it doesn't make sense to lump the normal sampling method and the quadratic solver's sampling method together.

It is like this. Which sampling method do you usually use?

As an example, compare the regular group Euler with the quadratic solver Heun.

The specific sampling methods belonging to each group are :


When compared with the same number of steps, Heun, which is a quadratic solver, clearly has higher quality. There is a big difference, especially around steps 5 to 10.

This is what it looks like after cropping the image. Euler's impression that the illustration is still blurred.


In the second half of the video, the patterns of both converge and get closer.

As you can see, there is a big difference between the normal ⇔ quadratic solver. The quadratic solver does two jobs per step, so it's only natural that the quality will improve.

That's why Heun takes about twice as long to generate. Step 40 was fucking long...

After seeing this result, the author

"For a normal group's Sampling method (Euler), about 15 to 20 steps would be fine."

I decided that 10 to 15 steps would be enough for a quadratic solver (Heun), what do you think?

I hope you can judge the optimal number of steps for you while watching the video above.
This video will be helpful for other sampling methods as well. If the sampling methods belong to the same group, I don't think there is a big difference between the number of steps and the quality.

Comparing Euler and DDIM, which belong to the same normal group :


Both are illustrations with a good feeling from the number of steps in the latter half of about 10.

Therefore, even when using DDIM, 15 to 20 steps are still recommended. Euler is no different.

If the sampling method you usually use belongs to the normal group, then Euler's result, and if it belongs to the quadratic solver, see Heun's result.

I really want to make a video about all the sampling methods, but I don't have the money or the time, so please forgive me.

The optimum number of steps will change depending on your environment, usage model, and desired quality, so please refer to this as my personal opinion.

More than 30 steps does not improve the quality in spite of the time, so cost performance is bad and I do not recommend it.


Next Post Previous Post
No Comment
Add Comment
comment url