6 Improving Images with Samplers

 
“Just look at him! there he stands
With his nasty hair and hands.
See! his nails are never cut;
They are grimed and black as soot;
And the sloven, I declare,
Never once has combed his hair;
Anything to me is sweeter
Than to see Shock-headed Peter”

-- Der Struwwelpeter, Heinrich Hoffman

This chapter covers

  • Understanding what Sampler methods and Schedule types are
  • Overview of three different Sampler methods
  • Learning how samplers can impact the results
  • Explore three different schedule types
  • Using ancestral samplers to get random results with some control

In the last chapter we saw that changing your checkpoint can have a dramatic impact on the outcome of your image generation in Stable Diffusion. In this chapter we’ll be looking at the other end of the impact spectrum: Samplers. While the impact of different samplers on the final result are often subtle, it’s precisely these subtle tweaks that allow you to get images just right.

Recall from chapter 4 that Stable Diffusion is trained by adding noise to an image and then removing that noise, step-by-step, guided by the prompt to restore the original image. When we generate images with Stable Diffusion we provide the model with just noise and then trick it into creating an image by having it remove what it thinks is noise. This results in creating a recognizable image from nothing.

6.1 Understanding Sampling Methods and Schedule Types

6.1.1 Sampling Methods

6.1.2 Schedule Type

6.2 Exploring Samplers and Schedule Types

6.2.1 Samplers we’ll be exploring

6.2.2 Exploring our 3 Samplers

6.2.3 Exploring Schedule Types

6.2.4 Ancestral Samplers

6.3 Conclusion

6.4 Summary