From manage-nano-banana
Generate and edit images, create diagrams, infographics, and visualizations using Google's Nano Banana API (Gemini Image Generation). Use when the user asks to create images, edit existing images, generate architecture diagrams, flowcharts, ERDs, timelines, or any visual artifacts.
npx claudepluginhub weirdapps/integrations-marketplace --plugin manage-nano-bananaThis skill uses the workspace's default tool permissions.
> **Path Convention**: All paths in this document are relative to this skill's root directory. When executing commands, first `cd` to the skill directory or adjust paths accordingly.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Enable Claude Code to create, edit, and generate visual content using Google's Nano Banana API. This skill provides prebuilt TypeScript tools to avoid code duplication and ensure consistent image generation across tasks. **API Authentication**: Uses the `GEMINI_API_KEY` environment variable.Path Convention: All paths in this document are relative to this skill's root directory. When executing commands, first
cdto the skill directory or adjust paths accordingly.
Available Models:
gemini-2.5-flash-image - Fast, efficient, ~$0.039/image, 1K resolutiongemini-3-pro-image-preview - High quality, up to 4K, advanced text rendering, up to 14 reference imagesAspect Ratios: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Resolutions: 1K (both models), 2K, 4K (Pro only)
<quick_start>
Setup: Ensure GEMINI_API_KEY is set in environment and install dependencies:
cd ./tools
npm install
Generate an image:
npx tsx ./tools/generate-image.ts \
--prompt "A watercolor painting of a fox in a snowy forest" \
--output ./fox.png
Edit an existing image:
npx tsx ./tools/edit-image.ts \
--input ./photo.png \
--prompt "Change the blue car to red" \
--output ./photo-edited.png
Generate a diagram:
npx tsx ./tools/generate-diagram.ts \
--type architecture \
--prompt "Microservices architecture with API Gateway, User Service, and Database" \
--output ./architecture.png
</quick_start>
**Text-to-Image Generation**Use generate-image.ts for creating images from text descriptions.
npx tsx ./tools/generate-image.ts \
--prompt "Your detailed prompt here" \
--output ./output.png \
--model gemini-2.5-flash-image \
--aspect-ratio 16:9 \
--resolution 1K
Options:
--prompt (required): Text description of the image--output (required): Output file path--model: gemini-2.5-flash-image (default) or gemini-3-pro-image-preview--aspect-ratio: Any supported ratio (default: 1:1)--resolution: 1K (default), 2K, or 4K (Pro model only)
</image_generation><image_editing> Image Editing (Inpainting)
Use edit-image.ts for modifying specific elements in existing images.
npx tsx ./tools/edit-image.ts \
--input ./source.png \
--prompt "Change the sofa to a brown leather chesterfield" \
--output ./edited.png \
--model gemini-2.5-flash-image
Options:
--input (required): Source image path--prompt (required): Editing instructions--output (required): Output file path--model: Model to use (default: gemini-2.5-flash-image)Best Practices:
<diagram_generation> Diagram and Visualization Generation
Use generate-diagram.ts for creating technical diagrams, infographics, and visualizations.
npx tsx ./tools/generate-diagram.ts \
--type flowchart \
--prompt "Authentication flow with 2FA" \
--output ./auth-flow.png \
--aspect-ratio 3:4 \
--resolution 2K
Diagram Types (--type):
architecture - System architecture diagramsflowchart - Process flowcharts and decision treeserd - Entity-relationship diagramssequence - Sequence diagramstimeline - Timeline visualizationsinfographic - Infographics for explaining conceptsprocess - Step-by-step process diagramscustom - Free-form diagram (uses prompt as-is)Options:
--type (required): Diagram type--prompt (required): Description of the diagram content--output (required): Output file path--aspect-ratio: Ratio (default varies by type)--resolution: 1K, 2K (default), or 4K--style: professional (default), colorful, minimal, modern
</diagram_generation>
<prebuilt_tools>
Location: ./tools/
| Tool | Purpose |
|---|---|
generate-image.ts | Text-to-image generation |
edit-image.ts | Image editing/inpainting |
generate-diagram.ts | Diagrams and visualizations |
nano-banana-client.ts | Shared client library |
All tools:
GEMINI_API_KEY from environment (no fallback - throws if missing)<prompting_best_practices> For Images:
For Diagrams:
For Editing:
<anti_patterns>
GEMINI_API_KEY is not set.2K or 4K with gemini-2.5-flash-image (1K max)<success_criteria>
Verification:
# Check file was created
ls -la ./output.png
# Use the Read tool to view the generated image
# Claude Code can display images when read with the Read tool
</success_criteria>
<detailed_references> API Guide: See the full Nano Banana API Guide for advanced features:
Diagram Templates: The generate-diagram.ts tool includes optimized prompt templates for each diagram type. See tools/generate-diagram.ts for the full template definitions.
</detailed_references>