Guide and Usage Tips: Stable Diffusion CFG Scale for Optimal Results

Stable Diffusion is a pretty cool text-to-image diffusion model that can work wonders when it comes to generating lifelike and imaginative images. 

Now, one of the important parameters in Stable Diffusion is the CFG Scale. This little parameter greatly impacts how closely the generated image aligns with the text prompt.

Stable Diffusion CFG Scale

In this post, we will discuss the CFG Scale in detail, and provide some tips on how to use it to get optimal results. 

We will also show some examples of images generated with different CFG Scale values.

What is the CFG Scale?

The CFG Scale stands for Classifier-Free Guidance Scale. It is a parameter that controls how much the text prompt influences the generated image. 

A higher CFG Scale value will make the generated image more similar to the text prompt, while a lower CFG Scale value will give the AI more freedom to be creative.

The default CFG Scale value is 7 in Stable Diffusion. 

Don’t worry, you will understand why almost all image generators’ CFG default value is 7 after experimenting with us.

For instance, from a theoretical point of view:

This value provides a good balance between creativity and fidelity to the text prompt.

How does the CFG Scale work?

Basically, the CFG Scale is responsible for controlling the amount of noise added to the generated image. 

If you set a higher CFG Scale value, it means more noise will be added, resulting in an image that closely resembles the text prompt you provided.

On the other hand, if you choose a lower CFG Scale value, less noise will be added, giving the AI more room to get creative and produce diverse and unique images. 

So, depending on the level of similarity you want between the image and the prompt, you can adjust the CFG Scale accordingly. 

You May Like: Furry Diffusion Promts and Model Downloads

How to use the CFG Scale

Pointing CFG Scale in Stable Diffusion Interface

After accessing your SD server to use Stable Diffusion CFG Scale, simply scroll down and adjust the slider in the Stable Diffusion interface, as shown in the image above.

The slider ranges from 1 to 30, with 1 being the lowest value and 30 being the highest value.

Now, you might be wondering, how do I determine the perfect CFG Scale value for my text prompt? Well, that’s where the beauty of experimentation comes into play. 

The best way to crack the value and find the ideal CFG Scale that aligns with your desired outcome is by giving it a try. 

So let’s play around with different values in various stable diffusion models or versions, and observe how they affect the output.

Here I experiment with Stable Diffusion 2.1 of Huggingface for a particular prompt.

Examples of images generated with different CFG Scale values

Prompt: “polish girl with strong jawline, sharp eyes mid 70 lenght shang hair”

To utilize Stable Diffusion 2.1 by Huggingface, simply visit the website and after scrolling down adjust your CFG scale. In my case, I initially set the value to 7, as demonstrated below.

Images generated with cfg scale value 7

CFG Scale = 7: You can see these images are more realistic and faithful to the text prompt. It still has some creative elements, but it is overall more similar to the real world.

Now, let’s fix it to 1

Images generated with cfg scale value 1

CFG Scale = 1: In this case, you can see that these images are very creative and abstract. It does not look much like the text prompt, but it is still visually appealing.

Now let’s check it with the value Zero.

Images generated with cfg scale value 0

CFG Scale = 0: The output is like: “Out of the blue, he started counting his chickens before they hatched, and boy, did they turn out to be ducks wearing disguises!”😒

So, what do you think, Zero means you are giving Infinite freedom for creativity to Stable Diffusion.

In other words, there is zero value in your prompt.

Now let’s take a decent value of 30.

Images generated with cfg scale value 30

CFG Scale = 30: These images are very similar to the text prompt but the resolution is very poor.

That’s why we did not increase the CFG Scale value further.

But If you noticed here we don’t use negative prompts, So let’s see another example with a negative prompt(colors, bad quality).

Images generated with cfg scale value 9 with negative prompt

Now you can see the images are similar to the images generated with CFG value 7 but the quality has improved.

So, what do we learn from this discussion?

Learning & Tips for Using the CFG Scale

  • Most of the image generators keep their default CFG Scale value as 7 for some cases it may be 9. It means the range is good to balance the prompt and creativity.
  • Higher CFG Scale values will make the generated images more similar to the text prompt but quality breaks down.
  • Lower CFG Scale values will give the AI more freedom to be creative, even if it may be outside the prompt.
  • The CFG Scale can be used to fine-tune the generated images.
  • For example, if the generated image is not following the text prompt, you can increase the CFG Scale value.
  • If the generated image is too noisy or distorted, you can decrease the CFG Scale value.


1. What is the CFG scale?

The CFG scale stands for Classifier-Free Guidance scale. It is a parameter that controls how closely Stable Diffusion should follow your text prompt.

2. What is the meaning of CFG Scale?

CFG scale means a guidance scale in Stable Diffusion. Choosing a higher value increases the likelihood of generating an image that aligns with your prompt while opting for a lower CFG value grants Stable Diffusion greater creative freedom.

3. What is the default CFG value?

The default CFG value is 7. This means that Stable Diffusion will generally follow your text prompt, but it will also allow for some creativity.

4. What are the possible values for the CFG scale?

The CFG scale can range from 1 to 30. A value of 1 means that Stable Diffusion will have complete creative freedom, while a value of 30 means that Stable Diffusion will strictly follow your text prompt.

5. What happens if I set the CFG scale to a very high or very low value?

If you set the CFG scale to a significantly high value, Stable Diffusion might produce images that closely resemble your text prompt, potentially leading to less creative and more repetitive results. Conversely, if you set the CFG scale to an extremely low value, Stable Diffusion may generate images that deviate greatly from your text prompt, reducing the likelihood of meeting your expectations.

6. How do I choose the right CFG value for my text prompt?

Based on our experience, the optimal range is between 7 and 10. However, the most effective approach to selecting the right CFG value is through experimentation. Generate images using various CFG values and determine your preferred outcome.

7. Can I use negative values for the CFG scale?

Yes, you can use negative values for the CFG scale. Based on our experiments, we can say the best way to practice different CFG scale values is with various negative prompts.


So, By adjusting the CFG Scale value with proper negative prompts, you can control how closely the generated image follows the text prompt, and how creative the image is.

And our experiment says the best CFG scale value is from 7 to 10 with a negative prompt.

So, experiment with different CFG Scale values to find the right balance for your needs. And don’t be afraid to get creative!

Editorial Staff at AiOptimistic is a team of enthusiastic as well as experts in the field of Artificial Intelligence led by Mithin with over 5 years of experience. AiOptimistic is the best resource to learn AI and make it simple for everyone.

Leave a Comment