jakubcurik/nano-banana
About
Agent skill for generating and editing images with Google's Nano Banana (Gemini) models, with cost estimates and a prompting guide. Unofficial.
Design & MediaMeasured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
nano-banana
Images from your coding agent, with the bill under control.
Install · Quick start · Gallery · How it works · For a whole project · Models and prices · FAQ
English · 简体中文 · Español · 日本語 · Português (Brasil) · Deutsch · Français · 한국어 · Čeština
nano-banana is an agent skill that lets Claude Code and other coding agents make and edit images with Google's Nano Banana models. It also keeps track of what that costs.
Ask an agent for a hero image and you get one. Ask it to "try a few more variations" and a plain API call can run a dozen 4K generations while you are still looking at the first. Every image is billed, and nothing in the chat tells you how much.
This skill prints the estimated price before each call and the real cost after it, thinking and input tokens included, and keeps a running total for the day and the month. A run whose estimate is above your limit (0.50 USD unless you set another) stops before anything is sent, and so does a run that would take the day above your daily limit, if you set one. It checks your options against what the chosen model supports, so a wrong size or an unsupported thinking level fails on your machine and not at the API. For everything else it gives the agent a short routine: work out what the image is for, get reference photos when the subject has to look like something real, write the prompt in English, and look at the result before calling it done.
Version 2 adds what a project with more than one image needs: a brand kit that keeps every image in one style, finished assets that remember the prompt they came from, favicons and app icons in one command, numbered contact sheets for comparing variants, and an HTML gallery of everything generated.
Unofficial. Not affiliated with or endorsed by Google. "Nano Banana" and "Gemini" are Google's names for its image models and API.
See it work
That is a real run. The image itself is estimated at 0.0336 USD for 1K on the default model. The real cost after the call adds the thinking, the model's short text answer and the prompt, 0.0426 USD here, and the output shows that the call took 18 seconds.
Gallery
Apart from the text and the terminal screenshot, every image in this README was made with the skill. Every person, place and object in them is AI-generated. The prompts are in assets/prompts.
Phone-style photos. A banana taped to a gallery wall, buckled into a shopping cart and belted into a car seat. Model 2.1, 2K, 3:4, about 5 cents each.
Edit with --image. A flash photo at night became a sunny afternoon. Everything except the light stayed the same. Model 2.1, 1K, about 3 cents.
Graphics. An infographic and a text poster on Model Pro (2K, about 13 cents each), and a flat vector illustration on Model 2.1 (2K, about 5 cents).
Same mascot, new scenes with --follow-up. Model 2.1, 1K, about 3 cents each.
Install
Claude Code, from the plugin marketplace:
/plugin marketplace add jakubcurik/nano-banana
/plugin install nano-banana@nano-banana
Any agent that reads SKILL.md skills, through npx skills:
npx skills add jakubcurik/nano-banana
Or copy skills/nano-banana/ into your agent's skills folder by hand, for example ~/.claude/skills/ for Claude Code or ~/.agents/skills/ for Codex, Gemini CLI and Cursor.
You also need:
uv, which fetchesgoogle-genaiand Python 3.11+ on its own. Without it, install Python 3.11+ andpip install "google-genai>=3.6,<4".- A Gemini API key from Google AI Studio, with billing turned on. The image models have no free tier.
Give the script the key through the environment, or save it once outside any repository:
export GEMINI_API_KEY="your-key"
# or
mkdir -p ~/.config/nano-banana && printf '%s' "your-key" > ~/.config/nano-banana/api-key
Quick start
Ask your agent: "make a hero image for my coffee shop site, 16:9", "remove the car from this photo", "combine these two photos". The skill triggers on its own. It asks what the image is for, writes the prompt, tells you the price when it is not trivial, runs the script and checks the result.
You can also call the script yourself:
S=skills/nano-banana/scripts/generate.py
uv run --script $S "A flat illustration of a red apple on a white table" --estimate
uv run --script $S "A flat illustration of a red apple on a white table" -a 16:9 -s 2K --format jpeg
uv run --script $S "Make the apple green. Keep everything else the same." --follow-up
uv run --script $S "Put this product on a marble table" -i product.jpg -m pro -s 2K
uv run --script $S "A banner with the text \"Open daily\"" --batch -n 4 --currency EUR
uv run --script $S --batch-result
uv run --script $S "Same scene at dusk. Keep everything else the same." --follow-up .cache/nano-banana/20261128-101500-a-flat-illustration-2.jpg
uv run --script $S "A logo for a bakery" -a 1:1 -n 4 --daily-limit 2
F=skills/nano-banana/scripts/finish.py
uv run --script $F .cache/nano-banana/*-a-logo-for-a-bakery-*.jpg --grid
uv run --script $F .cache/nano-banana/hero.jpg --size 1920x1080 --format webp -o public/hero.webp --lock
uv run --script $F .cache/nano-banana/hero.jpg --preset og
uv run --script $F .cache/nano-banana/logo.jpg --transparent --preset icons -o public/
uv run --script $F photo.jpg --mark 820,310,240,180
uv run --script skills/nano-banana/scripts/gallery.py --open
Images land in .cache/nano-banana/, each next to a .txt file with the prompt, the options, the interaction ID, how long the call took and what it cost. The folder gets its own .gitignore, so nothing in it ends up in git. Every run ends with what you spent today and this month.
A batch job waits at most 8 minutes (--wait), then the script exits and tells you how to collect it. --batch-result saves the images once the job is done; running it again does not duplicate them.
All options
| Option | Meaning |
|---|---|
-m 2.1 / 2 / pro / lite |
model, default 2.1 or the brand kit's |
-s 512 / 1K / 2K / 4K |
resolution, default 1K or the brand kit's (512 only on model 2) |
-a 16:9 |
aspect ratio: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9; also 1:4, 4:1, 1:8, 8:1 on 2.1 and 2 |
-i photo.jpg |
input image for editing or as a reference, repeatable, max 14 |
-t minimal / medium / high |
thinking level, depends on the model |
--search |
Google Search grounding, including image search (not on lite) |
--follow-up [IMAGE or ID] |
continue from the last result, from a picked image (its .txt holds the ID), or from a given interaction |
-n 4 |
number of images, each billed separately |
-o folder |
output folder |
--name hero |
file-name stem instead of the start of the prompt |
--format png / jpeg |
output file format; 2.1, 2 and lite return only JPEG, so png is refused there |
--prompt-file file |
read the prompt from a file |
--no-store |
ask Google not to keep the interaction (this disables follow-ups on it) |
--delete IMAGE or ID |
delete a stored interaction at Google |
--batch |
half price, up to 24 h (models 2.1 and lite) |
--wait 8 |
minutes to wait for a batch job before exiting, 0 to submit and exit |
--batch-result [JOB] |
collect a batch job, by default the last one submitted into the output folder |
--estimate |
print the price estimate and stop |
--max-cost 0.50 |
stop before the call when the estimate is above this many USD |
--daily-limit 2 |
stop before the call when today's spending plus the estimate is above this many USD (off by default) |
--no-brand |
ignore the project's .nano-banana.json for this run |
--currency CZK |
also show prices in this currency (rate from the Czech National Bank, cached for 12 hours) |
--currency, --max-cost and --daily-limit can also come from NANO_BANANA_CURRENCY, NANO_BANANA_MAX_COST and NANO_BANANA_DAILY_LIMIT, or from ~/.config/nano-banana/config.json ({"currency": "EUR", "max_cost": 1, "daily_limit": 3}). The command line wins, then the environment, then the file.
--currency takes the codes in the Czech National Bank's daily table: AUD, BRL, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HUF, IDR, ILS, INR, ISK, JPY, KRW, MXN, MYR, NOK, NZD, PHP, PLN, RON, SEK, SGD, THB, TRY, USD, XDR, ZAR. Without a network the script uses its last cached table, or shows USD only.
finish.py takes --size WxH (cover fit and crop, --keep picks the part that stays), --format webp / avif / jpeg / png, --quality, --transparent [COLOR], --preset icons / og, --background (fill for the Apple touch icon and JPEG), --grid (several inputs), --mark X,Y,W,H and --lock.
gallery.py [FOLDER] [-o page.html] [--open] writes the HTML gallery, by default index.html in .cache/nano-banana.
How it works
The skill makes the agent work in a fixed order. It first works out what the image is for, from your request and your project, and asks only about what is missing. If the picture has to show a real species, product or place, it gets two or three reference photos and asks you to confirm them. Then it writes the prompt in English and estimates the price. Above 0.50 USD, or above your daily limit, the script itself refuses to run, and the agent raises the limit only after you agree; it also asks before more than four images. After generating, it looks at the result (several variants on one numbered sheet), fixes small things with a follow-up instead of starting over, and can crop and convert the image for the page it is meant for.
The full workflow is in SKILL.md. Prompt templates, edit templates and a list of common mistakes are in references/prompting.md.
For a whole project
When a site or an app needs more than one image, the skill keeps them together. The details are in references/project-workflow.md.
- Brand kit. A
.nano-banana.jsonin the project holds the style, the palette, consistency rules, approved reference images and the default model, size and aspect ratio. The agent writes the style into every prompt; the script takes the defaults. A kit cannot change your spending limits, so a cloned repository cannot raise them. - Asset lockfile.
finish.py --lockrecords each finished asset innano-banana.lock.json: the prompt, the model and options, the finishing steps, the cost of the source image and a checksum, with project-relative paths only. Anyone on the team can see how an image was made and generate it again after a rebrand. - Placeholders. Mark images in the code (
data-nano-banana="..."or a comment@nano-banana: ...), and the agent lists them with a total price, waits for one go-ahead, generates and finishes them, and fills insrc,width,heightandalt. - Icons and social images.
--preset iconsmakes favicon.ico, the Apple touch icon and the PWA icons from one square image and prints the HTML and manifest lines;--preset ogmakes the 1200 x 630 share image. - Gallery.
gallery.pyturns the output folder into one HTML page with search, filters, follow-up lineage and copy buttons. It loads nothing from the internet. - Spending. Every billed call goes into a ledger on your machine, outside all projects. It feeds the daily and monthly totals and
--daily-limit, counts search-grounded calls against the free 5,000 a month, and never counts a batch job twice.
Models and prices
Snapshot from 28 November 2026, USD per image. Thinking and input tokens come on top, usually less than a cent per image.
| Model | Best for | 1K | 2K | 4K |
|---|---|---|---|---|
2.1 (gemini-nano-banana-2.1) |
almost everything | 0.034 | 0.050 | 0.113 |
2 (gemini-3.1-flash-image) |
512 px; deprecated by Google, no shutdown date yet | 0.067 | 0.101 | 0.151 |
pro (gemini-3-pro-image) |
the hardest prompts, a lot of text | 0.134 | 0.134 | 0.240 |
lite (gemini-3.1-flash-lite-image) |
many simple images, 1K only, no search | 0.034 | n/a | n/a |
Prices and model data live in models.json, the one file the script reads when Google changes its price list; a test fails when the tables here and in SKILL.md no longer match it. --search is billed on top: 5,000 grounded prompts per month are free, then 14 USD per 1,000 search queries.
Good to know
- Google stores interactions so follow-ups work: 55 days on paid projects, 1 day on the free tier. Use
--no-storefor sensitive photos, or remove one afterwards with--delete. - Every generated image carries an invisible SynthID watermark.
- The model invents details. When a picture has to match a real species, product or building, give it 2-3 reference photos with
-i. The skill's workflow insists on that. - After an error the script says whether a retry is safe. A rejected request (4xx, such as a wrong option, a missing key or a quota) was not billed. A server error or a timeout may have been, so it never retries on its own.
- In the live checks, one 1K image on model 2.1 took 11.1-20.5 seconds (13 calls). An agent whose shell call times out loses an image it has paid for, so the skill tells it to allow enough time or run long jobs in the background.
- The model cannot return a transparent image: it delivers JPEG, and when asked for transparency it paints a fake checkerboard. Ask for a plain background and cut it out with
finish.py --transparent, which removes one flat color; soft shadows and gradients stay. - If you publish output made with
--search, Google requires showing its search suggestions. The script saves them next to the image. - To edit one of several similar things,
finish.py --markdraws a box for the model to aim at. In a test on 2.1 the model always removed the box and kept the edit inside it, but once it did only part of the edit and once nothing. Check the result.
FAQ
Google has its own gemini-api CLI. Why use this?
The CLI makes the call, and it does that well. This skill adds what sits around the call. You may want both.
Google gemini-api CLI and skills |
nano-banana | |
|---|---|---|
| Price estimate before, real cost after | no | yes |
| Expensive runs stop until you raise the limit | no | yes (--max-cost) |
| Spending today and this month, daily limit | no | yes (--daily-limit) |
| Says whether a failed call may have been billed | no | yes |
| Options checked against the model | no, the API rejects them | yes |
| Follow-up edits without copying IDs | manual | --follow-up |
| Prompt and options saved next to each image | no | yes |
| Batch results collectable in a later run | no | --batch-result |
| Crop, convert and cut out for the web | no | finish.py |
| Favicon and app icons, Open Graph image | no | --preset icons / og |
| Project style and a record of finished assets | no | brand kit, --lock |
| Prompting guide and templates | no | yes |
The CLI is a beta that moves quickly, so check both before you choose.
Does it work outside Claude Code?
The skill follows the open Agent Skills format, so other agents that load SKILL.md files can use it. I have tested it in Claude Code only.
Prices changed. What do I edit?
skills/nano-banana/scripts/models.json, and the tables in SKILL.md, here and in the translations. The tests tell you if one of them is left behind.
Why does it ask for reference photos? Without one, the model fills in the details of a real thing from its imagination, and the result looks plausible and wrong.
Contributing
Issues and pull requests are welcome, especially when Google changes models, prices or the API. Update models.json and the tables in SKILL.md and this README together. The translations in i18n/ were made with the help of AI, and corrections are welcome.
The offline tests need no API key and no network (the finish.py tests run when Pillow is installed and are skipped otherwise):
python -m unittest discover -s tests
License
Explore related projects
Loading…