nano-banana-skill

Generates, edits, and restores images using Google Gemini image models (Nano Banana). Use when the user wants to create images from text prompts, edit existing images with natural language, restore or enhance photos, or generate icons, patterns, diagrams, or visual content. Requires a GEMINI_API_KEY environment variable.

16 stars

Best use case

nano-banana-skill is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generates, edits, and restores images using Google Gemini image models (Nano Banana). Use when the user wants to create images from text prompts, edit existing images with natural language, restore or enhance photos, or generate icons, patterns, diagrams, or visual content. Requires a GEMINI_API_KEY environment variable.

Teams using nano-banana-skill should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/nano-banana-skill/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/backend/nano-banana-skill/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/nano-banana-skill/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How nano-banana-skill Compares

Feature / Agentnano-banana-skillStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generates, edits, and restores images using Google Gemini image models (Nano Banana). Use when the user wants to create images from text prompts, edit existing images with natural language, restore or enhance photos, or generate icons, patterns, diagrams, or visual content. Requires a GEMINI_API_KEY environment variable.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Nano Banana Skill

Image generation, editing, and restoration powered by Google Gemini.

## Setup (One-Time)

Run the setup script to install dependencies automatically:

```bash
bash <skill-dir>/scripts/setup.sh
```

Then set an API key (get one at https://aistudio.google.com/apikey):

```bash
export GEMINI_API_KEY="your-api-key"
```

The API key can be set as any of these environment variables (checked in order):
`NANOBANANA_GEMINI_API_KEY`, `NANOBANANA_GOOGLE_API_KEY`, `GEMINI_API_KEY`, `GOOGLE_API_KEY`

## Quick Reference

| Mode | Purpose | Required Flags |
|------|---------|----------------|
| `generate` | Create image from text | `--prompt` |
| `edit` | Modify an existing image | `--input`, `--prompt` |
| `restore` | Enhance/fix an image | `--input` |

| Flag | Description | Default |
|------|-------------|---------|
| `--prompt` | Text description of desired image | — |
| `--input` | Input image path (edit/restore) | — |
| `--reference` | Style reference image(s), repeatable | — |
| `--output` | Output file path | Auto-named |
| `--size` | `1K`, `2K`, or `4K` | `1K` |
| `--format` | `png` or `jpeg` | `png` |
| `--preview` | Open image after generation | off |
| `--json` | Output structured JSON | off |

## Generate Images

Create images from text prompts:

```bash
# Basic generation
python3 <skill-dir>/scripts/nanobanana.py --mode generate --prompt "A banana floating in space"

# With specific size and format
python3 <skill-dir>/scripts/nanobanana.py --mode generate --prompt "Cyberpunk cityscape at night" --size 2K --format jpeg

# With explicit output path
python3 <skill-dir>/scripts/nanobanana.py --mode generate --prompt "Minimalist logo" --output ./my-logo.png
```

When `--output` is omitted, files are saved to `./nanobanana-output/` with auto-generated names based on the prompt.

## Edit Images

Modify existing images using natural language instructions:

```bash
# Change style
python3 <skill-dir>/scripts/nanobanana.py --mode edit --input photo.jpg --prompt "Convert to watercolor painting style"

# Modify content
python3 <skill-dir>/scripts/nanobanana.py --mode edit --input scene.png --prompt "Add a rainbow in the sky"

# Change colors
python3 <skill-dir>/scripts/nanobanana.py --mode edit --input logo.png --prompt "Change the color scheme to blue and gold"
```

## Restore Images

Enhance, repair, or upscale images:

```bash
# Auto-restore (uses default restoration prompt)
python3 <skill-dir>/scripts/nanobanana.py --mode restore --input old_photo.jpg

# Targeted restoration
python3 <skill-dir>/scripts/nanobanana.py --mode restore --input damaged.png --prompt "Remove scratches and improve sharpness"

# Enhance quality
python3 <skill-dir>/scripts/nanobanana.py --mode restore --input blurry.jpg --prompt "Enhance clarity and increase detail" --size 4K
```

## Reference Images

Use reference images to guide the style of generated images:

```bash
# Single reference
python3 <skill-dir>/scripts/nanobanana.py --mode generate --prompt "A mountain landscape" --reference style_guide.png

# Multiple references
python3 <skill-dir>/scripts/nanobanana.py --mode generate --prompt "Product photo" --reference brand_style.png --reference color_palette.png
```

The script searches for input and reference files in these locations:
- Current directory
- `./images/`
- `./input/`
- `./nanobanana-output/`
- `~/Downloads/`
- `~/Desktop/`

## Output

### Smart Naming

When `--output` is omitted, files are automatically named based on the prompt text:
- Prompt is converted to lowercase with special characters removed
- Spaces become underscores, limited to 32 characters
- Duplicate names get a numeric suffix (`_1`, `_2`, etc.)
- All auto-named files go into `./nanobanana-output/`

### Sizes

| Size | Description |
|------|-------------|
| `1K` | Standard resolution (default, fastest) |
| `2K` | High resolution |
| `4K` | Maximum resolution (slowest) |

## Model Selection

Set the `NANOBANANA_MODEL` environment variable to choose a model:

```bash
# Default model (fast, good quality)
export NANOBANANA_MODEL="gemini-2.5-flash-image"

# Pro model (highest quality)
export NANOBANANA_MODEL="gemini-3-pro-image-preview"
```

If unset, defaults to `gemini-2.5-flash-image`.

## Specialized Patterns

No special flags are needed for these -- just use descriptive prompts:

### Icons

```bash
python3 <skill-dir>/scripts/nanobanana.py --mode generate \
  --prompt "Flat design app icon for a weather app, rounded corners, minimal style, solid background" \
  --size 1K
```

### Patterns

```bash
python3 <skill-dir>/scripts/nanobanana.py --mode generate \
  --prompt "Seamless tileable geometric pattern, blue and white, high density, suitable for fabric print"
```

### Diagrams

```bash
python3 <skill-dir>/scripts/nanobanana.py --mode generate \
  --prompt "Architecture diagram showing microservices: API gateway, auth service, user service, database. Clean lines, labeled boxes"
```

### Sequential / Story Images

Generate each frame as a separate call, referencing previous outputs to maintain visual consistency:

```bash
# Frame 1
python3 <skill-dir>/scripts/nanobanana.py --mode generate \
  --prompt "Scene 1 of 3: A hero stands at the edge of a forest, sunrise, cinematic style" \
  --output ./nanobanana-output/story_1.png

# Frame 2 (reference previous for consistency)
python3 <skill-dir>/scripts/nanobanana.py --mode generate \
  --prompt "Scene 2 of 3: The same hero enters the forest, dappled light, cinematic style" \
  --reference ./nanobanana-output/story_1.png \
  --output ./nanobanana-output/story_2.png
```

## Preview

Add `--preview` to automatically open the generated image:

```bash
python3 <skill-dir>/scripts/nanobanana.py --mode generate --prompt "Sunset over ocean" --preview
```

Uses the system default image viewer (macOS: `open`, Linux: `xdg-open`, Windows: `start`).

## JSON Output

Add `--json` for structured output suitable for agent parsing:

```bash
python3 <skill-dir>/scripts/nanobanana.py --mode generate --prompt "A banana" --json
```

Output format:
```json
{
  "success": true,
  "files": ["nanobanana-output/a_banana.png"],
  "message": "Image generated successfully."
}
```

On failure:
```json
{
  "success": false,
  "files": [],
  "message": "Error description here"
}
```

## Error Handling

| Error | Cause | Fix |
|-------|-------|-----|
| No API key found | Missing environment variable | Set `GEMINI_API_KEY` |
| 403 / Permission denied | Invalid API key | Check key at https://aistudio.google.com/apikey |
| 429 / Rate limit | Too many requests | Wait and retry |
| Safety filter | Prompt flagged | Rephrase the prompt |
| No image generated | Model returned text only | Try a more specific prompt |
| File not found | Input/reference image missing | Check path or place in a searched directory |

See `references/ADVANCED.md` for advanced prompt engineering patterns, model comparison, and troubleshooting.

Related Skills

nano-banana

16
from diegosouzapw/awesome-omni-skill

AI image generation using Nano Banana PRO (Gemini 3 Pro Image) and Nano Banana (Gemini 2.5 Flash Image). Use this skill when: (1) Generating images from text prompts, (2) Editing existing images, (3) Creating professional visual assets like infographics, logos, product shots, stickers, (4) Working with character consistency across multiple images, (5) Creating images with accurate text rendering, (6) Any task requiring AI-generated visuals. Triggers on: 'generate image', 'create image', 'make a picture', 'design a logo', 'create infographic', 'AI image', 'nano banana', or any image generation request.

nanobanana-ppt-skills

16
from diegosouzapw/awesome-omni-skill

AI-powered PPT generation with document analysis and styled images

nanobanana-image

16
from diegosouzapw/awesome-omni-skill

Nano Banana (Google Gemini API) を使って画像を生成・編集するスキル。「画像を生成して」「イラストを作って」「○○の絵を描いて」「画像を作成」「この画像を編集して」「この画像をもとに○○を作って」「generate an image」「create a picture」「edit this image」などの依頼があった場合に使用。テキストからの生成、参照画像からの生成、画像編集、Google検索グラウンディングによる最新情報を反映した画像生成に対応。「最新の○○」「トレンドを反映」「リアルタイム情報」といった依頼にも対応可能。

nano-image-generate

16
from diegosouzapw/awesome-omni-skill

Generate images using Nano Banana (Flash) or Nano Banana Pro. Use 'flash' for speed/efficiency and 'pro' for high quality, text rendering, and complex prompt adherence. Triggers include 'generate image', 'create logo', 'fast image', 'high quality image'.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

web-design-guidelines

16
from diegosouzapw/awesome-omni-skill

Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

voxanne-branding-expert

16
from diegosouzapw/awesome-omni-skill

Strategic branding, business development, and UI/UX design expertise for Voxanne AI. Combines business strategy, visual design principles, and market positioning to create enterprise-grade branding assets and go-to-market strategies. Use when designing logos, creating brand guidelines, developing marketing strategies, or positioning products against competitors like ChatGPT, Anthropic, and Google.

vibe-techdesign

16
from diegosouzapw/awesome-omni-skill

Create a Technical Design Document for your MVP. Use when the user wants to plan architecture, choose tech stack, or says "plan technical design", "choose tech stack", or "how should I build this".

vapor-ui

16
from diegosouzapw/awesome-omni-skill

Vapor UI design system component and icon guide, UI mockup generator, and Figma design converter. Provides component catalog, icon lookup, usage patterns, props documentation, and converts Figma designs to production-ready vapor-ui code. Use when user asks "vapor-ui components", "vapor-ui icons", "아이콘 찾기", "vapor-ui 사용법", "vapor-ui를 사용해서 시안 구현", "convert figma", "figma to code", "implement design from figma", provides a Figma URL, or mentions specific components like "Button", "Input", "Modal".

ux-visualizer

16
from diegosouzapw/awesome-omni-skill

Analyzes source code or requirements to generate high-fidelity screen and state transition diagrams. Specialized in SPA state mapping.

ux-ui-exp

16
from diegosouzapw/awesome-omni-skill

UI/UX design intelligence with Bootstrap 5, Font Awesome, SweetAlert2. Use: /ux-ui-exp {command}

ux-spec-author

16
from diegosouzapw/awesome-omni-skill

Converts UX/design intent into testable design specifications that feed requirements. Use when defining user flows, accessibility, or design constraints.