0
0
GenaiHow-ToBeginner · 3 min read

How to Write Effective Prompts for Stable Diffusion

To write a prompt for Stable Diffusion, describe the desired image clearly using simple, specific words including style, subject, and details. Use positive keywords for what you want and negative keywords to avoid unwanted elements.
📐

Syntax

A Stable Diffusion prompt typically consists of a clear description of the image you want, including the subject, style, colors, and details. You can also add negative prompts to specify what you do not want in the image.

Basic syntax parts:

  • Subject: What is in the image (e.g., "a cat sitting on a chair")
  • Style: Artistic style or mood (e.g., "watercolor", "photorealistic")
  • Details: Extra features like colors, lighting, background (e.g., "bright colors", "sunset background")
  • Negative prompt: Words to exclude (e.g., "no text", "no blur")
python
prompt = "a beautiful landscape, sunset, vibrant colors, photorealistic"
negative_prompt = "no people, no text"
💻

Example

This example shows how to write a prompt and negative prompt for Stable Diffusion to generate an image of a fantasy castle in a colorful style without any text or blur.

python
prompt = "a fantasy castle on a hill, colorful, detailed, digital art"
negative_prompt = "no text, no blur"

print(f"Prompt: {prompt}")
print(f"Negative Prompt: {negative_prompt}")
Output
Prompt: a fantasy castle on a hill, colorful, detailed, digital art Negative Prompt: no text, no blur
⚠️

Common Pitfalls

Common mistakes when writing prompts for Stable Diffusion include:

  • Being too vague or short, which leads to unclear or generic images.
  • Using contradictory or confusing words that confuse the model.
  • Not using negative prompts to remove unwanted elements like text or watermarks.
  • Overloading the prompt with too many unrelated details.

Always keep prompts clear, focused, and balanced.

python
wrong_prompt = "castle, nice, stuff"
right_prompt = "a detailed fantasy castle on a hill, colorful, digital art"

wrong_negative = ""
right_negative = "no text, no watermark"
📊

Quick Reference

Prompt PartDescriptionExample
SubjectMain object or scenea red fox in the forest
StyleArtistic style or moodoil painting, photorealistic
DetailsColors, lighting, backgroundsunset, vibrant colors, soft light
Negative PromptWhat to excludeno text, no people, no blur

Key Takeaways

Write clear and specific descriptions for the image you want.
Include style and detail keywords to guide the image look.
Use negative prompts to avoid unwanted elements like text or blur.
Avoid vague or contradictory words to get better results.
Keep prompts balanced and focused for best image quality.