Stable Diffusion is an AI system that generates images from text descriptions, known as “prompts”. Writing an effective prompt is key to producing high-quality AI art with Stable Diffusion. This article will provide guidance on crafting prompts specifically for Stable Diffusion.
What is a Stable Diffusion Prompt?
A Stable Diffusion prompt is a text description that guides the AI to generate a desired image. It specifies details about the subject, style, composition, and other qualities of the target image. Good prompts tend to be:
- Detailed and specific: Provide concrete descriptors like colors, textures, objects, etc.
- Clear and unambiguous: Use precise language that conveys your intent.
- Focused: Concentrate on the most important elements rather than listing many loosely related details.
Effective Stable Diffusion prompts generally follow this basic structure:
- Subject: The main focus of the image. For example, “a portrait of a woman”.
- Modifiers: Descriptors that provide more detail about the subject. “A portrait of a woman with red hair and green eyes“.
- Style/Medium: The artistic style or medium. “A portrait of a woman with red hair and green eyes, in oil paints“.
- Composition: How elements are arranged in the frame. “A portrait of a woman with red hair and green eyes, in oil paints, in a 3/4 profile view“.
- Background: Contextual elements around the subject. “A portrait of a woman with red hair and green eyes, in oil paints, in a 3/4 profile view, against a blue background“.
Additional elements like lighting, mood, etc. can also be specified. We’ll explore examples of full prompts later on.
Key Prompt Engineering Techniques
Here are some key techniques for engineering effective Stable Diffusion prompts:
Specify Desired Attributes
Clearly state the attributes you want the image to have:
An astronaut floating in space, wearing a white space suit and gold helmet
Use Adjectives and Descriptors
Include adjectives and descriptors to add detail:
A tall, muscular astronaut floating in space, wearing a crisp white space suit and shiny gold helmet
Set a Clear Context
Provide environmental and contextual details:
A tall, muscular astronaut floating above Earth, with the planet's landmasses clearly visible behind him
Define Styles and Mediums
Specify artistic styles and mediums:
A photorealistic oil painting of a tall, muscular astronaut floating above Earth
Give Composition Instructions
Guide the framing and composition:
A photorealistic oil painting of a tall, muscular astronaut floating above Earth, centered in the frame with the planet positioned below him
Compare attributes to well-known examples:
A photorealistic oil painting of a tall, muscular astronaut floating above Earth, his build similar to a competitive bodybuilder
Describe lighting, shadows, etc.:
A photorealistic oil painting of a tall, muscular astronaut floating above Earth, softly lit by sunlight from the left
Crafting Detailed Prompts
Putting together the techniques above, here is an example of a more detailed prompt:
A tall, clean-shaven male astronaut floating weightlessly high above Earth, wearing a bright white NASA space suit and reflective gold helmet, his muscular build similar to a competitive bodybuilder, arms outstretched, with the blue and green planet positioned below him to the right, softly lit from the upper left by warm sunlight creating soft shadows to the lower right, rendered as a photorealistic oil painting with visible brush strokes
This prompt guides the AI by setting a clear subject (astronaut), providing descriptive modifiers, establishing context (floating above Earth), specifying style (photorealistic oil painting), instructing on composition, dictating lighting/shadows, and comparing the subject’s physique to a bodybuilder as an example.
Useful Prompt Writing Tips
Here are some additional useful tips for writing Stable Diffusion prompts:
- Focus prompts on 1-2 main subjects rather than many loosely related elements
- Avoid prompts longer than 300-500 characters
- Use simple, clear language over complex vocabulary
- Specify a consistent light source when describing lighting
- Name a specific style or artist for clearer results
- Use comparisons to clarify your intent to the AI
- Iterate on prompts using different phrasing for better results
Here are some useful websites for exploring and generating Stable Diffusion prompts:
- Stable Diffusion Prompt Hero – Browse and search top community prompts
- Lexica Stable Diffusion Prompts – Generate prompts with an easy-to-use interface
- Nightcafe Creator – Create and share prompts and AI art
With an understanding of key techniques and by iterating on prompts, you can produce high-quality AI art with Stable Diffusion.