A Guide to Negative Prompts in Stable Diffusion

A Guide to Negative Prompts in Stable Diffusion

Stable Diffusion, probably the most powerful text-to-image generation model, can generate anything you can dream up, as long as your prompt is clear. You can improve the quality of your images by using negative prompting. You can break down prompting into two parts:

  • Positive prompts
  • Negative prompts 

The positive prompts are used to describe what you want your output to look like, while the negative prompts are used to describe everything you want to be excluded from your output.

In this blog, we’ll look at what Negative prompts are, how they work, and how to use them to generate a more refined image that follows your directions using Stable Diffusion.

Importance of Negative Prompts in Stable Diffusion

You can use negative prompts in Stable Diffusion for:

  • Refining Output: You can eliminate unwanted elements from the image by using negative prompts. They help you achieve a more precise output.
  • Creative Control: By using negative prompts, you have greater control over the creative process, ensuring that the generated image aligns with your vision.
  • Time Efficiency: By eliminating the need for extensive post-processing, negative prompts save time and effort.

How to Use Negative Prompts in MonsterAPI Dashboard?

Here are some steps to effectively use negative prompts in Stable Diffusion using the MonsterAPI dashboard

  1. Identify Unwanted Elements: Identify the elements that you want to exclude from your image and then you can clearly add in the negative prompts.
  2. Craft Negative Prompts: Create clear and concise prompts that specify what should be avoided. For example, "no animals" or "without text."

Here’s an example of the default negative prompt provided in MonsterAPI’s stable diffusion API:

Example of negative prompts

  1. Combine with Positive Prompts: Use negative prompts alongside positive prompts to guide Stable Diffusion to come up with the desired outcome. For example, "a serene beach at sunset" (positive) and "no people, no buildings" (negative).
  2. Iterate and Refine: Keep experimenting with negative and positive prompts to fine-tune the results and get exactly what you want.

Tips for Effective Negative Prompts

  1. Emphasize Negative Prompts: Let’s say you want an image of a highway, but you don’t want red cars in it. You can use the negative prompt “red car:1.3” to emphasize it’s 30% more important that there are no red cars in the image.
  2. Modify Images: If you’ve generated an image of a “red car” but want it to be less red, you can use “red:0.5” as your negative prompt. In the next iteration, you’d be able to make the car less red.
  3. Be Specific: The more specific your negative prompts are, the better the Stable Diffusion model can understand and execute them.
  4. Avoid Overloading: Make sure not to overdo too many negative prompts. You can confuse the model and lead to less efficient results. 
  5. Use Iteration: Don’t hesitate to iterate and refine your prompts based on the generated outputs. Sometimes minor adjustments can significantly improve the results.

Examples of Negative Prompts in Action

Example 1: Landscape without People

  • Positive Prompt: "A beautiful mountain landscape with a river"
  • Negative Prompt: "no people, no buildings"

Example 2: Winter Cityscape without Snowmen

  • Positive Prompt: "A winter cityscape with snow-covered streets and buildings"
  • Negative Prompt: "no snowmen, no holiday decorations”

Example 3: Urban Park without Water Bodies

  • Positive Prompt: "An urban park on a sunny day with families picnicking and children playing"
  • Negative Prompt: "no lakes, no ponds"

Example 4: A highway without red cars

  • Positive Prompt: “A huge 4-lane highway full of cars” 
  • Negative Prompt: “No red cars”

Example 5: Beach Scene without People

  • Positive Prompt: "A serene beach with clear blue water and golden sand"
  • Negative Prompt: "no people, no boats"

Example 6: Street Market without Vehicles

  • Positive Prompt: "A bustling street market with colorful stalls and shoppers"
  • Negative Prompt: "no vehicles, no bicycles"

Example 7: Dense Forest without Animals

  • Positive Prompt: "A dense forest with tall trees and a carpet of fallen leaves"
  • Negative Prompt: "no dear, no paths"

Example 8: Helicopter View of New York City

  • Positive Prompt: "A helicopter view of a sunny day in New York City"
  • Negative Prompt: "no lake, no sea view"

Example 9: Snowy Mountain without Trees

  • Positive Prompt: "A majestic snowy mountain under a clear blue sky"
  • Negative Prompt: "no clouds, no checkpoints

Example 10: Desert Scene without Cacti 

  • Positive Prompt: "A vast desert with golden sand dunes and a setting sun"
  • Negative Prompt: "no cacti, no animals"

Conclusion

Negative prompts are a powerful tool in Stable Diffusion, offering enhanced control and precision in image generation. By understanding and utilizing them effectively, you can steer the model away from unwanted elements and achieve images that closely align with your vision. 

Experiment with combinations of positive and negative prompts to unlock the full potential of Stable Diffusion in your creative projects.