Expert Guide to CFG in Stable Diffusion Yeni, February 27, 2024February 28, 2024 What is CFG in Stable Diffusion? CFG in Stable Diffusion stands for Classifier Free Guidance scale. CFG scale is a parameter that controls Stable Diffusion how ‘strict’ it should follow the prompt input in image generation. Lower CFG gives the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. It is a setting available in nearly all Stable Diffusion AI image generators. However, This does not imply that you should use larger CFG values when producing images. In fact, low values can produce more details and a softer image, but they may not include key features of the prompt. High values are typically sharper, and more likely to incorporate everything from the prompt, but may have fewer details, particularly those not in the prompt. What is the best CFG Settings? The default CFG scale value in Automatic1111 Stable Diffusion is 7, which strikes as an appropriate mix between creative flexibility and following your prompt. However, this does not imply that 7 is the optimal pick for all prompt words. The CFG scale value size must be flexible enough to accommodate the intricacy of the prompt words. So how do you choose the best CFG scale value? Let’s play around with the CFG scale and basic prompt: Prompt: Portrait of Brad Pitt in blue suit, 4k, high quality CFG 1: the prompt is ignored. The picture slightly look like Brad Pitt but does not follow the Blue Suit prompt CFG 2-6: Creative, but might be too distorted and not follow the prompt. Can be fun and useful for short prompts. As you can see here, not all the prompts are followed and produce cropped image. CFG 7-10: Recommended for most prompts. Good balance between creativity and guided generation. As shown here, it match with Brad Pitt persona and the blue suit prompt. CFG 10-15: When you’re sure that your prompt is detailed and very clear on what you want the image to look like. The result here photos shown high details with some skin textures and high contrast. CFG 16-20: Not generally recommended unless the prompt is well-detailed. Might affect coherence and quality. As you can see, the quality is decreased with too much contrast and lighting. CFG > 20: rarely usable The CFG scale determines the trade-off between accuracy and creative freedom. A higher CFG number produces a more accurate image, while a lower CFG value produces more diversified images. Conclusion Finding a sweet spot in CFG Scale can be tricky. Generally, the default settings in Stable Diffusion is pretty good and can produce good result. However, if you have a lot of details in your prompt and would like your generation to be as precise as possible, you can adjust the CFG Scale in the higher side. Testing out your prompt and you need faster generation? Make sure to try DiffusionHub! Share on FacebookPost on XFollow usSave Uncategorized Automatic1111
Uncategorized Stable Cascade February 21, 2024 Introduction of Stable Cascade Stable Diffusion has come a long way to be an open-sourced AI Image generator in the market. We all know that image generated by AI often has flaws, particularly in Stable Diffusion, with its famous deformed human organs with three fingers or misplaced eyes, not-so-perfect added… Read More
Uncategorized Guide to Deforum in Automatic1111 March 7, 2024March 7, 2024 Content What is Deforum? Deforum is one of the tools in Stable Diffusion to create animation. It use Stable Diffusion’s image-to-image function to generate a series of images, which are then stitched together to form the video. Furthermore, Deforum makes minor changes to an image frame and then uses the… Read More
Automatic1111 Ultimate SD Upscale in Stable Diffusion March 29, 2024March 22, 2024 Stable Diffusion is one of the powerful image generation model that can produce high-quality images based on text descriptions. It also includes the ability to upscale photos, which allows you to enhance the resolution of an image without sacrificing quality. Ultimate SD Upscale in img2img is one of the extensions… Read More