Prompt Engineering Codex Β· CH 15

Chapter 15: Image Generation Prompt Engineering

⏱️ 4 min read·Updated Jul 2026

The Visual Prompt Is Different

Text-to-text prompting benefits from explicit, structured, logical instructions. Text-to-image prompting works differently: the models are trained on image-caption pairs, not instruction-following data. They respond to descriptive, compositional language β€” not logical commands.

The fundamental mindset shift: you are describing an image that already exists (the desired output), not instructing someone how to create it.

---

The Image Prompt Anatomy

The most effective image prompts follow a consistent structure:

code
[SUBJECT] + [ACTION/POSE] + [SETTING/ENVIRONMENT] + [LIGHTING] + [STYLE/MEDIUM] + [TECHNICAL SPECS] + [QUALITY MODIFIERS]

Weak prompt:

code
a person sitting in a coffee shop

Strong prompt:

code
A young woman in her late 20s with dark hair tied back, wearing a cream linen blazer, seated at a small round marble table in a sunlit Parisian cafe, working on a laptop, soft afternoon golden hour light streaming through large arched windows, warm shallow depth of field, lifestyle photography style, shot on Sony A7IV 85mm f/1.4, muted warm tones, editorial quality

The strong prompt specifies: who (young woman, specific appearance), what (working on laptop), where (Parisian cafe, marble table), lighting (golden hour, large windows), camera (Sony A7IV, 85mm f/1.4), and aesthetic (lifestyle photography, editorial quality).

---

The 7 Prompt Elements in Depth

1. Subject Specificity

The more specific your subject description, the more control you have.

code
VAGUE: "a dog"
SPECIFIC: "a young golden retriever with a muddy paw, wet fur, and an expression of guilty excitement"

VAGUE: "a building"
SPECIFIC: "a brutalist concrete office tower from the 1970s, weathered facade with geometric window patterns, overgrown with ivy at the base"

2. Lighting (The Most Underused Element)

Lighting transforms the mood of an image more than almost any other element.

Lighting TypeEffectWhen to Use
Golden hourWarm, flattering, cinematicPortraits, outdoor scenes
Blue hourCool, moody, melancholicUrban, atmospheric
Rembrandt lightingDramatic triangle shadow on cheekSerious portraits
Flat lightingEven, minimalistProduct photography, editorial
Backlit / rim lightSilhouette, glow effectDramatic subjects

| Neon / bioluminescent | Vivid, cyberpunk, fantastical | Sci-fi, night scenes | | Chiaroscuro | Strong shadows, painterly | Dramatic, classical art feel |

3. Style and Medium

Style keywords activate specific aesthetic regions in the model's training:

code
Photography: "35mm film photograph", "Kodachrome", "Polaroid", "daguerreotype", "medium format"
Fine art: "oil painting in the style of Vermeer", "watercolour illustration", "charcoal sketch"
Digital art: "concept art", "matte painting", "digital illustration", "3D render"
Specific aesthetics: "maximalist baroque", "wabi-sabi", "brutalist", "cottagecore", "solarpunk"

4. Camera and Lens (For Photographic Styles)

code
Wide: "shot on 24mm f/2.8, environmental portrait, subject small in large context"
Compressed: "shot on 200mm telephoto, background compressed and blurred, subject isolated"
Macro: "extreme macro shot, 1:1 magnification, razor-thin depth of field"
Aerial: "drone photography, DJI Mavic, bird's eye view, geometric patterns"

5. Color Palette

code
"Muted desaturated earth tones" β€” grounding, natural, serious
"High-contrast black and white" β€” timeless, dramatic, editorial
"Pastel candy colors" β€” playful, light, approachable
"Monochromatic teal" β€” focused, cool, tech-forward
"Warm amber and ivory" β€” nostalgic, comforting, film-like

6. Quality and Technical Modifiers

code
"hyperdetailed", "photorealistic", "8K", "award-winning photography",
"trending on Artstation", "cinematic", "professional photography",
"masterpiece", "highly detailed", "sharp focus", "perfect composition"

---

Negative Prompts (For Models That Support Them)

Stable Diffusion and Flux support negative prompts β€” descriptions of what you do not want:

code
Negative prompt:
blurry, low quality, distorted faces, extra limbs, watermark, text, logo,
oversaturated, cartoon, anime, painting (if you want photorealism),
cropped, out of frame, ugly, duplicate, morbid, mutilated, poorly drawn

For Midjourney, use the --no modifier: --no text, watermarks, logos

---

The Iteration Protocol

Image generation is inherently iterative. Use this protocol:

Round 1: Generate with your core prompt (subject + setting + lighting). Pick the best 1-2 outputs.

Round 2: Add style and technical modifiers. Generate again from the best Round 1 outputs.

Round 3: Fix specific issues. Add negative prompts for things that appear that you do not want.

Round 4: Use img2img or inpainting to fix small issues without regenerating the whole image.

---

UI/App Asset Prompting

For generating UI screenshots, app mockups, and product assets:

code
A high-resolution screenshot of a modern dark-mode SaaS dashboard, minimal and clean interface,
showing analytics graphs with vibrant accent colors (purple and cyan), card-based layout,
data visualisations with subtle glow effects, glass morphism sidebar,
professional UI design, Figma mockup quality, 2560x1600 resolution,
no watermarks, no lorem ipsum text, realistic data in charts

Finished reading this chapter?

Mark it completed to update your AI Builder skill profile score on your dashboard.

πŸ“‹

Download Printable Chapter Checklist

Get a print-friendly, formatted checklist of workspace actions to apply this chapter offline.