{"id":838,"date":"2022-11-10T16:17:35","date_gmt":"2022-11-10T15:17:35","guid":{"rendered":"https:\/\/drawmytext.com\/?p=838"},"modified":"2022-11-10T16:27:14","modified_gmt":"2022-11-10T15:27:14","slug":"what-is-cfg-scale-in-text-to-image-stable-diffusion-and-how-to-use-it","status":"publish","type":"post","link":"https:\/\/drawmytext.com\/what-is-cfg-scale-in-text-to-image-stable-diffusion-and-how-to-use-it\/","title":{"rendered":"What is CFG Scale in Text-to-Image Stable Diffusion and How to Use It"},"content":{"rendered":"
Like Seed, the classifier-free guidance scale (CFG Scale) is one of the additional settings found in the Stable Diffusion model. The CFG scale adjusts how much the image looks closer to the prompt and\/ or input image.<\/p>\n
If CFG Scale is greater, the output will be more in line with the input prompt and\/or input image, but it will be distorted.<\/p>\n
On the other hand, the lower the CFG Scale value, the more likely it is to drift away from the prompt or the input image, but the better quality.<\/p>\n
\u00a0<\/p>\n
\u00a0<\/p>\n
\u00a0<\/p>\n
The LAION dataset, on which the Stable Diffusion was trained, is capable of producing effective results with just a short and simple set of img2img instructions.<\/p>\n
However, if you try to generate something that Stable Diffusion has no prior knowledge of and want to conjoin multiple concepts or people, you might need to turn up the value of the CFG scale and\/ or denoising strength.<\/p>\n
As a result, Stable Diffusion will generate creatively at the expense of image quality.<\/p>\n
\u00a0<\/p>\n
If you are getting less fidelity in your Stable Diffusion-generated images, try adjusting the value of CFG.<\/p>\n
Adjusting the CFG value will give images that exactly match your prompt.<\/p>\n
Mostly, the standard value of 7 would be effective.<\/strong><\/p>\n \u00a0<\/p>\n The CFG scale has a value of 0 to 20.<\/p>\n In general, a CFG Scale value of 7 to 11 will give the best results with low noise.<\/p>\n \u00a0<\/p>\n However, it varies if you have queried Stable Diffusion that has no prior knowledge.<\/p>\n \u00a0<\/p>\nWhat is the sweet spot of the CFG Scale? Or What is the Optimal Value of CFG Scale?<\/h2>\n