Files

289 lines
9.2 KiB
Markdown
Raw Permalink Normal View History

2026-01-08 09:34:22 +08:00
---
title: AI Prompt Engineering Tips - Image Generation
created: 2026-01-07
tags:
- ai
- prompts
- image-generation
- reference
source: https://github.com/ZeroLu/awesome-nanobanana-pro
---
# AI Image Generation Prompt Engineering Tips
A comprehensive guide to crafting effective prompts for AI image generation models (Nano Banana Pro/Gemini/Imagen 2).
## Core Principles
### 1. Be Specific and Detailed
- Use precise technical parameters rather than vague descriptions
- Specify exact camera models, lens types, and settings when relevant
- Include lighting direction, quality, and temperature
- Define exact aspect ratios and resolutions
### 2. Structure Your Prompts
Use clear sections for complex requests:
- **Subject** - What/who is in the image
- **Environment** - Setting, location, background
- **Lighting** - Type, direction, mood
- **Camera/Style** - Technical specs, artistic style
- **Details** - Textures, colors, specific elements
### 3. Reference Real-World Standards
- Mention specific film stocks (e.g., "Kodak Portra 400")
- Reference camera models (e.g., "Sony A7III with 85mm f/1.4")
- Cite artistic styles or movements
- Use professional terminology (bokeh, depth of field, golden hour)
## Technical Parameters
### Camera Settings
```
- Camera: [Model] (e.g., Canon EOS R5, Hasselblad H6D-100c)
- Lens: [Focal length] [Aperture] (e.g., 85mm f/1.4, 35mm f/2.8)
- Aperture: f/1.8 to f/5.6 (shallow DoF) or f/8+ (deep DoF)
- ISO: 100-400 (clean), 800-1600 (grainy/documentary)
- Shutter speed: 1/60s (standard), 1/125s+ (action)
```
### Lighting Specifications
```
- Type: Natural light, studio lighting, flash, ambient
- Direction: Key light, fill light, rim light, backlighting
- Quality: Soft/diffused vs. hard/direct
- Temperature: Warm (golden hour) vs. cool (blue hour)
- Time of day: Golden hour (sunset/sunrise), midday, blue hour
```
### Style References
```
- Photography eras: 1990s digital camera, 2000s flash, film aesthetic
- Film stocks: Kodak Portra 400, Kodak Ektar 100, Fuji Velvia
- Artistic styles: Cinematic, editorial, documentary, fashion
- Processing: Vintage grain, clean digital, film texture
```
## Consistency Techniques
### Face/Identity Preservation
```
Key phrases for maintaining facial features:
- "Keep the facial features of the person exactly consistent"
- "Preserve original face 100% accurate from reference image"
- "Do not change the face, maintain exact facial structure"
- "Face consistency: preserve_original: true"
```
### Texture Preservation
```
For maintaining surface textures:
- "Preserve the original fabric texture, color, and logos"
- "Maintain the aged, greasy, textured look"
- "Keep the same grain, focus depth, and lighting"
- "Match ambient lighting, color temperature, shadow direction"
```
## JSON Format for Complex Prompts
For multi-parameter requests, use structured JSON:
```json
{
"subject": {
"description": "Young woman...",
"age": "early 20s",
"expression": "confident and playful",
"hair": {
"color": "dark",
"style": "long, voluminous waves"
}
},
"photography": {
"camera_style": "early-2000s digital camera aesthetic",
"lighting": "harsh super-flash with bright highlights",
"angle": "mirror selfie",
"texture": "subtle grain, retro highlights"
},
"environment": {
"setting": "bedroom",
"elements": ["dresser", "posters", "vanity"]
}
}
```
## Category-Specific Tips
### Portrait Photography
```
- Specify lens compression (85mm for flattering portraits)
- Define depth of field (shallow for portraits, deeper for groups)
- Include catchlights in eyes
- Mention skin texture preference (natural pores vs. smooth)
- Specify makeup and styling details
```
### Product Photography
```
- Use "pure white background (RGB 255, 255, 255)"
- Specify "soft studio lighting, even illumination"
- Request "subtle contact shadow at base"
- Include "no harsh glare, photorealistic rendering"
- Define "high-resolution, 8k quality"
```
### Vintage/Retro Aesthetics
```
- Reference specific years (e.g., "early-2000s aesthetic")
- Mention "film grain, authentic texture"
- Include era-specific elements (fashion, technology, decor)
- Specify "flash photography" or "disposable camera look"
- Use "nostalgic, vintage color grading"
```
### 3D/Isometric Renders
```
- Specify "Cinema 4D rendering" or "3D isometric view"
- Include "soft studio lighting, clean materials"
- Define "miniature diorama style" or "architectural visualization"
- Mention "rounded forms, pastel colors" for cute aesthetics
- Request "blind-box toy aesthetic" for collectible styles
```
## Advanced Techniques
### Multi-Image Consistency
For generating multiple related images:
```
"Create [number] images with:
- Same subject with exact facial features preserved
- Same lighting setup and color grading
- Same environment and props
- Different poses/angles only
- Maintain consistent wardrobe and styling"
```
### Image-to-Image Translation
```
"Transform the uploaded image by:
- Preserving [specific elements]: face, pose, composition
- Changing [target elements]: background, lighting, style
- Maintaining [technical aspects]: resolution, aspect ratio
- Matching [aesthetic]: color palette, mood, era"
```
### Text Integration
```
For adding text to images:
- "Overlay text in [font style]: bold, serif, handwritten"
- "Place text at [location] with [color] and [effects]"
- "Ensure perfect spelling and centered alignment"
- "Use drop shadow and outline for readability"
- "Integrate text naturally into image depth of field"
```
### Background Manipulation
```
Removal: "Remove all people/objects in background, fill with..."
Extension: "Expand to 16:9, extend scenery naturally on both sides"
Replacement: "Replace background with [description] while preserving subject"
Context-aware: "Match original lighting, weather, and texture perfectly"
```
## Common Pitfalls to Avoid
### ❌ Vague Descriptions
- ❌ "Make it look nice"
- ✅ "Soft diffused natural lighting, shallow depth of field, warm color grading"
### ❌ Missing Technical Context
- ❌ "A portrait photo"
- ✅ "Professional headshot, Sony A7III, 85mm f/1.8, three-point lighting"
### ❌ Ignoring Consistency
- ❌ "Multiple photos of the same person"
- ✅ "Same person, exact facial features preserved, different poses only"
### ❌ Unclear Hierarchy
- ❌ Long paragraph with everything mixed together
- ✅ Structured sections: Subject → Environment → Style → Technical specs
## Workflow Strategies
### 1. Start Broad, Then Refine
```
First pass: "Portrait of a young woman, outdoor setting"
Refined: "Portrait of a young woman, 85mm lens, shallow DoF,
golden hour lighting, urban park background, soft focus bokeh"
```
### 2. Use Reference Layering
```
Base: "Fashion photography"
+ Style: "in the style of Annie Leibovitz"
+ Technical: "shot on Hasselblad H6D, 120mm macro lens"
+ Mood: "editorial, high-fashion, dramatic lighting"
```
### 3. Build Template Libraries
Create reusable templates for common needs:
- Professional headshots
- Product photography
- Social media content
- Vintage aesthetics
- 3D renders
## Negative Prompts
What to exclude (if supported):
```
Common negatives:
- "no distorted faces, no extra limbs"
- "no blurry, no low quality, no artifacts"
- "no watermarks, no text overlays"
- "no unrealistic proportions"
- "no modern elements" (for vintage styles)
```
## Quality Indicators
Add these for best results:
```
- "8K resolution, ultra-detailed"
- "Photorealistic, high-fidelity"
- "Professional photography, award-winning"
- "Sharp focus, crisp details"
- "Cinema-quality rendering"
```
## Quick Reference Cheat Sheet
### Portrait
`[Subject] | [Age/gender] | [Expression] | [Camera: 85mm f/1.8] | [Lighting: soft natural] | [Background: blurred] | [Style: editorial] | [Quality: 8K]`
### Product
`[Product] | [Angle: 3/4 view] | [Background: pure white] | [Lighting: soft studio] | [Shadow: subtle contact] | [Quality: photorealistic, high-res]`
### Vintage
`[Subject] | [Era: 1990s/2000s] | [Camera: disposable/digital] | [Flash: direct] | [Grain: authentic] | [Style: nostalgic] | [Colors: slightly faded]`
### 3D Render
`[Subject] | [Style: isometric/chibi] | [Render: C4D] | [Lighting: soft studio] | [Materials: pastel, glossy] | [Background: solid color] | [Aesthetic: cute, minimalist]`
## Resources
- **Official Guide**: [Google Prompting Tips](https://blog.google/products/gemini/prompting-tips-nano-banana-pro/)
- **Advanced Guide**: [How to prompt Nano Banana Pro](https://www.fofr.ai/nano-banana-pro-guide)
- **Source Repository**: [[ZeroLuawesome-nanobanana-pro 🚀 An awesome list of curated Nano Banana pro prompts and examples. Your go-to resource for mastering prompt engineering and exploring the creative potential of the Nano banana pro(Nano banana 2) AI image model.|awesome-nanobanana-pro]]
## Practice Exercises
1. **Upgrade a basic prompt**: Transform "photo of a cat" into a detailed, technical prompt
2. **Style transfer**: Take a prompt and adapt it for different eras (1980s → 2000s → modern)
3. **Multi-parameter challenge**: Create a JSON prompt with 5+ nested parameters
4. **Consistency test**: Write prompts for 3 related images maintaining exact subject consistency
---
*Last updated: 2026-01-07*
*Source material: awesome-nanobanana-pro GitHub repository*