Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

nano-banana-edit — Claude Code skill: what it does, how to install

Edits images with Google Nano Banana 2 on RunComfy, preserving subject identity, swapping backgrounds, and handling batches up to 20 inputs.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add prime-skills/runcomfy-agent-skills --skill nano-banana-edit -a claude-code
Open on GitHub

What nano-banana-edit does

This skill calls the google/nano-banana-2/edit endpoint via the local RunComfy CLI. It focuses on image-to-image changes rather than generation from scratch. The model maintains subject identity, replaces backgrounds, and isolates changes with spatial directions like left or upper right. Each call accepts between 1 and 20 image URLs.

Prompting follows a strict pattern: declare what stays unchanged before specifying what needs to shift. Stating preservation up front keeps faces and framing stable. The request schema supports setting seed for reproducibility, adjusting aspect ratios, and selecting resolutions from 0.5K up to 4K.

Running edits will fail unless @runcomfy/cli is installed and authenticated via runcomfy login. Headless environments and CI setups require passing a token in RUNCOMFY_TOKEN. For localized text translation inside an image, routing to GPT Image 2 edit produces better results.

What it helps with

  • swap image backgrounds while keeping subject identity and clothing
  • remove or replace specific objects using spatial directions
  • process batches of up to 20 images with consistent framing
  • generate marketing variants across locked aspect ratios and resolutions

Example prompts for the agent

  • nano banana edit: keep the subject identity unchanged, convert the background into a studio setting
  • edit with nano banana: remove the leftmost object only, keep the lighting and table unchanged
  • image edit nano banana: replace the watermark in the bottom-right corner with clean text across these 3 images

How to install nano-banana-edit

1Skills CLI (Vercel)

npx skills add prime-skills/runcomfy-agent-skills --skill nano-banana-edit -a claude-code

2Manually: put the files in place

~/.claude/skills/nano-banana-edit/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/nano-banana-edit/

From the same set25

The whole set →
video-edit prime-skills This skill routes video edits to the right RunComfy model for restyling, background or packaging swaps, and motion transfer. Use it when edit intent matters. Claude Code CX Codex Cursor +1 439,300installs image-to-video prime-skills Routes still image animation tasks to the best RunComfy catalog model. Helps turn static pictures into videos without guessing model settings. Claude Code CX Codex Cursor +1 437,600installs nano-banana-2 prime-skills Skill to quickly generate images via Google Nano Banana 2 on RunComfy. Includes optimized prompting patterns, in-image typography support, and web grounding. Claude Code CX Codex Cursor +1 437,300installs image-edit prime-skills This skill routes image edits to a suitable RunComfy model. Use it for background swaps, text changes, masks, or batch work. Claude Code CX Codex Cursor +1 436,800installs flux-kontext prime-skills The skill edits a single image from one text instruction via Flux 1 Kontext Pro on RunComfy, useful for a targeted change that must keep face, pose or brand assets intact. Claude Code CX Codex Cursor +1 436,500installs wan-2-7 prime-skills This skill generates Wan 2.7 videos through RunComfy. Use it for clips with audio-driven lip-sync, reference media, and controlled camera motion. Claude Code CX Codex Cursor +1 435,900installs seedance-v2 prime-skills Generates cinematic short-form video using ByteDance Seedance 2.0 Pro via RunComfy. Useful for dialogue scenes with native lip-sync and multimodal references. Claude Code CX Codex Cursor +1 435,800installs happyhorse-1-0 prime-skills Skill to generate video with HappyHorse 1.0 on RunComfy. The model ranks #1 on Artificial Analysis Video Arena, produces 1080p video with synchronized audio in a single pass, and maintains character consistency across shots. Claude Code CX Codex Cursor +1 435,700installs

Similar

hads Niksa Barlovic This skill helps write and convert technical documentation into HADS, a Markdown format designed for both human and AI readers. Use it to check a document’s structure or prepare docs for AI coding workflows. Claude Code CX Codex Cursor 6,600installs skill-creator official anthropics Creates and refines skills, then tests them with prompts, evaluations, and performance checks. Claude Code Claude.ai 414,180installs writing-for-agents Matt Pocock Guidance for writing skills and agent-facing documents. Use it when editing AGENTS.md, CLAUDE.md, or reference files reached from them. Claude Code 466,719installs media-use heygen-com Finds or generates media for HyperFrames videos, including voiceovers, music, cutouts, and color grades. Stores files locally in assets. Claude Code CX Codex Cursor +1 1,100,000installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs subagent-driven-development Jesse Vincent This skill runs an implementation plan through fresh subagents for independent tasks and reviews each result. Use it for multi-step work in one session. Claude Code CX Codex 237,746installs orchestration stablyai Coordinates supervised Orca workers with task DAGs, decision gates, and threaded messages. Fits workflows that split work across multiple agents. Claude Code CX Codex Cursor +1 349,200installs

Questions about nano-banana-edit

How to install nano-banana-edit in Claude Code?

Run npx skills add prime-skills/runcomfy-agent-skills --skill nano-banana-edit -a claude-code in your terminal.

What does nano-banana-edit do?

It directs image-to-image edits to Google Nano Banana 2 through the RunComfy CLI. The tool preserves subjects across edits, isolates areas using spatial language, and processes up to 20 images per call.

What are the prerequisites for using this skill?

Install the CLI globally with npm i -g @runcomfy/cli and authenticate using runcomfy login. In automated environments, supply credentials via the RUNCOMFY_TOKEN environment variable instead.

Source text

SKILL.md · MIT
---
name: nano-banana-edit
displayName: "Nano Banana Edit — Pro Pack on RunComfy"
description: >
  Edit images with Google Nano Banana 2 (image-to-image edit endpoint)
  on RunComfy. Documents Nano Banana Edit's strengths (preserve subject
  identity, swap background, localize edits with spatial language,
  multi-image batch edits up to 20 inputs), the schema, and when to
  route to GPT Image 2 edit / Flux Kontext / Nano Banana 2 t2i instead.
  Calls `runcomfy run google/nano-banana-2/edit` through the local
  RunComfy CLI. Triggers on "nano banana edit", "edit with nano banana",
  "image edit nano banana", or any explicit ask to edit with this model.
homepage: https://www.runcomfy.com
license: MIT
---

# Nano Banana Edit — Pro Pack on RunComfy

[runcomfy.com](https://www.runcomfy.com/?utm_source=skills.sh&utm_medium=skill&utm_campaign=nano-banana-edit) · [Edit endpoint](https://www.runcomfy.com/models/google/nano-banana-2/edit?utm_source=skills.sh&utm_medium=skill&utm_campaign=nano-banana-edit) · [GitHub](https://github.com/agentspace-so/runcomfy-skills/tree/main/nano-banana-edit)

Google **Nano Banana 2 Edit** — the image-to-image edit endpoint of the Gemini-family flash-tier image model — hosted on the **RunComfy Model API**. Up to **20 input images per call** for batch edits and multi-reference variation.

```bash
npx skills add agentspace-so/runcomfy-skills --skill nano-banana-edit -g
```

## When to pick this model (vs siblings)

| You want | Use |
|---|---|
| Preserve subject identity, swap background or clothing | **Nano Banana Edit** |
| Edit up to 20 images consistently in one batch | **Nano Banana Edit** |
| Localize edit to "X only" with spatial language | **Nano Banana Edit** |
| Edit multilingual text inside the image (signs, labels) | GPT Image 2 edit |
| Single ref + precise local edit ("she's now holding X") | Flux Kontext |
| Generate a new image from scratch | Nano Banana 2 t2i (sibling skill) |

If the user said "nano banana edit" / "edit with nano banana" explicitly, route here regardless.

## Prerequisites

1. **RunComfy CLI** — `npm i -g @runcomfy/cli`
2. **RunComfy account** — `runcomfy login` opens a browser device-code flow.
3. **CI / containers** — set `RUNCOMFY_TOKEN=<token>` instead of `runcomfy login`.

## Endpoints + input schema

### `google/nano-banana-2/edit`

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `prompt` | string | yes | — | Edit instruction. Lead with preservation, end with the change. |
| `image_urls` | array | yes | — | **1–20** publicly-fetchable HTTPS URLs. |
| `number_of_images` | int | no | 1 | 1–4 outputs per call. |
| `seed` | int | no | — | Reproducibility. |
| `aspect_ratio` | enum | no | `auto` | `auto` (follows input) or fixed ratios — lock for batch consistency. |
| `resolution` | enum | no | `1K` | `0.5K` / `1K` / `2K` / `4K`. |
| `output_format` | enum | no | `png` | `png` / `jpeg` / `webp`. |
| `safety_tolerance` | int | no | 4 | 1 (strict) – 6 (permissive). |
| `limit_generations` | bool | no | — | If true, restricts each round to one output. |
| `enable_web_search` | bool | no | false | Web grounding (extra cost / latency). |

## How to invoke

**Single-image background swap, identity preserved:**

```bash
runcomfy run google/nano-banana-2/edit \
  --input '{
    "prompt": "Keep the subject identity, pose, and clothing unchanged. Convert the background into a rainy neon cyberpunk street.",
    "image_urls": ["https://.../portrait.jpg"]
  }' \
  --output-dir <absolute/path>
```

**Batch edit with locked framing:**

```bash
runcomfy run google/nano-banana-2/edit \
  --input '{
    "prompt": "Replace the watermark in the bottom-right with the text \"AURA\" in clean white sans-serif. Keep everything else exactly as in the input.",
    "image_urls": ["https://.../sku-1.jpg", "https://.../sku-2.jpg", "https://.../sku-3.jpg"],
    "aspect_ratio": "1:1",
    "resolution": "1K"
  }' \
  --output-dir <absolute/path>
```

**Targeted spatial edit ("left object only"):**

```bash
runcomfy run google/nano-banana-2/edit \
  --input '{
    "prompt": "Remove the leftmost object only. Keep the right two objects, the table, and the lighting unchanged.",
    "image_urls": ["https://.../still-life.jpg"]
  }' \
  --output-dir <absolute/path>
```

## Prompting — what actually works

**Preservation first, change last.** Always lead with `"Keep [identity / pose / clothing / brand / framing] unchanged."` Then state the change in one clean sentence. Models honor what's stated up front; tail-end preservations get ignored.

**Localize with spatial language.** "background only", "the left object", "the upper-right corner", "above the headline" — concrete spatial scopes are honored. "make it more X" is vague and drifts.

**Batch consistency** — when editing a series, lock `aspect_ratio` and `resolution`. Use the same prompt grammar across the batch so each output reads as a sibling, not a remix.

**Iterate small.** If a one-pass edit drifts, split into two: pass 1 changes background only, pass 2 swaps the subject's outfit. Cleaner edits, same total cost (assuming similar resolution).

**Multi-image variation** — pass up to 20 inputs to get a coherent batch. Useful for SKU galleries, A/B testing, character sheet variations.

**Anti-patterns:**
- Long compound instructions ("change A and B and C and D") — drift increases per added scope.
- Edit instructions written in passive voice ("the background should be changed") — be imperative.
- Missing preservation goals — model will subtly rewrite the face / brand.
- Aspect ratios that don't match input — causes crops or stretches.

## Where it shines

| Use case | Why Nano Banana Edit |
|---|---|
| **SKU gallery — same product on different backgrounds** | Batch of 20, identity-preserved, framing locked |
| **Influencer / spokesperson background swaps** | Strong identity preservation across edits |
| **Localized object removal / addition** | Spatial language honored |
| **A/B variants for ad creative** | Seed lock + multiple `number_of_images` |
| **Brand-asset relocalization** | Same composition with text / palette swap |

## Sample prompts (verified to produce strong results)

**Background swap (page example):**

```
Keep the subject identity unchanged. Convert the background into a rainy
neon cyberpunk street.
```

**Targeted text replacement:**

```
Keep the bottle, label, and lighting exactly as in the input.
Replace only the brand text on the label from "ALPHA" to "AURA",
same font weight, centered, white on black.
```

**Multi-image batch consistency:**

```
For each input image: keep the subject's pose and identity unchanged.
Convert the background to a soft warm-grey studio sweep with subtle
floor shadow. Center the subject at the same fraction of frame as the
input.
```

## Limitations

- **1–20 input images per call** — the first is treated as primary; the rest provide auxiliary cues.
- **1–4 outputs per call.**
- **Long compound prompts drift** — split into multiple passes.
- **Web search adds latency + cost** — only enable on demand.
- **For multilingual in-image text edits, GPT Image 2 edit wins.**

## Exit codes

| code | meaning |
|---|---|
| 0  | success |
| 64 | bad CLI args |
| 65 | bad input JSON / schema mismatch |
| 69 | upstream 5xx |
| 75 | retryable: timeout / 429 |
| 77 | not signed in or token rejected |

Full reference: [docs.runcomfy.com/cli/troubleshooting](https://docs.runcomfy.com/cli/troubleshooting?utm_source=skills.sh&utm_medium=skill&utm_campaign=nano-banana-edit).

## How it works

The skill invokes `runcomfy run google/nano-banana-2/edit` with a JSON body matching the schema. The CLI POSTs to `https://model-api.runcomfy.net/v1/models/google/nano-banana-2/edit`, polls the request, fetches the result, and downloads any `.runcomfy.net`/`.runcomfy.com` URL into `--output-dir`. `Ctrl-C` cancels the remote request before exit.

## Security & Privacy

- **Token storage**: `runcomfy login` writes the API token to `~/.config/runcomfy/token.json` with mode 0600 (owner-only read/write). Set `RUNCOMFY_TOKEN` env var to bypass the file entirely in CI / containers.
- **Input boundary**: the user prompt is passed as a JSON string to the CLI via `--input`. The CLI does NOT shell-expand the prompt; it transmits the JSON body directly to the Model API over HTTPS. No shell injection surface from prompt content.
- **Third-party content**: image / mask / video URLs you pass are fetched by the RunComfy model server, not by the CLI on your machine. Treat external URLs as untrusted; image-based prompt injection is a known risk for any image-edit / video-edit model.
- **Outbound endpoints**: only `model-api.runcomfy.net` (request submission) and `*.runcomfy.net` / `*.runcomfy.com` (download whitelist for generated outputs). No telemetry, no callbacks.
- **Generated-file size cap**: the CLI aborts any single download > 2 GiB to prevent disk-fill from a malicious or runaway model output.

© prime-skills · MIT · prime-skills/runcomfy-agent-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor