Agent skill

Nano Banana 2

by intellectronica in intellectronica/agent-skills

Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API.

CC0-1.0Auto-check passedMedia & Creative

Install Nano Banana 2

skills CLI
$ npx skills add intellectronica/agent-skills --skill nano-banana-2 -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install intellectronica/agent-skills nano-banana-2 --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/intellectronica/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nano-banana-2 .claude/skills/nano-banana-2 && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
nano-banana-2
GitHub stars
295
Token cost
~972 tokens
SKILL.md length
323 words
Files
2 (incl. scripts)
Skills in repo
21
Repo updated
First seen
Licence
CC0-1.0

At a glance

Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API.

  • Works in 2 steps: api-key argument → GEMINI_API_KEY environment variable
  • Especially when they need fast iteration
  • SKILL.md covers Usage, Model, Resolution Options and Aspect Ratios, plus 6 more sections
  • Runs Python scripts from its folder; calls uv; needs GEMINI_API_KEY

What it does

Nano Banana 2 is an agent skill from intellectronica/agent-skills. Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API. This skill should be used when the user asks to create or modify images, especially when they need fast iteration, explicit aspect-ratio control, or resolution control from 512px to 4K.

Its SKILL.md is about 970 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/generate_image.py`).

It sits in Media & Creative, covering Image generation and Image editing. It works with Google Gemini. The repository describes itself as: @intellectronica's agent skills. The licence is CC0-1.0.

When your agent uses it

  • Especially when they need fast iteration
  • Explicit aspect-ratio control
  • Resolution control from 512px to 4K

Example prompts

  • “/nano-banana-2”

Requirements

  • Python 3
  • A credential in GEMINI_API_KEY

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. api-key argument
  2. GEMINI_API_KEY environment variable

What it can do on your machine

Read from SKILL.md and the folder at commit 9b0e00a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • GEMINI_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Nano Banana 2 loads about 972 tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 323 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~972

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from intellectronica/agent-skills at commit 9b0e00a, republished under its CC0-1.0 licence (© intellectronica). 323 words, ~972 tokens.

Download SKILL.mdSave it as .claude/skills/nano-banana-2/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
nano-banana-2
description
Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API. This skill should be used when the user asks to create or modify images, especially when they need fast iteration, explicit aspect-ratio control, or resolution control from 512px to 4K.

Nano Banana 2 Image Generation & Editing

Generate new images or edit existing images with Nano Banana 2 (gemini-3.1-flash-image-preview).

Usage

Run the script using absolute or workspace-relative path (do NOT cd into the skill directory first):

Generate new image:

bash
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "your image description" --filename "output-name.png" [--resolution 512px|1K|2K|4K] [--aspect-ratio RATIO] [--api-key KEY]

Edit image(s) with references:

bash
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "editing instructions" --filename "output-name.png" --input-image "path/to/input1.png" [--input-image "path/to/input2.png" ...] [--resolution 512px|1K|2K|4K] [--aspect-ratio RATIO] [--api-key KEY]

Always run from the user's current working directory so outputs are saved in the active project context.

Model

Use model code:

  • gemini-3.1-flash-image-preview (Nano Banana 2)

Do not use gemini-3-pro-image-preview in this skill.

Resolution Options

Nano Banana 2 supports:

  • 512px (fastest, low-latency iteration)
  • 1K (default)
  • 2K
  • 4K

Map common user language:

  • "quick draft", "thumbnail", "tiny", "512", "0.5K" → 512px
  • no resolution mention → 1K
  • "2K", "medium", "normal" → 2K
  • "4K", "high-res", "ultra", "print quality" → 4K

Use uppercase K for 1K, 2K, 4K.

Aspect Ratios

Supported aspect 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

Map common requests:

  • square post / icon → 1:1
  • phone wallpaper / vertical reel → 9:16
  • widescreen / slide / hero image → 16:9
  • cinematic wide → 21:9
  • portrait print → 2:3 or 3:4
  • panorama banner → 4:1 or 8:1

If unspecified, let the model default behavior apply.

Reference Images (New in Gemini 3 Image workflows)

Provide up to 14 reference images when needed by repeating --input-image:

  • preserve character consistency
  • preserve object fidelity
  • combine multiple visual references into one output

Use one image for simple edits; use multiple images for composition or consistency-sensitive tasks.

API Key

Resolve API key in this order:

  1. --api-key argument
  2. GEMINI_API_KEY environment variable

If no key is available, stop and report a clear error.

Filename Generation

Generate filenames as: yyyy-mm-dd-hh-mm-ss-name.png

Examples:

  • 2026-02-26-17-31-04-japanese-garden.png
  • 2026-02-26-17-31-59-social-banner.png

Prompt Handling

For generation, pass the user's request as-is unless critically underspecified. For editing, include explicit transformation instructions in the prompt and preserve the original intent.

Output

  • Save PNG to the current directory (or to a provided path in --filename)
  • Return the full saved path(s)
  • Do not read the output image back unless explicitly requested

Examples

Create a 4K widescreen image:

bash
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "Futuristic city skyline at blue hour with neon reflections" --filename "2026-02-26-17-45-00-futuristic-skyline.png" --resolution 4K --aspect-ratio 16:9

Edit with multiple references:

bash
uv run ./.agents/skills/nano-banana-2/scripts/generate_image.py --prompt "Create a polished campaign image that keeps the exact logo details and character identity" --filename "2026-02-26-17-50-10-campaign-image.png" --input-image "logo.png" --input-image "character.png" --resolution 2K --aspect-ratio 4:5

© intellectronica, CC0-1.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in skills/nano-banana-2 of intellectronica/agent-skills.

  • SKILL.md
  • scripts/generate_image.py

Open the folder on GitHubat commit 9b0e00a

Compare with similar skills

Nano Banana 2 next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Nano Banana 2 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nano Banana 2 this skillintellectronica/agent-skills295—~972Automated safety check: PassCC0-1.0
AI Image Generation and Editingzhayujie/CowAgent47k—~1.3kAutomated safety check: PassMIT
BlockRun Image GenerationBlockRunAI/ClawRouter6.6k—~2.1kAutomated safety check: PassMIT
Antigravity Gemini ImageuluckyXH/OpenMOSS1.3k—~730Automated safety check: NotesMIT
FigureMuuuun/luxas1.2k—~1.2kAutomated safety check: PassMIT
Gemini Image Generatordair-ai/dair-academy-plugins6142 repos~3.5kAutomated safety check: NotesMIT

Similar skills

  • Generates or edits images from text prompts through a Python script that picks an image backend based on which API keys are configured.

    47k GitHub stars~1.3k tokensUpdated yesterday
    Media & CreativeAuto-check passed
  • BlockRun Image Generation

    BlockRunAI/ClawRouter

    Generates or edits images through ClawRouter's local image API, with a choice of models and sizes and payment handled automatically through x402.

    6.6k GitHub stars~2.1k tokensUpdated 6 days ago
    Media & CreativeAuto-check passed
  • Antigravity Gemini Image

    uluckyXH/OpenMOSS

    Generate or edit images using the Antigravity-hosted Gemini image model via the local gateway.

    1.3k GitHub stars~730 tokensUpdated 3 mo ago
    Media & CreativeAuto-check: notes
  • Figure

    Muuuun/luxas

    Hybrid figure pipeline (Nano Banana raster + rembg background removal + TikZ vector assembly).

    1.2k GitHub stars~1.2k tokensUpdated 1 mo ago
    Media & CreativeAuto-check passed
  • Gemini Image Generator

    dair-ai/dair-academy-plugins

    Generates and edits images with Google's Gemini Nano Banana Pro model through the Gemini API, including photo edits and multi-image composition.

    614 GitHub starsUsed in 2 repos~3.5k tokens
    Media & CreativeAuto-check: notes
  • Nanobanana

    ReScienceLab/opc-skills

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

    1.8k GitHub stars~1.3k tokensUpdated yesterday
    Media & CreativeAuto-check passed

More from intellectronica/agent-skills

All 21 skills in this repo
  • Beautiful Mermaid

    intellectronica/agent-skills

    Render Mermaid diagrams as SVG and PNG using the Beautiful Mermaid library.

    295 GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check passed
  • Gpt Image 1 5

    intellectronica/agent-skills

    Generate and edit images using OpenAI's GPT Image 1.5 model.

    295 GitHub stars~1.5k tokensUpdated 5 mo ago
    Auto-check passed
  • Nano Banana Pro

    intellectronica/agent-skills

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

    295 GitHub stars~1.1k tokensUpdated 5 mo ago
    Auto-check passed
  • Notion API

    intellectronica/agent-skills

    This skill provides comprehensive instructions for interacting with the Notion API via REST calls.

    295 GitHub starsUsed in 1 repo~3.7k tokens
    Auto-check passed
  • Markdown Converter

    intellectronica/agent-skills

    Convert documents and files to Markdown using markitdown. An agent skill from intellectronica/agent-skills.

    295 GitHub starsUsed in 4 repos~492 tokens
    Auto-check passed
  • Youtube Transcript

    intellectronica/agent-skills

    Extract transcripts from YouTube videos. An agent skill from intellectronica/agent-skills.

    295 GitHub starsUsed in 2 repos~394 tokens
    Auto-check passed

Works with

Questions about Nano Banana 2

What does Nano Banana 2 do?

Generate and edit images using Google's Nano Banana 2 (Gemini 3.1 Flash Image Preview) API. Nano Banana 2 is an agent skill from intellectronica/agent-skills.1 Flash Image Preview) API.

When should I use Nano Banana 2?

Nano Banana 2 fits situations like: especially when they need fast iteration; explicit aspect-ratio control; resolution control from 512px to 4K.

How do I install Nano Banana 2 in Claude Code?

Run `npx skills add intellectronica/agent-skills --skill nano-banana-2 -a claude-code`. Or copy the skill folder (skills/nano-banana-2 in intellectronica/agent-skills) into .claude/skills/nano-banana-2 in your project. Claude Code loads it when a task matches its description.

How do I install Nano Banana 2 in Codex?

Run `npx skills add intellectronica/agent-skills --skill nano-banana-2 -a codex`. Or copy the skill folder (skills/nano-banana-2 in intellectronica/agent-skills) into .agents/skills/nano-banana-2 in your project. Codex loads it when a task matches its description.

Can I use Nano Banana 2 in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add intellectronica/agent-skills --skill nano-banana-2 -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/nano-banana-2, .gemini/skills/nano-banana-2, .github/skills/nano-banana-2 and .opencode/skills/nano-banana-2 in your project.

What does Nano Banana 2 need to run?

Going by SKILL.md and its folder, Nano Banana 2 needs Python for the scripts in its folder, the command-line tools its instructions call (uv) and credentials named GEMINI_API_KEY. Our summary lists: Python 3; A credential in GEMINI_API_KEY.

Does Nano Banana 2 access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Nano Banana 2 safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Nano Banana 2 use?

Nano Banana 2 is published under the CC0-1.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nano Banana 2 use?

About 972 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Nano Banana 2?

Skills that share tags, products or a category with Nano Banana 2: AI Image Generation and Editing (zhayujie/CowAgent, 47k stars), BlockRun Image Generation (BlockRunAI/ClawRouter, 6.6k stars), Antigravity Gemini Image (uluckyXH/OpenMOSS, 1.3k stars) and Figure (Muuuun/luxas, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Nano Banana 2?

intellectronica (a GitHub user) maintains it in intellectronica/agent-skills, which has 295 GitHub stars. The repository holds 21 skills in this directory. The repository was last updated on April 25, 2026.

Source: intellectronica/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.