# Nanobanana

Generate and edit images using Google Gemini 3 Pro Image (Nano Banana Pro).

- Repository: https://github.com/ReScienceLab/opc-skills (1889 stars)
- Category: Media
- License: Apache-2.0
- Last updated: 2026-11-01
- Runs scripts: yes, review before use

## Install

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

## Description

Generate and edit images using Google Gemini 3 Pro Image (Nano Banana Pro). Supports text-to-image, image editing, various aspect ratios, and high-resolution output (2K/4K). Use when user wants to generate images, create images, use Gemini image generation, or do AI image generation.

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

# Nano Banana - AI Image Generation

Generate and edit images using Google's Gemini 3 Pro Image model (`gemini-3-pro-image-preview`, nicknamed "Nano Banana Pro" 🍌).

## Prerequisites

**Required:**
- `GEMINI_API_KEY` - Get from [Google AI Studio](https://aistudio.google.com/apikey)
- Python 3.10+ with `google-genai` package

**Install dependencies:**
```bash
pip install google-genai pillow
```

## Quick Start

### Generate an image:
```bash
python3 <skill_dir>/scripts/generate.py "a cute robot mascot, pixel art style" -o robot.png
```

### Edit an existing image:
```bash
python3 <skill_dir>/scripts/generate.py "make the background blue" -i input.jpg -o output.png
```

### Generate with specific aspect ratio:
```bash
python3 <skill_dir>/scripts/generate.py "cinematic landscape" --ratio 21:9 -o landscape.png
```

### Generate high-resolution 4K image:
```bash
python3 <skill_dir>/scripts/generate.py "professional product photo" --size 4K -o product.png
```

## Script Reference

### `scripts/generate.py`

Main image generation script.

```
Usage: generate.py [OPTIONS] PROMPT

Arguments:
  PROMPT              Text prompt for image generation

Options:
  -o, --output PATH   Output file path (default: auto-generated)
  -i, --input PATH    Input image for editing (optional)
  -r, --ratio RATIO   Aspect ratio (1:1, 16:9, 9:16, 21:9, etc.)
  -s, --size SIZE     Image size: 2K or 4K (default: standard)
  --search            Enable Google Search grounding for accuracy
  -v, --verbose       Show detailed output
```

**Supported aspect ratios:**
- `1:1` - Square (default)
- `2:3`, `3:2` - Portrait/Landscape
- `3:4`, `4:3` - Standard
- `4:5`, `5:4` - Photo
- `9:16`, `16:9` - Widescreen
- `21:9` - Ultra-wide/Cinematic

### `scripts/batch_generate.py`

Generate multiple images with sequential naming.

```
Usage: batch_generate.py [OPTIONS] PROMPT

Arguments:
  PROMPT              Text prompt for image generation

The rest: https://github.com/ReScienceLab/opc-skills/blob/HEAD/skills/nanobanana/SKILL.md
