Agent skill

Nano Banana Image Generation

by steipete in steipete/agent-scripts

Generates and edits images with Google's Nano Banana 2 (Gemini 3.1 Flash Image) through a uv script, with a draft-then-final workflow and sizes from 512 to 4K.

MITAuto-check passedMedia & Creative

Install Nano Banana Image Generation

skills CLI
$ npx skills add steipete/agent-scripts --skill nano-banana-pro -a claude-code

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

GitHub CLI
$ gh skill install steipete/agent-scripts nano-banana-pro --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/steipete/agent-scripts.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nano-banana-pro .claude/skills/nano-banana-pro && 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-pro
GitHub stars
7.3k
Token cost
~1.5k tokens
SKILL.md length
661 words
Files
3 (incl. scripts)
Skills in repo
45
Repo updated
First seen
Licence
MIT

At a glance

Generates and edits images with Google's Nano Banana 2 (Gemini 3.1 Flash Image) through a uv script, with a draft-then-final workflow and sizes from 512 to 4K.

  • Works in 2 steps: api-key argument (use if user provided… → GEMINI_API_KEY environment variable
  • Generating an image from a text description with the Gemini image model
  • SKILL.md covers Usage, Default Workflow (draft →…, Resolution Options and API Key, plus 7 more sections
  • Runs Python scripts from its folder; calls uv and python3; needs GEMINI_API_KEY

What it does

The skill wraps scripts/generate_image.py, run with uv from your own working directory so output lands where you work. You pass a prompt and an output filename, optionally a resolution of 512, 1K, 2K or 4K, and for edits an input image path. It maps phrases such as thumbnail to 512, no mention of size to 1K, normal to 2K and high-res to 4K.

The default workflow is draft, iterate, final: render at 1K for quick feedback, change the prompt in small steps with a new filename each run (keeping the same input image when editing), and render at 4K only once the prompt is settled. The API key comes from the --api-key argument or the GEMINI_API_KEY variable, and the script exits with an error if neither exists. A preflight list checks that uv is installed, the key is set and the input file exists. The excerpt is cut off in the failures section.

When your agent uses it

  • Generating an image from a text description with the Gemini image model
  • Editing an existing image from written instructions
  • Iterating on a prompt at low resolution before a final render
  • Producing a high-resolution final image once the prompt is locked

Example prompts

  • “Generate a draft of a watercolor fox in a snowy forest and save it as fox-draft.png.”
  • “Edit photo.png so the background becomes a sunset beach and keep the subject unchanged.”
  • “The prompt is locked, so render the final version at 4K.”
  • “Make a thumbnail-size icon of a paper plane.”

Requirements

  • `uv` installed
  • A Gemini API key in GEMINI_API_KEY or passed with --api-key

Workflow steps

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

  1. api-key argument (use if user provided key in chat)
  2. GEMINI_API_KEY environment variable

What it can do on your machine

Read from SKILL.md and the folder at commit c6b28a2. 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 2 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • uv
    • python3

    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 Image Generation loads about 1.5k tokens when it runs. Until then it costs about 22 tokens; SKILL.md has 661 words of instructions outside code blocks.

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

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 steipete/agent-scripts at commit c6b28a2, republished under its MIT licence (© steipete). 661 words, ~1,528 tokens.

Download SKILL.mdSave it as .claude/skills/nano-banana-pro/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
nano-banana-pro
description
Nano Banana/Gemini image gen/edit: text/image input, 512-4K workflows.

Nano Banana 2 Image Generation & Editing

Generate new images or edit existing ones using Google's Nano Banana 2 API (Gemini 3.1 Flash Image).

Usage

Run the script using absolute path (do NOT cd to skill directory first):

Generate new image:

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

Edit existing image:

bash
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "editing instructions" --filename "output-name.png" --input-image "path/to/input.png" [--resolution 512|1K|2K|4K] [--api-key KEY]

Important: Always run from the user's current working directory so images are saved where the user is working, not in the skill directory.

Default Workflow (draft → iterate → final)

Goal: fast iteration without burning time on 4K until the prompt is correct.

  • Draft (1K): quick feedback loop
    • uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "<draft prompt>" --filename "yyyy-mm-dd-hh-mm-ss-draft.png" --resolution 1K
  • Iterate: adjust prompt in small diffs; keep filename new per run
    • If editing: keep the same --input-image for every iteration until you’re happy.
  • Final (4K): only when prompt is locked
    • uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "<final prompt>" --filename "yyyy-mm-dd-hh-mm-ss-final.png" --resolution 4K

Resolution Options

The Gemini 3.1 Flash Image API supports these output size values:

  • 512 - compact ~512px-class resolution
  • 1K (default) - ~1024px resolution
  • 2K - ~2048px resolution
  • 4K - ~4096px resolution

Map user requests to API parameters:

  • "512", "512px", "0.5K", "thumbnail", "tiny" → 512
  • No mention of resolution → 1K
  • "low resolution", "1080", "1080p", "1K" → 1K
  • "2K", "2048", "normal", "medium resolution" → 2K
  • "high resolution", "high-res", "hi-res", "4K", "ultra" → 4K

API Key

The script checks for API key in this order:

  1. --api-key argument (use if user provided key in chat)
  2. GEMINI_API_KEY environment variable

If neither is available, the script exits with an error message.

Preflight + Common Failures (fast fixes)

  • Preflight:

    • command -v uv (must exist)
    • test -n \"$GEMINI_API_KEY\" (or pass --api-key)
    • If editing: test -f \"path/to/input.png\"
  • Common failures:

    • Error: No API key provided. → set GEMINI_API_KEY or pass --api-key
    • Error loading input image: → wrong path / unreadable file; verify --input-image points to a real image
    • “quota/permission/403” style API errors → wrong key, no access, or quota exceeded; try a different key/account

Filename Generation

Generate filenames with the pattern: yyyy-mm-dd-hh-mm-ss-name.png

Format: {timestamp}-{descriptive-name}.png

  • Timestamp: Current date/time in format yyyy-mm-dd-hh-mm-ss (24-hour format)
  • Name: Descriptive lowercase text with hyphens
  • Keep the descriptive part concise (1-5 words typically)
  • Use context from user's prompt or conversation
  • If unclear, use random identifier (e.g., x9k2, a7b3)

Examples:

  • Prompt "A serene Japanese garden" → 2025-11-23-14-23-05-japanese-garden.png
  • Prompt "sunset over mountains" → 2025-11-23-15-30-12-sunset-mountains.png
  • Prompt "create an image of a robot" → 2025-11-23-16-45-33-robot.png
  • Unclear context → 2025-11-23-17-12-48-x9k2.png
Show full SKILL.md (289 more words)Show less

Image Editing

When the user wants to modify an existing image:

  1. Check if they provide an image path or reference an image in the current directory
  2. Use --input-image parameter with the path to the image
  3. The prompt should contain editing instructions (e.g., "make the sky more dramatic", "remove the person", "change to cartoon style")
  4. Common editing tasks: add/remove elements, change style, adjust colors, blur background, etc.

Prompt Handling

For generation: Pass user's image description as-is to --prompt. Only rework if clearly insufficient.

For editing: Pass editing instructions in --prompt (e.g., "add a rainbow in the sky", "make it look like a watercolor painting")

Preserve user's creative intent in both cases.

Prompt Templates (high hit-rate)

Use templates when the user is vague or when edits must be precise.

  • Generation template:

    • “Create an image of: <subject>. Style: <style>. Composition: <camera/shot>. Lighting: <lighting>. Background: <background>. Color palette: <palette>. Avoid: <list>.”
  • Editing template (preserve everything else):

    • “Change ONLY: <single change>. Keep identical: subject, composition/crop, pose, lighting, color palette, background, text, and overall style. Do not add new objects. If text exists, keep it unchanged.”

Output

  • Saves PNG to current directory (or specified path if filename includes directory)
  • Requires a new filename: existing files, hard links, and symlinks are rejected. Parent directories are created as needed, but symlinked path components are rejected; use their real directory paths instead. Absolute paths and paths outside the current directory remain supported on macOS and Linux.
  • Script outputs the full path to the generated image
  • Do not read the image back - just inform the user of the saved path

Offline output-safety regression tests (Pillow required): python3 -m unittest discover -s skills/nano-banana-pro/scripts -p 'test_*.py' from the repository root.

Examples

Generate new image:

bash
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "A serene Japanese garden with cherry blossoms" --filename "2025-11-23-14-23-05-japanese-garden.png" --resolution 4K

Edit existing image:

bash
uv run ~/.codex/skills/nano-banana-pro/scripts/generate_image.py --prompt "make the sky more dramatic with storm clouds" --filename "2025-11-23-14-25-30-dramatic-sky.png" --input-image "original-photo.jpg" --resolution 2K

© steipete, MIT. 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 2 other files (scripts) in skills/nano-banana-pro of steipete/agent-scripts.

  • SKILL.md
  • scripts/generate_image.py
  • scripts/test_generate_image.py

Open the folder on GitHubat commit c6b28a2

Compare with similar skills

Nano Banana Image Generation 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 Image Generation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nano Banana Image Generation this skillsteipete/agent-scripts7.3k—~1.5kAutomated safety check: PassMIT
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 steipete/agent-scripts

All 45 skills in this repo
  • Mac Fleet Maintenance

    steipete/agent-scripts

    Inventories and maintains a fleet of Macs from a desired-state file: package updates, repo and Xcode sync, and disk, backup and security health reports.

    7.3k GitHub stars~4.8k tokensUpdated yesterday
    Auto-check passed
  • Agent Transcript for PRs

    steipete/agent-scripts

    Finds a coding agent's session log, trims and redacts it, and inserts it into a GitHub PR or issue only when the user has asked for a transcript.

    7.3k GitHub starsUsed in 1 repo~698 tokens
    Auto-check passed
  • Parallels macOS VM Lab

    steipete/agent-scripts

    Uses a clean Parallels macOS VM to test GUI automation, TCC permission prompts and screenshot tools like Peekaboo, verifying results from outside the guest.

    7.3k GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed
  • ClawSweeper Status

    steipete/agent-scripts

    Reports ClawSweeper's status with a bundled script: workflow health, active workers, queue health and recently merged, reviewed, commented and closed items.

    7.3k GitHub stars~972 tokensUpdated yesterday
    Auto-check passed
  • GitHub Project Triage

    steipete/agent-scripts

    Produces maintainer-facing triage cards for a project's GitHub issues and pull requests, each with its URL, risk, test state, blockers and a next action.

    7.3k GitHub stars~4k tokensUpdated yesterday
    Auto-check passed
  • npm Registry Operations

    steipete/agent-scripts

    Handles npm registry tasks such as whoami checks, package name availability, name reservation and publishing, with credentials pulled from 1Password.

    7.3k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Nano Banana Image Generation

What does Nano Banana Image Generation do?

Generates and edits images with Google's Nano Banana 2 (Gemini 3.1 Flash Image) through a uv script, with a draft-then-final workflow and sizes from 512 to 4K. py, run with uv from your own working directory so output lands where you work. You pass a prompt and an output filename, optionally a resolution of 512, 1K, 2K or 4K, and for edits an input image path.

When should I use Nano Banana Image Generation?

Nano Banana Image Generation fits situations like: generating an image from a text description with the Gemini image model; editing an existing image from written instructions; iterating on a prompt at low resolution before a final render; producing a high-resolution final image once the prompt is locked.

How do I install Nano Banana Image Generation in Claude Code?

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

How do I install Nano Banana Image Generation in Codex?

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

Can I use Nano Banana Image Generation 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 steipete/agent-scripts --skill nano-banana-pro -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-pro, .gemini/skills/nano-banana-pro, .github/skills/nano-banana-pro and .opencode/skills/nano-banana-pro in your project.

What does Nano Banana Image Generation need to run?

Going by SKILL.md and its folder, Nano Banana Image Generation needs Python for the scripts in its folder, the command-line tools its instructions call (uv and python3) and credentials named GEMINI_API_KEY. Our summary lists: `uv` installed; A Gemini API key in GEMINI_API_KEY or passed with --api-key.

Does Nano Banana Image Generation 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 Image Generation 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 Image Generation use?

Nano Banana Image Generation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Nano Banana Image Generation use?

About 1.5k tokens (SKILL.md is roughly 6.1k 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 Image Generation?

Skills that share tags, products or a category with Nano Banana Image Generation: 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 Image Generation?

steipete (a GitHub user) maintains it in steipete/agent-scripts, which has 7,333 GitHub stars. The repository holds 45 skills in this directory. The repository was last updated on October 10, 2026.

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