Stable Diffusion Prompt Engineering

As an AI artist and prompt engineer, I’ve spent countless hours experimenting with Stable Diffusion to create stunning AI-generated art. Over time, I’ve learned what makes an effective prompt that can unlock this model’s full potential. In this article, I’ll share my best practices and examples for crafting prompts that help Stable Diffusion generate images that match your creative vision.

The Anatomy of a Great Prompt

A good Stable Diffusion prompt has a few key components:

Clear Problem Statement

First, clearly state the problem you want Stable Diffusion to solve in 1-2 sentences. Be as specific as possible about the subject matter, style, composition, etc.

Example: A close-up portrait painting of a girl with red hair in an anime art style with a soft smile on her face.

Style Cues

Next, provide some style cues by mentioning specific artists, art movements, medium (painting, drawing, 3D render, etc.), or adjectives that describe the aesthetic you’re going for.

Example: oil painting by Alphonse Mucha and Gustav Klimt, art nouveau style, elegant, intricate details

Composition and Context

Give some compositional guidance like orientation, framing, background, other elements, and their relationship to the main subject. Establish the context if needed.

Example: Vertical composition, the girl is the main focus framed closely with some nature elements like flowers and leaves in the soft blurred background.

Advanced Prompting Techniques

Here are some key techniques I use to further improve my prompts:

Negative Prompts

Add “negative prompts” with - prefix to exclude unwanted elements from the final image. For example, -text, -watermark, -worst quality, -low quality.

Sampling Methods

Specify a sampler like CFG scale: 7 for better coherence, or DDIM if you want more variety.

Seed

Fix the seed number if you want Stable Diffusion to generate the same image again.

Resolution

Indicate output resolution like 1024x1024.

Here’s an example prompt putting together all these elements:

A close-up portrait painting by Alphonse Mucha and Gustav Klimt of an anime girl with long flowing red hair, soft smile on her face, emerald green eyes, elegant floral headpiece. Vertical composition, the girl is the main focus framed closely with some nature elements like flowers and leaves in the soft blurred background. Oil painting, art nouveau style, elegant, intricate details, - text, -watermark, -worst quality, -low quality. CFG scale: 7, 1024x1024

Prompt Iteration is Key

The key to success with Stable Diffusion is iterating prompts systematically while evaluating the output. Start general and then add details incrementally in each test. Observe what works, keep the good parts, remove the bad parts, and refine the prompts through multiple iterations.

It’s an art that takes intuition, imagination, and persistence to master. But with enough practice, you’ll be able to use prompts to translate your wildest creative visions into gorgeous AI artworks!

Useful Websites for Stable Diffusion Prompts

Here are some of my favorite sites for getting Stable Diffusion prompt ideas and inspiration:

The key is to learn from what others have tried and make prompts your own through customization and experimentation.

I hope you found these Stable Diffusion prompt examples and tips useful! Let me know if you have any other questions. Now go unleash your creativity with AI!