Stable Diffusion: What is CFG Scale?

People who use Stable Diffusion for the first time often ask what the CFG scale setting actually does. There’s a lot of misinformation out there regarding this setting, but the general rule is that the higher your CFG scale, the more the image will match your prompt.

CFG (classifier-free guidance) tells Stable Diffusion how much guidance to use from your text prompt when generating an image. Most interfaces default the CFG scale to 7-8, which is a nice balance. You don’t want the CFG scale to be too high, it will just overcomplicate the image as the AI attempts to render every single word as a detail. Too low, however, and your image will deviate away from your prompt.

There is a benefit to having a low CFG scale sometimes, it can produce some really creative ideas that you might otherwise not have thought of. The default setting of 7 is often fine for most images, however I wouldn’t go below 3 unless you are wanting a bunch of random images. I would also stick below 14 in most cases as going above that usually results in distorted or confusing images.

The model you’re using does have an effect in the CFG scale too. Some models will naturally prefer a higher CFG in order to stay consistent with your prompt, some also work great with a low CFG scale to produce some abstract results. This will require some experimenting as there so many different models out there, I’m not sure if embeddings are also affected by this yet but I would assume they are.

If you’re looking to produce realistic images (i.e. stock photos), you might have better results from trying a higher CFG scale. If you’re looking to produce some abstract or complex art, you could probably benefit from running a lower CFG scale (around 3-6). As I said it does take some experimenting with, your results will probably vary from model to model which is why I think it’s a good idea to find a few models you really like and primarily work with those!