Stable Diffusion Parameters: The Definitive Guide

stable diffusion parameters
On This Page

Today, I am going to cover all of the stable diffusion parameters.

Learning how to use these parameters will make your image generation more efficient, visually stunning, and consistent images.

So, if you want to become better at stable diffusion, this guide is for you.

Let’s dive right in.

On This Page:

What are Stable Diffusion Parameters?

Stable diffusion parameters are the settings responsible for the output you get when generating images.

Optimizing these parameters is going to be extremely important to getting the exact image that you are trying to generate.

What is the Stable Diffusion Number of Parameters?

The total number of parameters is around 9, including:

  1. Prompts
  2. CFG Scale
  3. Sampling Method
  4. Schedule Type
  5. Sampling Steps
  6. Seed
  7. Clip Skip
  8. Batch Count & Batch Size
  9. Width and Height

But this number will depend on what stable diffusion software you are using. 

All Stable Diffusion Parameters Explained:

Prompts

Prompts in stable diffusion are a text description to guide image generation. Your prompt is separated into keywords/tokens that the model will be able to understand.

prompt box parameter

The prompt is separated into two different parts—the positive prompt and the negative prompt:

  • Positive prompt: Guides the image generation to match the text description.
  • Negative prompt: Guides the image generation away from the text description. 

Secondly, I recommend most people follow a specific prompt syntax that follows this format:

Viewing Angle, Subject, Details, Medium, Style, Artist/Render, Lighting, Resolution/Focus

Recommended settings:

  • Prompt Syntax: Viewing Angle, Subject, Details, Medium, Style, Artist/Render, Lighting, Resolution/Focus
  • Positive prompt: Use keywords in a comma-heavy fashion to guide the images towards your description.
  • Negative prompt: Use keywords with commas separating the keywords to have images avoid your description.

CFG Scale

The CFG scale in stable diffusion tells the software how closely you want it to follow the prompt.

CFG scale setting

It might sound like you want to keep the guidance scale at the highest value, but it will actually have negative effects on your image generation if you do.

Having a high CFG scale setting creates images that start to look over-saturated and unrealistic.

Recommended settings:

  • Realistic images: Use a CFG Scale of 2-5
  • Unrealistic images: Use a CFG Scale of 2-10

Sampling Method

Sampling methods are different processes for stable diffusion to refine the starting noise from image generation and eventually end up with the final image.

stable diffusion sampling methods

Samplers heavily dictate the quality and efficiency of the final image. 

Recommended settings:

  • For good speed: DPM++ 2M.
  • For good quality: DPM++ SDE

Schedule Type

Schedule types are different methods for adding and removing noise while generating images.

Schedule types parameter

Schedule types are often paired with sampling methods because they sometimes aren’t an available option to choose from in all stable diffusion software.

Recommended settings:

Karras, as of now, is probably the best schedule type due to its ability to adjust how much noise is being removed depending on your sampling steps.

Sampling Steps

Sampling steps dictate how many layers or steps it takes to turn noise into the final image.

sampling steps in stable diffusion

There is really a finite amount of steps that are beneficial for generating images because, in most cases, all noise is removed at about 20 steps. 

Recommended settings:

Generally, 20-30 steps will be enough for most combinations of settings to completely remove noise and generate a quality image.

Seed

Seeds are values assigned to starting noise. Each seed will have a different starting noise, which will result in a different final image.

stable diffusion parameter seed

Seeds can be used to keep the same starting noise to test different parameters, or the seed can change each generation to have different outcomes with the same settings.

Recommended settings:

  • Random: When you don’t want to change your other parameters and still want a different output each time.
  • Recycle: When you are experimenting with changing other parameters, keeping the seeds the same can help identify the best changes to your settings.

Clip Skip

Clip skip skips layers involving the processing of prompts in the generation process.

Clip Skip settings

In general:

  • Lower Values: Stable diffusion will follow your prompt better
  • Higher Values: This makes generation less flexible and more generally follows the prompt

Recommended settings:

You should use a setting of either 1 or 2 for clip skip.

Batch Count & Batch Size

Batch count and batch size are different ways of generating multiple images at the same time. 

Batch Count and Batch Size Setting

Although they might sound the same, they are, in fact, two different processes of generation of multiple images. 

Recommended settings:

If you are trying to increase the amount of images generated at the same time, increasing batch size before batch count is best for efficiency. 

Width and Height

The stable diffusion width and height parameters dictate the image size or resolution of the output image.

stable diffusion parameter width and height

This setting can be important for three reasons:

  1. Choosing a different width and height creates a completely different image, similar to seeds.
  2. The width and height settings have a huge impact on the speed and computation needed from your computer.
  3. Certain stable diffusion models have optimal outputs that you should choose from to avoid making images with artifacts and distortions. 

Recommended settings:

  • SD 1.0: 256×256
  • SD 1.2, 1.3, 1.4: 512×512
  • SD 1.5: These models are usually fine-tuned for a variety of image sizes.
    • Square aspect ratio (1:1), 512×512 and 768×768.
    • Landscape mode (3:2), 768×512.
    • Portrait orientation (2:3), 512×768.
    • Landscape ratio of (4:3), 768×576.
    • Portrait ratio of (3:4), 576×768.
    • Widescreen aspect ratio (16:9), 912×512.
    • Tall format (9:16), 512×912.
  • SD 2.0: 768×768 resolution but still somewhat follows the same recommendations of the 1.5 models.
  • SD 3.0: 1024×1024
  • SD XL: SD Xl has an ideal resolution of 1024×1024. However, it can be varied as well.
    • Square aspect ratio (1:1), 1024×1024 and 768×768.
    • Landscape mode (3:2), 1152×768.
    • Portrait orientation (2:3), 768×1152.
    • Landscape ratio of (4:3), 1152×864.
    • Portrait ratio of (3:4), 864×1152.
    • Widescreen aspect ratio (16:9), 1360×768.
    • Tall format (9:16), 768×1360.

Is There Anything I Missed?

Now I’d like to hear from you:

Are there any stable diffusion parameters that I missed?

Let me know by leaving a comment down below.

Leave a Comment