Stable Diffusion is a powerful AI system for generating images from text prompts. The prompts provide a way for users to guide the AI in creating a desired image. Crafting an effective prompt is key to getting good results from Stable Diffusion. This article will provide examples of prompt commands and formatting that can help produce better quality and more consistent images.
Basic Prompt Structure
The basic structure of a Stable Diffusion prompt has three main parts:
- The subject and style
Here is an example prompt:
A majestic white Bengal tiger with blue eyes, digital art, intricate details, sharp focus, illustration by Greg Rutkowski and Alphonse Mucha
The first part specifies the subject (white Bengal tiger) and the style (digital art in the style of Rutkowski and Mucha). The second part adds modifiers like “intricate details” and “sharp focus” to refine the output. Finally, the parameters at the end control technical settings.
Using clear language and not overly long prompts tends to produce better results.
Subject and Style Cues
The subject and style form the core of what you want Stable Diffusion to generate.
- Use specific details when describing the subject, while keeping it simple
- Compare styles to well-known artists to approximate a desired aesthetic
- List multiple styles to blend elements from each
Here is an example:
An astronaut floating in space near a blue gas planet, trending on ArtStation, digital art by Asher Brown Durand and Thomas Cole
Modifiers are descriptive terms that provide more detail about an aspect of the image like the atmosphere, focus, lighting, etc.
Some common modifiers include:
- Intricate details
- Soft lighting
- Sharp focus
- Vibrant colors
- Dramatic perspective
- Painterly style
Modifiers help steer the AI’s image generation closer to what you imagine.
Here’s an example using modifiers:
An intricate royal gown made of silk and gold threads, elegant, highly detailed, by Angus McBride and Edmund Leighton
Parameters go at the end of the prompt and adjust technical settings of the generated image.
- Resolution (512×512, 1024×1024, etc.)
- Sampling method (Euler a, DPM++, DDIM, etc.)
- Steps (the number of diffusion steps)
- Model hash (the Stable Diffusion model to use)
Here is a prompt with parameters:
An astronaut floating near a blue gas planet, space scene, digital painting, artstation, square canvas, by Greg Rutkowski and Alphonse Mucha --ar 16:9 --testp
--ar 16:9 sets a widescreen 16:9 aspect ratio, while
--testp uses the Stable Diffusion test time model.
Parameters give you finer control over the technical aspects of the AI generation process.
Prompt Style and Tone
In addition to content, the style and tone used in a prompt can impact results.
- Use clear and simple language
- Active voice tends to work better than passive
- Avoid excessive adjectives and adverbs
- Use vocabulary fitting for the subject and style
- Write prompts conversationally as if giving instructions
Writing prompts conversationally in an active voice helps the AI understand the intent better.
Helpful Prompt Engineering Resources
- PromptHero – Search engine for prompts
- PromptMania – Prompt generator
- Stable Diffusion Notebook – Jupyter notebook for prompt testing
- Automatic1111 WebUI – Local Stable Diffusion interface
- Lexica – Dataset of prompts and images
These tools and datasets can help in constructing and refining prompts.
Crafting Stable Diffusion prompts is an art in itself. This article covered the basic structure and components of good prompts, along with tips for style, tone, and resources for further learning. With practice, you can learn to better control the AI image generation process through prompts to produce stunning images.
The key is to be descriptive yet simple, guide the AI towards key aspects, and refine prompts iteratively based on results.