Nano Banana Skill
Generate, edit, and iterate on visual imagery conversationally using Google's native Nano Banana image generation foundation models (gemini-3.1-flash-lite-image, gemini-3.1-flash-image, gemini-3-pro-image, gemini-2.5-flash-image).
Available scripts
scripts/banana.py: Production CLI tool for text-to-image generation, multimodal editing, and consistency anchoring with model capability validation.
scripts/test_banana.py: Test suite verifying CLI argument parsing and capability validation guards.
Trigger Conditions
Activate this skill whenever the user asks to:
- Generate new images or illustrations from text prompts.
- Edit, transform, style, or combine existing images.
- Use "banana" as a verb (e.g., "please banana this image", "banana this character into anime style", "banana this photo into chibi style").
- Maintain character, subject, or style consistency across generated imagery using reference images.
- Create 4K high-resolution visual assets or extreme aspect-ratio banners (
1:4, 4:1, 1:8, 8:1).
Model Selection & Capability Matrix
| Capability / Feature |
Nano Banana 2 Lite (nano-banana-2-lite) |
Nano Banana 2 (nano-banana-2) |
Nano Banana Pro (nano-banana-pro) |
Nano Banana (nano-banana) |
| Model ID |
gemini-3.1-flash-lite-image |
gemini-3.1-flash-image |
gemini-3-pro-image |
gemini-2.5-flash-image |
| Primary Focus |
Ultra-low latency (<2s), high volume |
Generalist workhorse, speed + 4K |
Studio precision & asset production |
Foundational (Retiring Oct 2026) |
| Resolutions |
1K (1024px) only |
512px (0.5K), 1K, 2K, 4K |
1K, 2K, 4K |
1K (1024px) only |
| Aspect Ratios |
14 discrete ratios |
14 discrete ratios (incl. 1:4, 4:1, 1:8, 8:1) |
10 standard ratios |
10 standard ratios |
| Search Grounding |
❌ Not Supported |
Web Search + Image Search |
Web Search |
❌ Not Supported |
| Thinking Mode |
Supported (minimal, high) |
Supported (minimal, high) |
Enabled by Default |
❌ Not Supported |
| Video Context |
❌ Not Supported |
YouTube URLs & MP4 files |
❌ Not Supported |
❌ Not Supported |
| Reference Anchors |
Up to 14 (Local/Single edit focus) |
Up to 10 objects + 4 characters |
Up to 6 objects + 5 characters + 3 styles |
Up to 3 input images |
| Function Calling |
Supported |
❌ Not Supported |
❌ Not Supported |
❌ Not Supported |
| Reference Guide |
nano-banana-2-lite.md |
nano-banana-2.md |
nano-banana-pro.md |
nano-banana.md |
Deep Technical References
Consult dedicated reference cards in references/ for full specs, exact token counts, and pixel dimensions:
- references/nano-banana-2-lite.md: Consult when building real-time UI tools, fast prototyping, or cost-critical high-frequency pipelines.
- references/nano-banana-2.md: Consult for 4K generation, Google Image Search Grounding, video-to-image workflows, and ultra-wide/tall banners (
1:4, 4:1, 1:8, 8:1).
- references/nano-banana-pro.md: Consult for studio asset production, multi-reference consistency across 14 anchors (objects + characters + artistic style), and storyboards.
- references/nano-banana.md: Consult for
gemini-2.5-flash-image specifications and migration paths.
- references/README.md: Index and guidelines for storing project-specific visual consistency anchors.
Core Execution Workflows
1. CLI Execution via scripts/banana.py
Run scripts/banana.py with uv run to generate or edit images:
# High-velocity 1K generation with Nano Banana 2 Lite (Default)
uv run scripts/banana.py \
-p "A minimalist flat illustration of a coffee cup on a wooden table" \
-f "coffee_lite.png" \
-m "nano-banana-2-lite" \
-a "1:1"
# Studio-quality 4K generation with Nano Banana Pro
uv run scripts/banana.py \
-p "An authentic architectural photograph of a modern library atrium with skylights" \
-f "library_4k.png" \
-m "nano-banana-pro" \
-r "4K" \
-a "16:9" \
--search
# Ultra-wide banner (4:1) with Nano Banana 2 and Image Search Grounding
uv run scripts/banana.py \
-p "A panorama header of the Swiss Alps at sunrise with fresh snow" \
-f "alps_banner.png" \
-m "nano-banana-2" \
-r "2K" \
-a "4:1" \
--image-search
# Conversational Image Editing ("banana this") with Multi-Reference Consistency
uv run scripts/banana.py \
-p "banana this character: place the character into an astronaut suit on Mars" \
-i "references/mascot_front.png" \
-i "references/suit_concept.png" \
-f "astronaut_mascot.png" \
-m "nano-banana-2" \
-r "2K"
CLI Argument Reference
-p, --prompt: Text prompt describing generation or edit instructions (required).
-f, --filename: Output file path for generated PNG/JPEG (required).
-i, --input-image: Path to input/reference image(s). Can be specified up to 14 times.
-m, --model: nano-banana-2-lite (default), nano-banana-2, nano-banana-pro, nano-banana.
-r, --resolution: 512px, 1K (default), 2K, 4K.
-a, --aspect-ratio: 1:1 (default), 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.
--thinking-level: minimal or high (Banana 2 & Banana 2 Lite).
--search: Enable Google Search Grounding (Banana 2 & Banana Pro).
--image-search: Enable Google Image Search Grounding (Banana 2 only).
--api: interactions (default, Interactions API) or models (generate_content).
2. Dual SDK Integration Patterns
Interactions API (client.interactions.create) — Recommended
Best for multi-turn editing, search grounding, and stateful iteration:
import base64
from google import genai
client = genai.Client()
# Text-to-Image Generation with 4K Resolution & Search Grounding
interaction = client.interactions.create(
model="gemini-3.1-flash-image",
input="An infographic chart showing the timeline of space exploration milestones",
tools=[{"type": "google_search"}],
generation_config={"thinking_level": "high"},
response_format={
"type": "image",
"aspect_ratio": "16:9",
"image_size": "4K",
},
)
if interaction.output_image:
with open("space_milestones.png", "wb") as f:
f.write(base64.b64decode(interaction.output_image.data))
Models API (client.models.generate_content)
Direct stateless multimodal generation:
from google import genai
from PIL import Image
client = genai.Client()
img = Image.open("references/product.png")
response = client.models.generate_content(
model="gemini-3.1-flash-image",
contents=[img, "Place this product on a sleek marble countertop with soft studio lighting."],
)
for part in response.candidates[0].content.parts:
if part.inline_data:
with open("product_studiolit.png", "wb") as f:
f.write(part.inline_data.data)
break
Prompting Best Practices
- Be Hyper-Specific: Define materials, surface textures, lighting setups, and camera angles (
three-point softbox, macro lens, shallow depth of field).
- Context & Intent: State the functional purpose (
e-commerce hero banner, editorial illustration, app store icon).
- Conversational Inpainting: When editing, clearly describe what to modify while instructing to preserve unchanged surroundings (
"Change only the sofa to brown vintage leather. Keep all lighting and room decor untouched.").
- Positive Framing: Describe what should appear instead of using negative constraints (
"an empty street with no signs of vehicles" rather than "no cars").
1---2name: nano-banana3description: Conversational image generation and multimodal image editing tool using Google Nano Banana models. Generates high-resolution images (1K, 2K, 4K), performs style transfers and image edits ("banana this"), and maintains character or style consistency using multi-image reference inputs. Activate when generating illustrations, editing or transforming images, creating visual assets, or maintaining character consistency across scenes.4license: Apache-2.05---67# Nano Banana Skill89Generate, edit, and iterate on visual imagery conversationally using Google's native **Nano Banana** image generation foundation models (`gemini-3.1-flash-lite-image`, `gemini-3.1-flash-image`, `gemini-3-pro-image`, `gemini-2.5-flash-image`).1011---1213## Available scripts1415- `scripts/banana.py`: Production CLI tool for text-to-image generation, multimodal editing, and consistency anchoring with model capability validation.16- `scripts/test_banana.py`: Test suite verifying CLI argument parsing and capability validation guards.1718---1920## Trigger Conditions21Activate this skill whenever the user asks to:22- Generate new images or illustrations from text prompts.23- Edit, transform, style, or combine existing images.24- Use **"banana" as a verb** (e.g., "please banana this image", "banana this character into anime style", "banana this photo into chibi style").25- Maintain character, subject, or style consistency across generated imagery using reference images.26- Create 4K high-resolution visual assets or extreme aspect-ratio banners (`1:4`, `4:1`, `1:8`, `8:1`).2728---2930## Model Selection & Capability Matrix3132| Capability / Feature | Nano Banana 2 Lite (`nano-banana-2-lite`) | Nano Banana 2 (`nano-banana-2`) | Nano Banana Pro (`nano-banana-pro`) | Nano Banana (`nano-banana`) |33| :--- | :--- | :--- | :--- | :--- |34| **Model ID** | `gemini-3.1-flash-lite-image` | `gemini-3.1-flash-image` | `gemini-3-pro-image` | `gemini-2.5-flash-image` |35| **Primary Focus** | Ultra-low latency (<2s), high volume | Generalist workhorse, speed + 4K | Studio precision & asset production | Foundational (Retiring Oct 2026) |36| **Resolutions** | `1K` (1024px) only | `512px` (0.5K), `1K`, `2K`, `4K` | `1K`, `2K`, `4K` | `1K` (1024px) only |37| **Aspect Ratios** | 14 discrete ratios | 14 discrete ratios (incl. `1:4`, `4:1`, `1:8`, `8:1`) | 10 standard ratios | 10 standard ratios |38| **Search Grounding** | ❌ Not Supported | **Web Search + Image Search** | **Web Search** | ❌ Not Supported |39| **Thinking Mode** | Supported (`minimal`, `high`) | Supported (`minimal`, `high`) | Enabled by Default | ❌ Not Supported |40| **Video Context** | ❌ Not Supported | YouTube URLs & MP4 files | ❌ Not Supported | ❌ Not Supported |41| **Reference Anchors** | Up to 14 (Local/Single edit focus) | Up to 10 objects + 4 characters | Up to 6 objects + 5 characters + 3 styles | Up to 3 input images |42| **Function Calling**| Supported | ❌ Not Supported | ❌ Not Supported | ❌ Not Supported |43| **Reference Guide** | [nano-banana-2-lite.md](references/nano-banana-2-lite.md) | [nano-banana-2.md](references/nano-banana-2.md) | [nano-banana-pro.md](references/nano-banana-pro.md) | [nano-banana.md](references/nano-banana.md) |4445---4647## Deep Technical References4849Consult dedicated reference cards in `references/` for full specs, exact token counts, and pixel dimensions:5051- **[references/nano-banana-2-lite.md](references/nano-banana-2-lite.md)**: Consult when building real-time UI tools, fast prototyping, or cost-critical high-frequency pipelines.52- **[references/nano-banana-2.md](references/nano-banana-2.md)**: Consult for 4K generation, Google Image Search Grounding, video-to-image workflows, and ultra-wide/tall banners (`1:4`, `4:1`, `1:8`, `8:1`).53- **[references/nano-banana-pro.md](references/nano-banana-pro.md)**: Consult for studio asset production, multi-reference consistency across 14 anchors (objects + characters + artistic style), and storyboards.54- **[references/nano-banana.md](references/nano-banana.md)**: Consult for `gemini-2.5-flash-image` specifications and migration paths.55- **[references/README.md](references/README.md)**: Index and guidelines for storing project-specific visual consistency anchors.5657---5859## Core Execution Workflows6061### 1. CLI Execution via `scripts/banana.py`6263Run `scripts/banana.py` with `uv run` to generate or edit images:6465```bash66# High-velocity 1K generation with Nano Banana 2 Lite (Default)67uv run scripts/banana.py \68 -p "A minimalist flat illustration of a coffee cup on a wooden table" \69 -f "coffee_lite.png" \70 -m "nano-banana-2-lite" \71 -a "1:1"7273# Studio-quality 4K generation with Nano Banana Pro74uv run scripts/banana.py \75 -p "An authentic architectural photograph of a modern library atrium with skylights" \76 -f "library_4k.png" \77 -m "nano-banana-pro" \78 -r "4K" \79 -a "16:9" \80 --search8182# Ultra-wide banner (4:1) with Nano Banana 2 and Image Search Grounding83uv run scripts/banana.py \84 -p "A panorama header of the Swiss Alps at sunrise with fresh snow" \85 -f "alps_banner.png" \86 -m "nano-banana-2" \87 -r "2K" \88 -a "4:1" \89 --image-search9091# Conversational Image Editing ("banana this") with Multi-Reference Consistency92uv run scripts/banana.py \93 -p "banana this character: place the character into an astronaut suit on Mars" \94 -i "references/mascot_front.png" \95 -i "references/suit_concept.png" \96 -f "astronaut_mascot.png" \97 -m "nano-banana-2" \98 -r "2K"99```100101#### CLI Argument Reference102- `-p`, `--prompt`: Text prompt describing generation or edit instructions (required).103- `-f`, `--filename`: Output file path for generated PNG/JPEG (required).104- `-i`, `--input-image`: Path to input/reference image(s). Can be specified up to 14 times.105- `-m`, `--model`: `nano-banana-2-lite` (default), `nano-banana-2`, `nano-banana-pro`, `nano-banana`.106- `-r`, `--resolution`: `512px`, `1K` (default), `2K`, `4K`.107- `-a`, `--aspect-ratio`: `1:1` (default), `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`.108- `--thinking-level`: `minimal` or `high` (Banana 2 & Banana 2 Lite).109- `--search`: Enable Google Search Grounding (Banana 2 & Banana Pro).110- `--image-search`: Enable Google Image Search Grounding (Banana 2 only).111- `--api`: `interactions` (default, Interactions API) or `models` (`generate_content`).112113---114115### 2. Dual SDK Integration Patterns116117#### Interactions API (`client.interactions.create`) — Recommended118Best for multi-turn editing, search grounding, and stateful iteration:119120```python121import base64122from google import genai123124client = genai.Client()125126# Text-to-Image Generation with 4K Resolution & Search Grounding127interaction = client.interactions.create(128 model="gemini-3.1-flash-image",129 input="An infographic chart showing the timeline of space exploration milestones",130 tools=[{"type": "google_search"}],131 generation_config={"thinking_level": "high"},132 response_format={133 "type": "image",134 "aspect_ratio": "16:9",135 "image_size": "4K",136 },137)138139if interaction.output_image:140 with open("space_milestones.png", "wb") as f:141 f.write(base64.b64decode(interaction.output_image.data))142```143144#### Models API (`client.models.generate_content`)145Direct stateless multimodal generation:146147```python148from google import genai149from PIL import Image150151client = genai.Client()152153img = Image.open("references/product.png")154response = client.models.generate_content(155 model="gemini-3.1-flash-image",156 contents=[img, "Place this product on a sleek marble countertop with soft studio lighting."],157)158159for part in response.candidates[0].content.parts:160 if part.inline_data:161 with open("product_studiolit.png", "wb") as f:162 f.write(part.inline_data.data)163 break164```165166---167168## Prompting Best Practices1691. **Be Hyper-Specific**: Define materials, surface textures, lighting setups, and camera angles (`three-point softbox`, `macro lens`, `shallow depth of field`).1702. **Context & Intent**: State the functional purpose (`e-commerce hero banner`, `editorial illustration`, `app store icon`).1713. **Conversational Inpainting**: When editing, clearly describe what to modify while instructing to preserve unchanged surroundings (`"Change only the sofa to brown vintage leather. Keep all lighting and room decor untouched."`).1724. **Positive Framing**: Describe what should appear instead of using negative constraints (`"an empty street with no signs of vehicles"` rather than `"no cars"`).