What Is CFG Scale in Stable Diffusion

Are you trying to use the CFG scale in Stable Diffusion? Learn how to use it through the detailed steps below.
What Is CFG Scale in Stable Diffusion

CFG (Classifier Free Guidance) scale, also known as the Guidance scale, is a parameter that offers flexibility to control the intensity of the prompt in image generation. In this guide, we will help you with using the CFG scale and address the confusion of what value to set through a demonstration to get you all covered.

CFG Scale in Stable Diffusion

  1. Start by loading Stable Diffusion on your browser and navigate to the Generation tab under txt2img or img2img.
Generation tab
  1. Now, look for the CFG Scale from the available options and set the scale by adjusting the slider or changing the values in the input box provided.
Look for CFG scale
  1. Once the desired value is set, fill in the positive and negative prompts and click on Generate.
Prompts and generate button

For the demonstration, we used the same prompt while varying the CFG values. Here are our observations.

  • CFG 1-6: Allows for more artistic freedom but can result in images that are less accurate to the prompt, making them ideal for more straightforward prompts.
CFG 1
  • CFG 7 (Default value): Provides a good mix of creativity and following the prompt closely.
CFG 7 default
  • CFG 7-10: These values work well for most prompts, offering a balanced approach between creativity and accuracy.
CFG 10
  • CFG 10-15: Use these values when you need the image to match a detailed and specific prompt closely.
CFG 13
  • CFG 16-20: These values are generally not recommended as they can compromise the image’s consistency and quality.
CFG 16
  • CFG > 20: Values above 20 are typically not useful and should be avoided.
CFG 24

Wrapping Up

Congratulations on learning how to use the CFG scale in Stable Diffusion!

While we have described the potential result that might be generated with a specific CFG scale set, the results can vary based on the prompt provided. Hence, we suggest considering the results demonstrated as a reference and experimenting with the CFG values and the prompt.


What Is ControlNet Stable Diffusion

What Is Clip Skip Stable Diffusion

How to Inpaint Stable Diffusion

How to Outpaint Stable Diffusion

How To Upscale Stable Diffusion

Pttrns

We will be happy to hear your thoughts

Leave a reply

Pttrns
Logo
Enable registration in settings - general