Agent skill

Nano Banana Image Generator

by LichAmnesia in LichAmnesia/lich-skills

Generates or edits PNG images with Google's Nano Banana 2 model through a small script, with a choice of 512, 1K, 2K or 4K output.

MITAuto-check: notesMedia & Creative

Install Nano Banana Image Generator

skills CLI
$ npx skills add LichAmnesia/lich-skills --skill nano-banana -a claude-code

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

GitHub CLI
$ gh skill install LichAmnesia/lich-skills nano-banana --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/LichAmnesia/lich-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/nano-banana .claude/skills/nano-banana && 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
GitHub stars
234
Token cost
~1.1k tokens
SKILL.md length
401 words
Files
2 (incl. scripts)
Skills in repo
11
Repo updated
First seen
Licence
MIT

At a glance

Generates or edits PNG images with Google's Nano Banana 2 model through a small script, with a choice of 512, 1K, 2K or 4K output.

  • Works in 3 steps: Get a Gemini API key:… → Export it → Install uv if missing
  • Creating a thumbnail, cover image, poster or icon from a text description
  • SKILL.md covers When to use, When NOT to use, Setup and Generate, plus 10 more sections
  • Runs Python scripts from its folder; calls uv, curl and sh; reaches astral.sh; needs GEMINI_API_KEY and GOOGLE_API_KEY

What it does

The skill calls Google's Nano Banana 2 model (gemini-3.1-flash-image-preview) through scripts/generate_image.py, run with uv. You give it a prompt and an output filename and it saves a PNG, either from text alone or from an input image plus an instruction such as removing a crowd or swapping a background.

Resolution defaults to 1K and can be set to 512, 1K, 2K or 4K; when editing, the output matches the input image's size unless you pass a resolution. The skill translates loose wording such as thumbnail or high quality into those settings. It only makes images, so it is not meant for video, pixel-exact UI mockups or licensed stock photos. A Gemini API key goes in GEMINI_API_KEY or GOOGLE_API_KEY, and the first run installs google-genai and pillow through uv.

When your agent uses it

  • Creating a thumbnail, cover image, poster or icon from a text description
  • Editing an existing image: background change, object removal or style swap
  • Making a quick visual for a README, blog post or slide

Example prompts

  • “Generate a 2K poster of a lighthouse at dusk and save it as lighthouse.png.”
  • “Remove the people behind the subject in photos/team.jpg and keep the colors the same.”
  • “Make a small thumbnail for the blog post about Postgres indexing.”

Requirements

  • A Gemini API key in GEMINI_API_KEY or GOOGLE_API_KEY
  • uv installed to run the script

Workflow steps

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

  1. Get a Gemini API key: https://aistudio.google.com/app/apikey
  2. Export it
  3. Install uv if missing

What it can do on your machine

Read from SKILL.md and the folder at commit ebbc355. 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
    • curl
    • sh
    • gitleaks

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • astral.sh

    Also links to:

    • aistudio.google.com

    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
    • GOOGLE_API_KEY

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

Context cost

Nano Banana Image Generator loads about 1.1k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 401 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePipes a well-known installer script into a shellSKILL.md:36
    command -v uv || curl -LsSf https://astral.sh/uv/install.sh | sh

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 LichAmnesia/lich-skills at commit ebbc355, republished under its MIT licence (© LichAmnesia). 401 words, ~1,106 tokens.

Download SKILL.mdSave it as .claude/skills/nano-banana/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
nano-banana
description
Generate or edit images with Google's Nano Banana 2 (`gemini-3.1-flash-image-preview`). Use when the user asks to generate an image, edit an image, or create a picture. Supports 512 / 1K / 2K / 4K resolutions.

Nano Banana 2

Text-to-image and image edit via Google's Nano Banana 2 model, aka gemini-3.1-flash-image-preview. Fast, cheap, high-quality. Returns PNG.

When to use

  • User asks for an image, picture, photo, thumbnail, cover art, poster, icon, etc.
  • User provides an input image and wants it modified (background change, object removal, style swap)
  • You need a quick visual for a blog post, README, demo, or slide

When NOT to use

  • User wants a video — Nano Banana is image-only
  • User wants a pixel-perfect UI mockup — use a design tool
  • User needs a specific licensed stock photo — use a stock service

Setup

  1. Get a Gemini API key: https://aistudio.google.com/app/apikey

  2. Export it:

    bash
    export GEMINI_API_KEY="YOUR_KEY_HERE"
    # or
    export GOOGLE_API_KEY="YOUR_KEY_HERE"
  3. Install uv if missing:

    bash
    command -v uv || curl -LsSf https://astral.sh/uv/install.sh | sh

First run auto-installs google-genai and pillow via uv's inline script deps.

Generate

bash
uv run ~/.claude/skills/lich-skills/skills/nano-banana/scripts/generate_image.py \
    --prompt "A cinematic rainy Tokyo alley, neon reflections, 35mm, low angle" \
    --filename "tokyo-alley.png" \
    --resolution 1K

Output is saved to tokyo-alley.png in the current directory unless the filename is absolute.

Edit

Pass an input image with --input-image. The model sees the image + your instruction.

bash
uv run .../generate_image.py \
    --prompt "Remove the crowd behind the subject. Keep framing and grading unchanged." \
    --filename "cleaned.png" \
    --input-image "./portrait.png" \
    --resolution 2K

When editing, the script auto-matches output resolution to the input's dimensions unless you explicitly pass --resolution.

Flags

FlagDefaultPurpose
--prompt, -prequiredImage description or edit instruction
--filename, -frequiredOutput path (PNG)
--input-image, -i—Source image for editing
--resolution, -r1KOne of 512, 1K, 2K, 4K
--api-key, -kenvOverrides GEMINI_API_KEY / GOOGLE_API_KEY
--model, -mgemini-3.1-flash-image-previewRarely needed

Resolution mapping

Map loose user language to a resolution flag:

User saysUse
(nothing)1K
"small", "thumbnail", "quick draft"512
"normal", "medium"1K
"high quality", "large"2K
"4k", "print", "wallpaper"4K
Show full SKILL.md (157 more words)Show less

Prompt template (generation)

Subject: <subject>.
Style: <photo | illustration | 3D | painting | pixel art | ...>.
Composition: <shot type, angle>.
Lighting: <lighting description>.
Background: <background>.
Avoid: <what should NOT be in the image>.

Prompt template (editing)

Change only: <the specific edit>.
Keep subject, framing, lighting, palette, text, and overall style unchanged.

Being explicit about what to keep is the difference between a clean edit and a total re-render.

Environment

  • Key lookup order: --api-key → GEMINI_API_KEY → GOOGLE_API_KEY
  • Output format: PNG (RGBA converted to RGB on white background)
  • Never prints the API key or image bytes to stdout

Fast checks

bash
command -v uv
test -n "$GEMINI_API_KEY" || test -n "$GOOGLE_API_KEY"
# If editing:
test -f ./input.png

Common failures

ErrorFix
Error: No API key provided.Export GEMINI_API_KEY or pass --api-key
Error loading input image:Bad path or unreadable file
Error: No image was generated in the response.Prompt too vague or unsafe — rewrite
403 / quotaWrong key, region-locked, or over quota

Red flags

  • Hardcoding the API key in any script or example
  • Committing generated images to git without checking size
  • Re-running the same prompt 10 times hoping for luck — instead, rewrite the prompt with the template above

Verification

  • $GEMINI_API_KEY or $GOOGLE_API_KEY set in env, not in files
  • A test generation produces a PNG at the expected path
  • gitleaks detect --source . clean

© LichAmnesia, 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 1 other file (scripts) in skills/nano-banana of LichAmnesia/lich-skills.

  • SKILL.md
  • scripts/generate_image.py

Open the folder on GitHubat commit ebbc355

Compare with similar skills

Nano Banana Image Generator 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 Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Nano Banana Image Generator this skillLichAmnesia/lich-skills234—~1.1kAutomated safety check: NotesMIT
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 5 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 today
    Media & CreativeAuto-check passed

More from LichAmnesia/lich-skills

All 11 skills in this repo
  • Google Analytics 4 Analysis

    LichAmnesia/lich-skills

    Pulls Google Analytics 4 data through the Data API with TypeScript scripts and turns it into a daily SEO report or prioritized traffic and bounce-rate recommendations.

    234 GitHub stars~2k tokensUpdated 4 mo ago
    Auto-check: notes
  • Spec-Driven Development v2

    LichAmnesia/lich-skills

    Organizes long-running agent work into a Project, Sprint and Task hierarchy with per-task state files, isolated worktrees, review loops and script-checked rules.

    234 GitHub stars~3.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Tavily Web Search

    LichAmnesia/lich-skills

    Runs headless web searches and single-page extraction through the Tavily API from a Python script, returning cited, summarized results without a browser.

    234 GitHub stars~1k tokensUpdated 4 mo ago
    Auto-check: notes
  • Build Until Pass Loop

    LichAmnesia/lich-skills

    Drives a failing build, typecheck, lint or test command to a passing exit code through small, one-fix-at-a-time rounds, stopping at a hard attempt cap instead of looping forever.

    234 GitHub stars~2.8k tokensUpdated 4 mo ago
    Auto-check passed
  • Hypothesis-Driven Debugging

    LichAmnesia/lich-skills

    Replaces trial-and-error fixing with an observe, hypothesize, experiment and conclude loop kept in DEBUG.md, where no fix is allowed before evidence supports a cause.

    234 GitHub stars~2.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Spec-Driven Development

    LichAmnesia/lich-skills

    Runs a gated Spec, Plan, Build, Test, Review, Ship workflow so non-trivial changes are specified, verified and reviewed before they ship, with a named artifact per phase.

    234 GitHub stars~3.5k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Questions about Nano Banana Image Generator

What does Nano Banana Image Generator do?

Generates or edits PNG images with Google's Nano Banana 2 model through a small script, with a choice of 512, 1K, 2K or 4K output. py, run with uv. You give it a prompt and an output filename and it saves a PNG, either from text alone or from an input image plus an instruction such as removing a crowd or swapping a background.

When should I use Nano Banana Image Generator?

Nano Banana Image Generator fits situations like: creating a thumbnail, cover image, poster or icon from a text description; editing an existing image: background change, object removal or style swap; making a quick visual for a README, blog post or slide.

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

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

How do I install Nano Banana Image Generator in Codex?

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

Can I use Nano Banana Image Generator 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 LichAmnesia/lich-skills --skill nano-banana -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, .gemini/skills/nano-banana, .github/skills/nano-banana and .opencode/skills/nano-banana in your project.

What does Nano Banana Image Generator need to run?

Going by SKILL.md and its folder, Nano Banana Image Generator needs Python for the scripts in its folder, the command-line tools its instructions call (uv, curl, sh and gitleaks) and credentials named GEMINI_API_KEY and GOOGLE_API_KEY. Our summary lists: A Gemini API key in GEMINI_API_KEY or GOOGLE_API_KEY; uv installed to run the script.

Does Nano Banana Image Generator access the network?

SKILL.md names 2 domains. In commands or code: astral.sh; the agent is likely to contact it when it follows the instructions. As links in the text: aistudio.google.com. This is read from the text; nothing was executed.

Is Nano Banana Image Generator safe to install?

Our automated static check of SKILL.md found notes only (pipes a well-known installer script into a shell), nothing it rates as a warning. 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 Generator use?

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

About 1.1k tokens (SKILL.md is roughly 4.4k 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 Generator?

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

LichAmnesia (a GitHub user) maintains it in LichAmnesia/lich-skills, which has 234 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on June 9, 2026.

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