Process

Guide: What Denoising Strength Does and How to Use It in Stable Diffusion

When doing research to write my Ultimate Guide to All Inpaint Settings, I noticed there is quite a lot of misinformation and confusion over what denoising strength actually does. To help clear things up, I’ve put together these visual aids to help people understand what Stable Diffusion does for different Denoising Strength values, and how you can use it to get the AI generated images you want.

What is Denoising Strength?

When a user asks Stable Diffusion to generate an output from an input image, whether that is through image-to-image (img2img) or InPaint, it initiates this process by adding noise to that input based on a seed. The amount of noise it adds is controlled by Denoising Strength, which can be a minimum of 0 and a maximum of 1.

  • A Denoising Strength value of 0 will add zero noise, so your output will look exactly like your input
  • A Denoising Strength value of 1 will completely replace your input with noise

The practical implication of this setting is that Denoising Strength helps to determine how closely your output image will be influenced by your input image. You can see this principle at play in the following X/Y plot that charts Denoising Strength against Sampling Steps for an image of Emma Watson that gets transformed via img2img into a 2D black and white checker pattern.

Study showing denoising strength vs sampling steps in Stable Diffusion
Study showing denoising strength vs sampling steps in Stable Diffusion

In the X/Y plot, you can see that the image of Emma Watson remains completely unchanged if Denoising Strength is set to 0, regardless of the number of sampling steps. When sampling steps are set to only 1, you can get a close visual representation of the noise that Stable Diffusion adds to the input image as Denoising Strength increases. As the values for both variables change, we can conclude the following:

  • Lower Denoising Strength will make your generated images look similar to your input image, and therefore low values can be useful if you only want to make small modifications
  • Higher Denoising Strength increases variation and reduces the influence of your input image on your output image, which makes high values useful for significant modifications.

To further understand this X/Y plot, you need to know that sampling steps are the iterations Stable Diffusion runs to go from random noise to a recognizable image based on the text prompt. When we set the sampling step count to a very low number, we can get an idea of the amount of noise that Denoising Strength introduces to the input image. As sampling step count increases, we can see how Stable Diffusion resolves that noise to produce an image that matches the text prompt based on the CFG Scale (up to a certain point).

Start Playing With Denoising Strength in Stable Diffusion

The denoising strength setting can be found under the img2img and InPaint tabs in the Stable Diffusion Web UI beneath the area where you can add your input image. The default value is 0.75.

Denoising strength setting as it appears in the img2img menu in the Stable Diffusion Web UI
Denoising strength setting as it appears in the img2img menu in the Stable Diffusion Web UI

If you want to see how adjusting denoising strength in Stable Diffusion will improve your AI generated images using img2img and InPaint, here are a few options to get you quickly started without having to download and install it yourself:

Stable Diffusion Tutorial: How to In Paint
What are Sampling Steps and How to Reduce Them in Stable Diffusion
What are Seeds and How to Use Them
How to Train a Custom Embedding in Stable Diffusion Tutorial
How To Set Up ControlNet Models in Stable Diffusion