| name | generate-image |
| description | Generate images using nano-banana-2 MCP tools with best-practice prompting. Use this skill when the user asks to create, generate, or edit images. |
| allowed-tools | mcp__nano-banana-2__generate_image, mcp__nano-banana-2__edit_image, mcp__nano-banana-2__continue_editing, mcp__nano-banana-2__get_configuration_status, mcp__nano-banana-2__get_last_image_info |
Image Generation with Nano Banana 2
Use the generate_image, edit_image, and continue_editing MCP tools from the nano-banana-2 server.
First-Time Setup
Before generating images, verify the API key is configured:
- Call
get_configuration_status to check if GEMINI_API_KEY is set.
- If the key is missing, instruct the user to add it to their MCP server environment configuration:
- In Claude Code settings or
.claude/settings.json, add GEMINI_API_KEY to the server's env block.
- The key can be obtained from Google AI Studio.
Prompting Best Practices
Write narrative paragraphs, NOT comma-separated keyword lists. Narrative prompts achieve ~94% coherence vs ~61% for keyword lists.
- Start with image type: "Create an educational diagram showing...", "Generate a photorealistic photograph of...", "Design a flat-style icon depicting..."
- Keep text in images short (<25 characters). Quote text exactly and describe font style.
- Specify layout explicitly: side-by-side, top-to-bottom steps, centered with border, etc.
- Skip quality boosters like "4k masterpiece", "highly detailed", "award-winning" — they add noise, not quality.
- Be specific about what you want, not what you don't want. Positive descriptions work better than negations.
Defaults
- resolution:
"1K" — good balance of quality and speed. Use "2K" or "4K" for print or detail-heavy images.
- aspectRatio:
"1:1" — change to "16:9" for landscapes/banners, "9:16" for mobile/portrait.
- thinking:
"minimal" — use "high" for complex scenes with spatial relationships or text rendering.
- returnInlineImage: Consider setting to
false in Claude Code to avoid context window overflow. The image is still saved to disk and can be viewed by the user.
- outputMimeType:
"image/png" for quality, "image/jpeg" for smaller files.
- numberOfImages:
1 — use 2-4 when exploring variations.
Workflow
- Generate: Use
generate_image with a well-crafted narrative prompt.
- Review: Check the saved file path in the response.
- Refine: Use
continue_editing to make adjustments. Be specific about what to change.
- Iterate: Each
continue_editing call builds on the previous result.
Style Guidance
- Diagrams: Specify colors, label positions, arrow directions. Use
thinking: "high" for complex layouts.
- Illustrations: Describe art style (flat, watercolor, line art), mood, and lighting.
- Infographics: Use numbered lists cautiously (>8 sequential items are unreliable). Numbers-only approach works best for long lists.
- Photos: Describe camera angle, lighting conditions, depth of field, and subject positioning.
Context Window Management
When generating images in Claude Code, set returnInlineImage: false to prevent base64 image data from filling the context window. The image is still saved to disk — just tell the user where to find it.