/nano-banana:nano-bananafrom nano-banana
Generates and edits images via Google's Gemini API (Nano Banana models) with cost estimates, daily limits, and batch processing. Handles icons, mockups, banners, photo edits, and project asset workflows.
Ships in nano-banana. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The scripts live in scripts/ in this skill's folder (<skill-dir> below is the folder that holds this SKILL.md). Run them with uv, which installs what they need by itself:
| Script | Does | Needs |
|---|---|---|
generate.py | generates and edits images: price estimate, limits, batch jobs, spending ledger | google-genai |
finish.py | crops, converts, cuts out, icon sets, contact sheets, marked areas, asset lockfile | Pillow |
gallery.py | static HTML gallery of an output folder | nothing |
uv run --script <skill-dir>/scripts/generate.py "English prompt" [options]
Prices and model data live in scripts/models.json; scripts/nb_shared.py holds code the scripts share.
| 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 models 2.1 and 2. Without it, edits keep the input's shape and the model picks one for new images (16:9 in tests), so always pass it for new images |
-i photo.jpg | input image for editing or as a reference, repeatable (max 14, together at most about 14 MB) |
-t minimal / medium / high | thinking level (2.1: all three, default medium; 2 and lite: minimal/high; Pro: not configurable) |
--search | Google Search grounding incl. image search (2.1, 2, Pro; not lite) |
--follow-up IMAGE | edit an earlier result with a new prompt; the model remembers the image. Give the image path (its .txt holds the ID) or an interaction ID |
-n 4 | number of images, each one is billed |
-o folder | output folder, default .cache/nano-banana in the current directory (with a .gitignore that ignores it) |
--name hero | file-name stem instead of the start of the prompt |
--format png / jpeg | output file format. Models 2.1, 2 and lite return only JPEG (also without the option); the script refuses png for them. Convert with finish.py instead |
--prompt-file file | read the prompt from a file instead of the command line |
--no-store | ask Google not to keep the interaction (then --follow-up is impossible) |
--delete IMAGE or ID | delete a stored interaction at Google (sensitive photos); generates nothing |
--batch | half price, the result can take up to 24 h (models 2.1 and lite only); only when the user asks for it |
--wait 8 | with --batch: minutes to wait before exiting (default 8, 0 = submit and exit) |
--batch-result [JOB] | collect a batch job: saves its images if it is done, otherwise reports its state. Default: the last job recorded in the output folder |
--estimate | only print the estimated price, generate nothing |
--max-cost 0.50 | stop before the API call when the estimate is above this many USD (default 0.50) |
--daily-limit 2 | stop before the API call when today's spending plus the estimate is above this many USD (default off) |
--no-brand | ignore the project's brand kit for this run |
--currency CZK | also show prices in another currency (rate from the Czech National Bank, cached for 12 hours) |
The script checks that the model supports the requested combination before it calls the API. For every call it prints how long the API took, the path of each image as soon as it is saved, and the real cost from the reported tokens: image output, thinking and input (on 2.1 at 1K, thinking and the short text answer added 0.3-0.9 US cents per image in tests). Next to every image it saves a .txt file with the prompt, the options, the interaction ID, the duration and the cost. If a call of an -n run fails, the images saved before it stay, the run stops, and a summary lists what was saved and what failed (exit code 1).
Every billed call also goes into a per-user spending ledger outside the project, and each run ends with Spent with nano-banana: today ..., this month ... (plus search-grounded calls this month, 5,000 of which are free). Details in references/project-workflow.md, section 6.
Defaults for --currency, --max-cost and --daily-limit can come from the environment (NANO_BANANA_CURRENCY, NANO_BANANA_MAX_COST, NANO_BANANA_DAILY_LIMIT) or from ~/.config/nano-banana/config.json ({"currency": "CZK", "max_cost": 0.5, "daily_limit": 2}). The command line wins over the environment, the environment over the file.
Put a long prompt in a file (--prompt-file .cache/nano-banana/prompt.txt) rather than into the command line. That avoids shell quoting problems.
| Model | Use it when | Price 1K / 2K / 4K (USD) |
|---|---|---|
| 2.1 | almost always: cheapest of the full-featured models, good text in images, follow-up edits, search; up to 10 object and 4 character references | 0.034 / 0.050 / 0.113 |
| 2 | only when you need 512 px or 2.1 fails. Deprecated by Google, no shutdown date yet; up to 10 object and 4 character references | 0.067 / 0.101 / 0.151 (512 px: 0.045) |
| pro | the hardest prompts, lots of text, professional output; up to 6 object and 5 character references plus 3 style references | 0.134 / 0.134 / 0.24 |
| lite | lots of simple images, 1K only, no search, weak at multi-image input and follow-ups | 0.034 |
All models take at most 14 input images in total. Prices are a snapshot from 28 Nov 2026 (USD per image, image output only). --estimate prints the number for the current options, and scripts/models.json is the one place to update when Google changes the price list (https://ai.google.dev/gemini-api/docs/pricing); a test checks that this table and the READMEs agree with it. Batch is half price where the table shows a batch price.
Google publishes no latency figures. Measured by the script on 28 Nov 2026 with model 2.1 at 1K and the default thinking level: 11.1-20.5 s per call over 13 calls, follow-up edits and edits of an input image included. One lite batch job with a single image took 2.6 minutes from submission to the end. Other models and sizes have no measurements here, and a slow call can take longer. The script prints the duration of every call and stores it in the .txt file; use those numbers as they accumulate.
A shell call killed by its timeout loses the image, and the image may still be billed. So:
-n runs or 4K. A default 2-minute timeout is too short for -n 4.--wait minutes (default 8, under a 10-minute tool limit) and exits with the command to collect the result later..nano-banana.json (brand kit; generate.py prints Brand kit: when it finds one), read it and keep its style, palette, rules and references in every prompt without asking again. Ask only for what is missing and changes the result. The purpose sets the resolution: web usually 2K, print 4K, previews 1K. When the user makes a series for a whole site or app and there is no kit, offer to save the approved style into one (references/project-workflow.md, section 1).-i. In the prompt, call them the binding reference for shape, proportions and coloring. From text alone the model confidently invents details that look plausible and are wrong.
Private photos of real people (the user, family, clients): ask whether to send them with --no-store before the first call; Google otherwise keeps them for 55 days.-a and -s, and warn that a negative_prompt field is read as plain text. If the user has no format preference, offer to convert JSON into flowing text.--max-cost (default 0.50 USD) or when it would take today's spending above --daily-limit, and prints the price. Then tell the user the price and wait for their go-ahead; raise a limit only after they agree, never on your own. Ask first for more than 4 images too, even when they fit under the limit. After a run, report the real cost it printed, and today's total when it is getting high.
After an error, read the Retry: line the script prints. A rejected request (4xx: invalid options, key, billing, quota or rate limit) was not billed, so fix the cause and run it again. A server error (5xx), a timeout or a dropped connection may have been generated and billed: do not retry on your own, tell the user and let them decide. The Saved: lines before the error are real images; use them.-n variants, run the finish.py --grid command the script prints and look at that one numbered sheet instead of each file; show it to the user so they can pick by number.--follow-up. Small changes go through --follow-up, and the prompt lists what must not change. It is cheaper and more consistent than generating again. Always pass the image you continue from: --follow-up path/to/that-image.jpg (or its interaction ID). Without a value the script takes the last image generated in the output folder, which may be another variant or another agent's image.
Faithful edits (everything must stay the same except one thing, such as the light or the time of day): pass the original image with -i and say in the prompt exactly what must not change (face, expression, direction of the gaze, pose, hands, objects, clothing, framing). In a test this kept far more of the original than --follow-up, which redraws the whole scene and tends to shift the pose and the gaze. Compare the result with the original and rerun a few times: the gaze and the head angle drift most.
One of several similar things, or an edit that must stay in one place: draw a box with finish.py photo.jpg --mark X,Y,W,H, pass the marked copy with -i, and use the template "Changing a marked area" in the prompting guide. The model finds the place well but may do less than asked; check it.
Same image in a higher resolution or another aspect ratio: sending the same prompt again with -s 4K or -a 9:16 gives a completely different image (a different person, for portraits). To keep the image, use --follow-up with the new -s or -a and a prompt like "Recreate this exact photo as a horizontal image... Keep everything else the same." In testing, a vertical portrait converted to horizontal this way kept the person, clothing, setting and light, and the model only painted in the surroundings. The model redraws the image, so compare the result with the original. If it is unclear whether the user wants the same image or a new variant, ask.-i in every later prompt and name it as the reference for the character or style ("the banana character from the provided image"). Google advises including previously generated images in later prompts to keep them consistent. Mind the reference limits in the model table. The brand kit's references serve the same purpose across sessions.-n), state the price first, and compare them on --grid sheets..cache/nano-banana are ignored by git through the folder's own .gitignore. Move an image that will be used into the project with finish.py ... -o <project path> --lock, finished for its purpose (next section); --lock records its prompt and options in the project's nano-banana.lock.json. When the user lost track of many images, offer gallery.py.Images for a whole page or app (placeholders in code, many assets at once, icons): follow references/project-workflow.md.
Use --batch only when the user asks for it (cheaper, but they wait up to 24 hours); never pick it on your own to save money. It is half price (a test run on 2.1 took about 2 minutes). The script records the job in batch-jobs.json in the output folder, waits up to --wait minutes, and saves the images right away if the job is done by then. Otherwise it exits normally and prints the command to collect the result. Collect later with --batch-result (the last recorded job) or --batch-result batches/..., using the same -o. A job that is still running is only reported; a finished job is saved once, and collecting it again lists the files instead of duplicating them. Ctrl+C while waiting stops only the waiting; the job keeps running and is billed.
The model returns fixed aspect ratios and sizes. For exact pixel dimensions, generate the nearest aspect ratio, then crop with finish.py (Pillow, installed by uv):
uv run --script <skill-dir>/scripts/finish.py hero.jpg --size 1200x630 --format webp
| Target | Pixels | Generate with | Finish with |
|---|---|---|---|
| Open Graph / social share image | 1200 x 630 | -a 16:9 -s 2K | --preset og |
| Full-width hero | 1920 x 1080 | -a 16:9 -s 2K | --size 1920x1080 --format webp |
| Square product or avatar | 1080 x 1080 | -a 1:1 -s 2K (1K is 1024 px, too small) | --size 1080x1080 |
| Instagram portrait | 1080 x 1350 | -a 4:5 -s 2K | --size 1080x1350 |
| Favicon and app icons | 16-512 | -a 1:1 -s 1K | --preset icons -o public/ |
--size WxH scales and crops to exactly that size (cover fit); --keep top / left / bottom-right ... chooses the part that stays (default center). --size 1200x only scales.--format webp (or avif, jpeg, png) with --quality 82 by default. WebP is the usual choice for photos and illustrations; PNG for flat graphics that need sharp edges.--preset icons writes favicon.ico, apple-touch-icon.png, icon-192.png and icon-512.png into a folder and prints the <link> tags and manifest entry; --preset og is 1200 x 630 WebP.--grid lays 2 or more images out in one numbered sheet; --mark X,Y,W,H draws a box around an area to edit; --lock records the result in the project's lockfile.finish.py logo.jpg --transparent (color from the corners) or --transparent "#d8d8d6". It removes only background connected to the image border, so the same color inside the subject stays. It is a color key, not a matting model: soft shadows, gradients, glows and hair stay or leave a fringe. In tests, a banana icon generated "on a plain, solid light grey background with no shadow" came out clean (96% of the pixels removed, no visible rim); on a sticker with a slight drop shadow the shadow remained as a grey rim. Open the result on a dark background and check the edges.finish.py writes next to the input (hero-1200x630.webp) or to -o, never over the input or into this skill's folder. Without any step it stops with an error instead of copying.The script looks for the key in GEMINI_API_KEY (or GOOGLE_API_KEY), otherwise in ~/.config/nano-banana/api-key. If it is missing, ask the user to create one in Google AI Studio with billing enabled and to save it themselves. Never print the key or store it in a project: it could be abused on the user's account. An error 402 or a message about depleted prepayment credits means the account needs credit; that request was not billed.
-i (step 2); neither text nor --search is enough. Even with photos, check the result against them.PROHIBITED_CONTENT, IMAGE_RECITATION): rephrase more neutrally, do not resend the same prompt.-a is reliable.--no-store. Do not send sensitive photos without --no-store; if they were sent already, remove them with --delete IMAGE (and the earlier interaction it names, if any).--search is billed separately from the image: 5,000 grounded prompts per month are free, then 14 USD per 1,000 search queries. Google requires the returned search suggestions to be displayed when you publish grounded output; the script saves them next to the image (batch jobs included). Search with real photos of people is not supported.generate.py, so the price checks, limits and the ledger apply.scripts/models.json and the model table above from the price list and the documentation.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jakubcurik/nano-banana --plugin nano-bananaOther plugins' skills for the same job