# Nanobanana Skill

Generate or edit images via Google Gemini (nanobanana).

- Repository: https://github.com/feiskyer/claude-code-settings (1668 stars)
- Category: Media
- License: MIT
- Last updated: 2026-09-27
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add feiskyer/claude-code-settings --skill nanobanana-skill -g -a claude-code -y`
Codex: `npx skills add feiskyer/claude-code-settings --skill nanobanana-skill -g -a codex -y`
Cursor: `npx skills add feiskyer/claude-code-settings --skill nanobanana-skill -g -a cursor -y`
Gemini CLI: `npx skills add feiskyer/claude-code-settings --skill nanobanana-skill -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add feiskyer/claude-code-settings`

## Description

Generate or edit images via Google Gemini (nanobanana). This is the DEFAULT image skill, use whenever the user asks to generate, create, or edit an image and does NOT name another provider. Triggers: "nanobanana", "generate image", "create image", "edit image", "图片生成", "生成图片", "AI绘图", "图片编辑". Do NOT use for diagrams (架构图/流程图/时序图), draw those with Mermaid or code instead.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Nanobanana Image Generation Skill

Generate or edit images using Google Gemini API through the nanobanana tool.

## Requirements

1. **GEMINI_API_KEY**: Must be configured in `~/.nanobanana.env` or `export GEMINI_API_KEY=<your-api-key>`
2. **Python3 with dependent packages installed**: google-genai, Pillow, python-dotenv. They could be installed via `python3 -m pip install -r ${CLAUDE_SKILL_DIR}/requirements.txt` if not installed yet.
3. **Executable**: `${CLAUDE_SKILL_DIR}/nanobanana.py`

## Instructions

### For image generation

1. Ask the user for:
   - What they want to create (the prompt)
   - Desired aspect ratio/size (optional, defaults to 9:16 portrait)
   - Output filename (optional, auto-generates UUID if not specified)
   - Model preference (optional, defaults to gemini-3.1-flash-image-preview)
   - Resolution (optional, defaults to 1K)

2. Run the nanobanana script with appropriate parameters:

   ```bash
   python3 ${CLAUDE_SKILL_DIR}/nanobanana.py --prompt "description of image" --output "filename.png"
   ```

3. Show the user the saved image path when complete

### For image editing

1. Ask the user for:
   - Input image file(s) to edit
   - What changes they want (the prompt)
   - Output filename (optional)

2. Run with input images:

   ```bash
   python3 ${CLAUDE_SKILL_DIR}/nanobanana.py --prompt "editing instructions" --input image1.png image2.png --output "edited.png"
   ```

## Available Options

### Aspect Ratios (--size)

- `1024x1024` (1:1) - Square
- `832x1248` (2:3) - Portrait
- `1248x832` (3:2) - Landscape
- `864x1184` (3:4) - Portrait
- `1184x864` (4:3) - Landscape
- `896x1152` (4:5) - Portrait
- `1152x896` (5:4) - Landscape
- `768x1344` (9:16) - Portrait (default)
- `1344x768` (16:9) - Landscape
- `1536x672` (21:9) - Ultra-wide

### Models (--model)

- `gemini-3.1-flash-image-preview` (default) - Latest, fast generation
- `gemini-3-pro-image-preview` - Higher quality, supports thinking/reasoning

### Resolution (--resolution)

The rest: https://github.com/feiskyer/claude-code-settings/blob/HEAD/skills/nanobanana-skill/SKILL.md
