AgentSkillsCN

ai-image-generation

以最优质量执行AI图像生成。适用于需要通过Replicate API生成图像时使用。触发条件:生成图像、创建视觉内容、产品拍摄。输出生成的图像以供反馈和迭代。

SKILL.md
--- frontmatter
name: ai-image-generation
description: "Execute AI image generation with optimal quality. Use when you need to generate images via Replicate API. Triggers on: generate image, create visual, product shot. Outputs generated images for feedback and iteration."

AI Image Generation

This is the core execution skill for AI image generation. It handles the actual generation work — model selection, prompt construction, API calls, iteration, and quality verification.

Use this skill when: You need to generate any image and want optimal quality. Route here from: ai-creative-workflow, ai-creative-strategist, or direct requests.


Why This Skill Exists

The problem: Most people waste time and money on AI image generation because they:

  1. Use the wrong model for the job
  2. Write vague prompts that produce generic results
  3. Generate once and hope for the best
  4. Don't know how to iterate effectively

The solution: A systematic approach that:

  • Uses the right model (Nano Banana Pro via Glif for speed + quality)
  • Constructs prompts with proven structure
  • Builds in iteration as the default workflow
  • Knows when to stop and when to keep refining

Model Selection

Primary: Nano Banana Pro via Glif (DEFAULT)

Why: Fastest high-quality generation available. ~20 seconds vs ~3 minutes for comparable quality.

ModelGlif IDSpeedQuality
🍌 Nano Banana Pro Text 2 Imagecmi7ne4p40000kz04yup2nxgh~20secExcellent

Use the run_glif MCP tool:

code
Glif: 🍌 Nano Banana Pro Text 2 Image
ID: cmi7ne4p40000kz04yup2nxgh
Inputs: ["Your prompt here"]

Do NOT use: imagen-3, DALL-E, Flux, or direct Replicate API calls unless specifically requested.


When to Use Alternatives

code
IF user specifically requests a different model:
    use requested model

ELIF need text rendering (logos, quotes, announcements):
    use Recraft v3 or Ideogram v3 (route to ai-typography)

ELIF need image-to-video:
    generate image first, then route to ai-video-generation

ELIF need people/lifestyle imagery:
    still use Nano Banana Pro (handles people well)

ELSE:
    Nano Banana Pro via Glif  // DEFAULT

Prompt Construction

The Formula

code
[SUBJECT] + [SETTING/CONTEXT] + [STYLE] + [LIGHTING] + [QUALITY BOOSTERS]

Each element serves a purpose:

  • SUBJECT — What you're generating (be specific)
  • SETTING — Where/context (grounds the image)
  • STYLE — Visual aesthetic (photography, illustration, etc.)
  • LIGHTING — Mood and dimension (often overlooked, always important)
  • QUALITY BOOSTERS — Technical terms that elevate output

Subject Specificity

Bad: "A coffee cup" Good: "Artisan ceramic coffee cup with latte art, steam rising"

Bad: "A laptop" Good: "Silver MacBook Pro on oak desk, screen showing code editor"

Bad: "A person working" Good: "Woman in her 30s, focused expression, typing on laptop in bright modern office"

The more specific your subject, the less the model has to guess.


Setting/Context Options

Studio/Clean:

code
on pure white background
against dark charcoal gradient
floating in negative space
on seamless backdrop

Environmental:

code
in modern minimalist office
on rustic wooden table
in cozy coffee shop
against urban cityscape

Abstract:

code
with geometric patterns
surrounded by abstract shapes
with dynamic particle effects
in surreal dreamscape

Style Presets

Photography Styles:

code
professional product photography
lifestyle photography
editorial fashion photography
documentary photography style
portrait photography
macro photography
aerial/drone photography

Illustration Styles:

code
digital illustration
watercolor illustration
vector art style
hand-drawn sketch style
3D rendered
isometric illustration
flat design

Artistic Styles:

code
cinematic
surrealist
minimalist
maximalist
retro/vintage
futuristic
organic/natural

Lighting Presets

Lighting is the most underused prompt element. It dramatically affects mood and quality.

Studio Lighting:

code
professional studio lighting
three-point lighting setup
single dramatic spotlight
soft diffused lighting
rim lighting

Natural Lighting:

code
soft natural daylight
golden hour light
overcast diffused light
harsh midday sun
blue hour

Dramatic Lighting:

code
high contrast dramatic lighting
moody low-key lighting
backlit silhouette
chiaroscuro lighting
neon accent lighting

Specific Directions:

code
key light from upper left
side lighting from right
overhead soft box
underlighting (dramatic)

Quality Boosters

Add these to elevate output quality:

Technical Quality:

code
ultra-detailed
high resolution
sharp focus
professional quality
8k resolution

Professional Context:

code
commercial photography
award-winning
magazine quality
advertising campaign
editorial quality

Specific Techniques:

code
shallow depth of field
bokeh background
lens flare
motion blur
long exposure

Complete Prompt Examples

Product Hero Shot

code
Premium wireless headphones floating against dark charcoal gradient,
professional product photography, single dramatic spotlight from upper left,
subtle rim lighting on edges, metallic surface reflections,
ultra-detailed, commercial advertising quality, negative space on right for text

Lifestyle Scene

code
Young professional woman enjoying morning coffee in bright modern apartment,
natural window light streaming in, cozy weekend aesthetic,
lifestyle photography, warm tones, genuine relaxed expression,
shallow depth of field, editorial quality

Food Photography

code
Gourmet burger with melted cheese and fresh vegetables on rustic wooden board,
professional food photography, soft diffused overhead lighting,
steam rising, appetizing presentation, shallow depth of field,
restaurant menu quality, warm inviting tones

Tech/SaaS

code
Modern dashboard interface on large monitor in minimalist home office,
clean UI design visible on screen, soft ambient lighting,
tech product photography, contemporary workspace aesthetic,
shallow depth of field on screen, professional quality

Abstract/Conceptual

code
Abstract representation of data flow and connectivity,
glowing particles forming network patterns against deep blue gradient,
futuristic technology aesthetic, dynamic motion blur,
cinematic quality, vibrant cyan and purple accent colors

Aspect Ratio Guide

Use CaseRatioPixelsNotes
Square (Instagram, LinkedIn)1:11024×1024Most versatile
Landscape (Hero banners, YouTube)16:91280×720Web standard
Portrait tall (Instagram feed)4:51024×1280Better feed presence
Stories/TikTok9:161080×1920Vertical mobile
Pinterest2:31000×1500Optimal for pins
Wide cinematic21:92560×1080Dramatic headers

Default: 1:1 unless platform-specific requirement is known.


Execution Workflow

Step 1: Clarify Requirements

Before generating, know:

code
□ What is the subject? (be specific)
□ What style/aesthetic?
□ What platform/use case?
□ What aspect ratio?
□ Any must-have elements?
□ Any must-avoid elements?

Step 2: Construct Prompt

Use the formula:

code
[SUBJECT] + [SETTING] + [STYLE] + [LIGHTING] + [QUALITY BOOSTERS]

Step 3: Generate First Draft

code
Glif: 🍌 Nano Banana Pro Text 2 Image
ID: cmi7ne4p40000kz04yup2nxgh
Inputs: ["[constructed prompt]"]

Step 4: Present for Feedback

markdown
## Image Generated

**Prompt:** [prompt used]
**Aspect Ratio:** [ratio]

**Image URL:** [URL]

**Quick Assessment:**
- Subject accuracy: ✓/✗
- Style match: ✓/✗
- Composition: ✓/✗
- Quality: ✓/✗

**Feedback?**
- What works?
- What should change?
- Ready to approve or iterate?

Step 5: Iterate Based on Feedback

Common iteration patterns:

code
"Too dark" → Add "bright" "well-lit" "high key lighting"
"Too busy" → Add "minimal" "clean" "simple composition"
"Wrong style" → Be more explicit about style reference
"Missing element" → Add specific element to prompt
"Wrong mood" → Adjust lighting and color descriptors

Step 6: Approve or Continue

  • If approved → Deliver final image
  • If needs changes → Return to Step 5
  • If fundamentally wrong → Return to Step 2 with new prompt approach

Iteration Strategies

When It's Close But Not Right

Problem: Almost right but something's off Strategy: Make targeted prompt adjustments

code
Original: "Coffee cup on table"
Iteration 1: "Coffee cup on table, warmer tones" (if too cool)
Iteration 2: "Coffee cup on table, warmer tones, more steam" (if missing element)

When It's Completely Wrong

Problem: Output doesn't match intent at all Strategy: Rewrite prompt from scratch with more specificity

Don't iterate on a bad foundation. Start fresh with better prompt construction.

When Quality Is Low

Problem: Image looks AI-generated or low quality Strategy: Add quality boosters and professional context

code
Add: "ultra-detailed, professional photography, commercial quality"
Add: "8k resolution, sharp focus, magazine quality"

When Composition Is Wrong

Problem: Elements in wrong places, bad framing Strategy: Be explicit about composition

code
Add: "subject centered in frame"
Add: "negative space on left for text"
Add: "rule of thirds composition"
Add: "close-up shot" or "wide establishing shot"

Quality Checklist

Before delivering, verify:

Technical Quality

  • Resolution is sufficient for intended use
  • No obvious AI artifacts (weird fingers, melted text, etc.)
  • Sharp focus on main subject
  • Appropriate for intended platform

Compositional Quality

  • Subject is clear and prominent
  • Composition supports intended use (text space if needed)
  • Lighting creates appropriate mood
  • Colors are cohesive

Brief Alignment

  • Matches requested subject
  • Matches requested style
  • Matches requested mood/tone
  • Usable for intended platform

Common Issues & Solutions

IssueCauseSolution
Generic/stock photo feelVague promptAdd specific details, unique elements
Wrong styleStyle not specifiedBe explicit: "product photography style" not just "photo"
Poor lightingNo lighting directionAdd specific lighting: "dramatic spotlight from upper left"
Cluttered compositionToo many elementsAdd "minimal" "clean" "simple composition"
AI artifactsModel limitationsRegenerate, or note area to avoid
Wrong aspect ratioDefault usedSpecify ratio in request
Doesn't match brandNo style referenceAdd brand color/style keywords
Text rendering issuesWrong modelRoute to ai-typography for text-heavy graphics

Output Format

Standard Output

markdown
## Image Generated

**Subject:** [what was generated]
**Style:** [style used]
**Aspect Ratio:** [ratio]

**Image URL:** [URL]

**Prompt Used:**
> [full prompt for reference]

**Quality Check:**
- ✓ Subject accurate
- ✓ Style matches
- ✓ Composition works
- ✓ Quality sufficient

**Options:**
- [ ] Approve and use
- [ ] Iterate (specify changes)
- [ ] Generate variant
- [ ] Try different approach

With Iteration Context

markdown
## Image Generated (Iteration 2)

**Changes from v1:** [what changed]
**Image URL:** [URL]

**Comparison:**
- v1: [issue]
- v2: [improvement]

**Feedback needed?**

Handoff Protocols

Receiving from ai-creative-workflow

yaml
Receive:
  subject: "[what to generate]"
  style: "[aesthetic direction]"
  platform: "[intended use]"
  aspect_ratio: "[ratio]"
  constraints: "[any limitations]"

Returning to Workflow

yaml
Return:
  status: "complete" | "needs_iteration" | "needs_different_approach"
  deliverables:
    - url: "[image URL]"
      aspect_ratio: "[ratio]"
      prompt_used: "[prompt]"
  feedback_needed: "[any questions]"

Routing to Video

yaml
Route to ai-video-generation:
  image_url: "[approved image URL]"
  aspect_ratio: "[ratio]"
  animation_intent: "[what motion is needed]"

Integration with Creative Pipeline

code
IMAGE GENERATION PIPELINE

┌─────────────────────────────────────────┐
│  Request arrives (direct or routed)     │
│  → Clarify requirements                 │
│  → Construct prompt                     │
└─────────────────────────────────────────┘
                    │
                    ▼
┌─────────────────────────────────────────┐
│  ai-image-generation (THIS SKILL)       │
│  → Generate with Nano Banana Pro/Glif   │
│  → Present for feedback                 │
│  → Iterate as needed                    │
│  → Quality check                        │
└─────────────────────────────────────────┘
                    │
        ┌───────────┴───────────┐
        ▼                       ▼
┌──────────────────┐   ┌──────────────────┐
│  Static Delivery │   │  Route to Video  │
│  → Final image   │   │  → ai-video-     │
│    delivered     │   │    generation    │
└──────────────────┘   └──────────────────┘

Speed vs Quality Decision

code
QUICK DRAFT (concept testing):
    → Nano Banana Pro via Glif (~20 sec)
    → Good enough to evaluate concept
    → Iterate quickly

PRODUCTION QUALITY (final delivery):
    → Nano Banana Pro via Glif (~20 sec)
    → Already production quality
    → Most cases don't need more

MAXIMUM QUALITY (premium needs):
    → Direct Replicate API call to specialized model
    → Only if Glif output insufficient
    → Rare — Nano Banana Pro handles most needs

Default to Glif. It's fast AND high quality. Only go elsewhere if specific need arises.


Tips from Experience

What Works

  1. Specificity beats creativity — "Red 2024 Tesla Model 3" beats "cool car"
  2. Lighting is underrated — Always specify lighting direction/type
  3. Negative space matters — Mention if you need room for text
  4. Iterate fast — Don't overthink first prompt, generate and refine
  5. Quality boosters work — "Professional photography, ultra-detailed" actually helps

What Doesn't Work

  1. Vague prompts — "Something cool" produces nothing useful
  2. Too many elements — Keep focused, don't cram everything in
  3. Ignoring aspect ratio — Always match to intended platform
  4. Single generation — Plan for iteration, don't expect perfection first try
  5. Wrong model for text — Nano Banana Pro struggles with text rendering

The 80/20

80% of good results come from:

  1. Specific subject description
  2. Clear style direction
  3. Explicit lighting
  4. Appropriate aspect ratio

Get these four right, and you'll get good results.