Generate and edit images using Google Gemini's Nano Banana image generation API via undyapi.com proxy. Use when users want to generate images from text descriptions, edit existing images with AI, or create visual content. Supports aspect ratio and quality control.
A Claude Code Skill for AI-powered image generation and editing using Google Gemini's Nano Banana models.
Activate this skill when users request:
Trigger phrases:
API Key: Set environment variable NANO_BANANA_API_KEY
export NANO_BANANA_API_KEY="your-api-key"
Required tools: curl, jq, base64
| Model | ID | Best For |
|---|---|---|
| Flash | gemini-3.1-flash-image-preview | Fast generation, high volume, good quality |
| Pro | gemini-3-pro-image-preview | Professional quality, complex prompts |
# Basic generation
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "A cute cat wearing a space helmet on Mars" \
-o ./output
# With aspect ratio
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "A panoramic mountain landscape at sunset" \
-o ./output \
-r 16:9
# Using Pro model with 4K output
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "A detailed portrait of a robot philosopher" \
-o ./output \
-m pro \
-s 4K
# Edit an existing image
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "Add a rainbow in the sky" \
-i ./input/photo.jpg \
-o ./output
# Style transfer
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "Transform this photo into a watercolor painting" \
-i ./input/photo.png \
-o ./output \
-m pro
| Parameter | Short | Description | Default |
|---|---|---|---|
--prompt | -p | Text description (required) | - |
--image | -i | Input image path for editing | - |
--output | -o | Output directory | ./ |
--ratio | -r | Aspect ratio (optional) | API default |
--size | -s | Output image size (optional) | API default |
--model | -m | Model: flash/pro | flash |
Flash model (14 ratios):
1:1, 1:4, 1:8, 2:3, 3:2, 3:4, 4:1, 4:3, 4:5, 5:4, 8:1, 9:16, 16:9, 21:9
Pro model (10 ratios):
1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
512 - 512px (Flash only)1K - 1024px2K - 2048px4K - 4096px (highest resolution)bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "A minimalist logo for a coffee shop called 'Bean Dreams', modern flat design, warm colors" \
-o ./logos \
-r 1:1 \
-m pro \
-s 2K
# Instagram post (square)
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "Aesthetic flat lay of coffee and pastries, soft morning light" \
-o ./social \
-r 1:1
# Instagram story (portrait)
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "Motivational quote background, gradient sunset colors" \
-o ./social \
-r 9:16
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "Remove the background and add a professional studio backdrop" \
-i ./product.jpg \
-o ./edited \
-m pro
bash ~/.claude/skills/nano-banana-skill/scripts/generate.sh \
-p "Futuristic cyberpunk city street at night, neon lights reflecting on wet pavement, detailed concept art" \
-o ./concept \
-r 16:9 \
-m pro \
-s 4K
https://undyapi.comhttps://vip.undyingapi.comhttps://vip.undyingapi.siteFor detailed API documentation, see REFERENCE.md.
Error: NANO_BANANA_API_KEY environment variable not set
Solution: Export your API key: export NANO_BANANA_API_KEY="your-key"
Error: 429 Too Many Requests
Solution: Wait a moment and retry, or use the backup endpoints
Error: Unsupported image format
Solution: Supported formats are JPEG, PNG, GIF, WebP
Generated images are saved to the specified output directory with timestamped filenames:
nano_banana_20260109_143052.jpg (extension matches actual format from API)The script also outputs: