Stable Diffusion Prompt Weights Maximum

Stable Diffusion is a powerful AI image generation model that creates images from text prompts. Prompt weighting allows you to control the emphasis placed on different parts of a prompt, giving you more precise control over the generated image.

In this article, I’ll provide a comprehensive guide on prompt weighting in Stable Diffusion, from basic concepts to advanced techniques.

What is Prompt Weighting?

Prompt weighting assigns a numerical weight to certain words or phrases in your prompt. This signals to Stable Diffusion how much importance to give those parts when generating the image.

Higher weights increase emphasis and make it more likely those prompt elements will be prominent in the final image. Lower weights decrease emphasis. The default weight for all terms is 1.

For example:

cat playing chess::2

This doubles the importance of “playing chess” compared to just “cat”. The AI will focus more on generating a cat playing chess specifically.

Basic Prompt Weighting Techniques

Here are some basic prompt weighting techniques to give certain elements more or less emphasis.

Increasing Emphasis

To increase emphasis, add a + sign or number greater than 1 at the end of the relevant phrase. Some examples:

cat playing chess::1.5
lion with huge mane++ 
flower field with poppies+
  • ::1.5 – Increases the weight by 50%
  • ++ – Doubles the weight (equivalent to ::2)
  • + – Increases the weight slightly (equivalent to ::1.1)

The more + signs, the greater the increase in weighting.

Decreasing Emphasis

To reduce emphasis, add a - or number between 0 and 1. For example:

cat playing chess::-0.5
lion with small mane--
flower field with few poppies-
  • ::-0.5 – Decreases the weight by 50%
  • -- – Halves the weight
  • - – Slightly reduces the weight

The more - signs, the greater the decrease in weighting.

Removing Elements

To try to remove unwanted elements altogether, decrease their weight significantly (e.g. ::-2). However, a very low weight can sometimes still leave traces of that element. Using negative prompts is often more effective for complete removal.

Advanced Prompt Weighting Techniques

Now let’s look at some more advanced techniques to take your prompt weighting to the next level.

Weighting Multiple Phrases

You can weight multiple parts of a prompt differently to get more granular control:

cat playing chess::2 holding a sword::1.5 wearing an astronaut helmet::3

Here the cat playing chess is most important, followed by it holding a sword, with the helmet detail being weighted highest.

Stylistic Weighting

Prompt weighting can also be used to control stylistic elements:

digital painting of a wizard tower::1.5 in the style of Greg Rutkowski::3

This puts extra emphasis on generating something that matches Greg Rutkowski’s style.

Consistent Faces

For consistent human/animal faces try weighting identity details higher:

portrait photo of Mary::2.5 with blue eyes::1.5 curly blonde hair::1.5

Image Composition

Weight spatial composition terms more to give Stable Diffusion a clearer idea of how you want elements arranged:

a large green tree::2 on the right::1.5 a small red flower::1.2 on the left::1.5

Prompt Weighting Limits

There are some limits to be aware of when weighting prompts:

  • No more than 8-10 heavily weighted terms (e.g. ::2 or higher)
  • Maximum token weight of around 2-2.5 for best results
  • Weighting too many terms too highly tends to give messy, incoherent images

So use prompt weighting judiciously – emphasize the 4-5 most important elements and avoid cranking up the weights too high across the whole prompt.

Check Weights Balance

When using multiple weighted phrases, look at their relative weights and adjust to get the balance you want:

cat playing chess::2 holding a sword::1.5 wearing an astronaut helmet::3

Here the helmet detail is weighted much higher than the others – lowering it to ::2 would even things out.

Prompt Weighting for Consistent Faces

Generating consistent human/animal faces is tricky – prompt weighting can help. Here are some tips:

  • Identity details – Weight core identity terms like names and gender higher e.g. Mary::2.5
  • Facial features – Increase emphasis on key facial features like eyes::1.5, nose::1.5
  • Camera details – Lock down angle/focal length e.g. 50mm lens::2
  • Lighting – Consistent lighting via terms like soft lighting::2 helps

This focuses Stable Diffusion on core identity and facial elements rather than distracting accessories or backgrounds.

Prompt Weighting Use Cases

Some examples of great use cases for prompt weighting:

  • Enhancing detail – Increase emphasis on fine details like feathers::2, scales::2, intricate patterns::2
  • Directing style – Weight stylistic terms like artist names or genres higher
  • Fixing artifacts – Reduce unwanted elements using negative weight e.g. artifacts::-2
  • Consistent faces – As described above, weight identity and facial features higher

Prompt weighting takes practice – start simple and work up to more complex weighted prompts.

The key is identifying the 4-5 most important elements you want to emphasize or deemphasize.

Helpful Resources

Here are some useful resources to learn more about prompt weighting:

I hope you found this comprehensive prompt weighting guide useful! Let me know if you have any other questions.