Have you ever felt confused about the meaning of parameters such as CFG scale, seed, or negative prompt? You’ve come to the right place. In this guide, we will give you the most complete explanation of each parameter with clear examples. You might think you already know everything, but we guarantee you will learn something new. Let’s get started and unlock the full potential of Stable Diffusion with these parameters together.
A negative prompt is exactly what it sounds like – it’s the opposite of a prompt. You input is what you DO NOT want Stable Diffusion to generate. This is a very powerful but underused feature of Stable Diffusion, and it can assist you in achieving results that would take way more time to reach by just tweaking the positive prompt.
We know it can be hard to come up with negative prompts, so we have pre-curated negative prompts on https://openart.ai/create for you to easily choose from, here are some examples to demonstrate their effects.
General negative prompts: General: lowres, error, cropped, worst quality, low quality, jpeg artifacts, out of frame, watermark, signature
Negative prompts for people portraits: deformed, ugly, mutilated, disfigured, text, extra limbs, face cut, head cut, extra fingers, extra arms, poorly drawn face, mutation, bad proportions, cropped head, malformed limbs, mutated hands, fused fingers, long neck
Negative prompts for photorealistic images: Photorealistic: illustration, painting, drawing, art, sketch’
Stable Diffusion creates an image by starting with a canvas full of noise and denoise it gradually to reach the final output. This parameter controls the number of these denoising steps. Usually, higher is better but to a certain degree. The default we use is 25 steps which should be enough for generating any kind of image.
Here’s a general guide on what step number to use for different cases:
Some people are used to creating images with 100 or 150 steps, this was useful for samplers like LMS, but now it’s generally no longer needed with the improved fast samplers like DDIM and DPM Solver++, by using a high number of steps with these samplers you’ll probably be wasting your time and GPU power, without any increase in image quality.
As we mentioned before, Diffusion models work by denoising a starting noise canvas. This is where Diffusion samplers come to work. In simple terms, these samplers are algorithms that take the generated image after each step and compare it to what the text prompt requested, and then add a few changes to the noise till it gradually reaches an image that matches the text description.
On OpenArt we’ve implemented the three most used samplers by users, Euler A, DDIM, and DPM Solver++. You can try the three and see what fits your prompt better since there is no rule on what sampler to use, but these three are very fast and capable of producing coherent results in 15-25 steps.
There is only one noticeable difference between Euler a sampler and the other two that is worth mentioning, in this comparison you can see how Euler a results – compared to DPM Solver++– have smoother colors with less defined edges, giving it more of a “dreamy” look, so use Euler a if this is an effect you prefer in your generated images.
This parameter can be seen as the “Creativity vs. Prompt” scale. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt.
The default CFG used on OpenArt is 7, which gives the best balance between creativity and generating what you want. Going lower than 5 is generally not recommended as the images might start to look more like AI hallucinations, and going above 16 might start to give images with ugly artifacts
So when to use different CFG scale values? CFG scale can be separated into different ranges, each suitable for a different prompt type and goal
The seed is a number that decided the initial random noise we talked about previously, and since the random noise is what determines the final image, it is the reason you get a different image each time you run the exact same prompt on StableDiffusion systems like OpenArt, and why you get the same generated image if you run the same seed with the same prompt multiple times.
Since the same seed and prompt combo gives the same image each time, we can use this property to our advantage in multiple ways:
The Img2img feature works the exact same way as txt2img, the only difference is that you provide an image to be used as a starting point instead of the noise generated by the seed number.
Noise is added to the image you use as an init image for img2img, and then the diffusion process continues according to the prompt. The amount of noise added depends on the “Strength of img2img” parameter, which ranges from 0 to 1, where 0 adds no noise at all and you will get the exact image you added, and 1 completely replaces the image with noise and almost acts as if you used normal txt2img instead of img2img.
So how to decide what strength to use? Here is a simple guide with examples:
Congrats on reaching this far! You now have a comprehesnive understanding of all Stable Diffusion parameters. If you would like to learn more about how to write better prompts, you can check out our Prompt Book. Definitely give it a try on creating some AI images on https://openart.ai/create.
This post is contributed by our community member Public Prompt, who is also the creator of http://publicprompts.art/.
In conclusion, mastering stable diffusion parameters is key for artists looking to push the boundaries of AI-enhanced creativity. This guide aims to equip you with the knowledge to finely tune these parameters, blending your artistic vision with the capabilities of AI. Remember, experimentation is your best tool. Each adjustment to the parameters is a step closer to perfecting your art. As you continue to explore and create, keep this guide as your reference and don't forget to sign up at Open Art for more insights, tools, and a community of like-minded creatives. Whether you're just starting or are looking to refine your skills, the journey of discovery and creation is endless.