Stable diffusion parameters

Do you think that Stable Diffusion has too many parameters and you are confused about them?

Let us give you some explanation of each parameter. You might think you already know everything, but we guarantee you will learn something new. Let’s unlock the full potential of Stable Diffusion!

Steps

This parameter controls the number of these denoising steps. Higher is better but to a certain degree. The default it uses 25 steps which should be enough for generating any kind of image.

General guide on what step number to use for different cases:

  • Testing a new prompt and you want to have fast results to tweak your input, use 10-15 steps.
  • When you find the prompt you like - increase the steps to 25.
  • When you are creating a face or an animal with any subject that has detailed texture, and you feel the generated images are missing some of these details, try to increase it up to 40!

Samplers

Stable Diffusion models work by denoising a starting noise canvas. This work is belong to Diffusion samplers. 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 there are three most used samplers implemented - Euler A, DDIM, and DPM Solver++. 

The only one noticeable difference between Euler A sampler and the other two that is worth mentioning is that it gives your image smoother colors with less defined edges, giving it more of a “dreamy” look in your generated images.

CFG guidance scale

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.

Here are examples of the values:

  • CFG 2 – 6: Creative, but might be too distorted and not follow the prompt. Can be fun and useful for short prompts
  • CFG 7 – 10: Recommended for most prompts. Good balance between creativity and guided generation
  • CFG 10 – 15: When you’re sure that your prompt is detailed and very clear on what you want the image to look like
  • CFG 16 – 20: Not generally recommended unless the prompt is well-detailed. Might affect coherence and quality
  • CFG >20: almost never usable

Seed

The seed is a number that decided the initial random noise 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:

  • Control specific features of a character: in this example, we changed the emotion, but this can also work for other physical features like hair color or skin color, but the smaller the change the more likely it will work.

Source: openart blog




Comments