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 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 Fix Hands in Stable Diffusion March 25, 2024March 22, 2024 Creating beautiful realistic images using AI can often be challenging. Hands and fingers anatomy sometimes can be wonky, which has been a general complaint across AI image generators. Thankfully, the Stable Diffusion community is quick to respond to this problem by developing a new controlNet that can fix 90% of… Read More
Uncategorized Stable Diffusion 3 April 29, 2024April 29, 2024 This week, Stable Diffusion community has been buzzing with the release of Stable Diffusion 3 API. Just what is exactly difference between the previous model and SD 3? We’ll deep dive into this blog post! What is Stable Diffusion 3? Stable Diffusion 3 (SD3) is an advanced text-to-image generation model… Read More