Nano Banana Edit
Put someone else's gaze in your photo without touching anything else
- image
- target_image
- edited_image
- used_prompt
- debug_info
First, the disclaimer that saves you five minutes of confusion: the name is a lie. Nano Banana Edit doesn't run a local model at all - it's a thin wrapper around Google's Gemini image API, the same Nano Banana that tops the leaderboards. You hand it an image, it hands Google a face crop, Google sends back an edited image, and the node composites the changed part back onto your original. All you need is an API key from aistudio.google.com and money in your account, because this is pay-per-image.
What makes it interesting is the gaze thing. Wire a second image into target_image and the node figures out which direction those eyes are looking, auto-generates a prompt like "edit only the eyes so both pupils look to their left," and - here's the clever part - checks its own work. After each edit it re-measures the gaze, and if it's still off, it retries from scratch up to max_retries times (default 2). That verify-and-retry loop is the whole point of this node over the simpler sibling NanoBananaEyeMatch, and it works because the edit is deliberately small: only the eye region goes to the API, so everything else - hair, skin, clothing, background - stays untouched on the original. The face crop is detected with InsightFace's buffalo_l landmarks, then pasted back with an elliptical, Gaussian-blurred soft mask.
The inputs that actually matter
- image - what gets edited.
- api_key - your Google AI Studio key. Leave it blank and the node raises "API key is required" before it spends a cent.
- model -
Nano Banana 2 (Flash)(thegemini-3.1-flash-image-previewmodel) orNano Banana Pro(gemini-3-pro-image-preview). Flash is the speed/price sweet spot; Pro is 4K-capable and noticeably better but pricier. - detect_mode -
geminiuses a Gemini vision model to compare gaze (accurate, costs a couple of "won" per check),insightfaceuses local landmarks (free, less accurate). The default is gemini because it's the whole reason to use this node. - compare_model - which vision model does the comparing, from cheap
gemini-2.5-flash(~1 won) to the defaultgemini-2.5-pro(~10 won). That's real money across the compare → edit → verify loop, not a typo. - composite_mode -
eyes_only(default) pastes just the eye region back onto the original;fullreturns Google's entire edited image. - target_image (optional) - feed this for gaze-matching. prompt (optional) - your manual edit prompt, ignored when target_image is connected.
- blend_radius (default 30), gaze_threshold (default 0.03, insightface mode only), max_retries, save_debug (dumps intermediates to
ruucm-comfy/debug_output/).
Outputs: edited_image (IMAGE), used_prompt (STRING - handy to see what it actually asked for), and debug_info (STRING with the whole comparison/verify log).
Installing and getting it running
It ships in Ruucm's ComfyUI Nodes pack, so install it once:
cd ComfyUI/custom_nodes
git clone https://github.com/ruucm/ruucm-comfy
Then restart ComfyUI. (ComfyUI Manager users can just search "ruucm".) The pack's requirements.txt pulls in insightface and onnxruntime-gpu - InsightFace is famously one of the worst installs in local AI, and on first run it also downloads the ~326MB buffalo_l model pack automatically, so expect a slow first run. Two things the README doesn't tell you: the Nano Banana nodes need that API key wired in, and the front end is served from a prebuilt dist/ folder - you do not need to run npm install unless you're hacking on the UI.
Where people get burned
- The cost. A gaze-matched edit is compare + edit + verify per attempt, times
max_retries. Ten "won" per comparison at the default compare model makes a few bad attempts a real bill. Start withgemini-2.5-flashfor the compare model and only switch to pro if gaze matching is missing badly. - Censorship. Nano Banana is aggressively filtered - the KB calls it "powerful, unimaginative, massive hidden biasing." It refuses plenty of real-person and IP edits, and a refusal shows up as a failed attempt, not a clean error.
- InsightFace install breakage. If the node errors on
insightface.app, that's the environment, not your prompt. See the InsightFace panel for the full saga; the 2026 1.0 release finally dropped the C++ build requirement. - No face detected - the node falls back to editing the full image, defeating the whole surgical trick.
Worth it? If you need a character's gaze redirected to match a reference - portraiture, talking-head reanimation, fixing "everyone looks at the camera" - it's the one-click version of a workflow that otherwise needs LivePortrait plus a calibration nightmare. Just keep an eye on the won counter.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| api_key | STRING | Google AI API key (from aistudio.google.com) | |
| model | COMBO | Nano Banana 2 (Flash) | 2 options: Nano Banana 2 (Flash), Nano Banana Pro |
| output_quality | COMBO | original | Output resolution. 'original' keeps the input size. |
| composite_mode | COMBO | eyes_only | full: return entire edited image. eyes_only: paste only the eye region onto the original. |
| blend_radius | INT | 301–100 | Gaussian blur radius for eye region blending (eyes_only mode). |
| detect_mode | COMBO | gemini | gemini: use Gemini vision for gaze comparison. insightface: use local landmarks (free, less accurate). |
| compare_model | COMBO | gemini-2.5-pro (accurate, ~10 won) | Model used for gaze comparison. Only used in gemini detect_mode. |
| gaze_threshold | FLOAT | 0.030–0.5 | Minimum gaze difference to trigger edit. Only used in insightface detect_mode. |
| max_retries | INT | 21–5 | Max edit attempts. After each edit, gaze is verified. If worse, retries from scratch. Only used with target_image. |
| save_debug | BOOLEAN | false | Save intermediate images and debug info to ruucm-comfy/debug_output/ |
| target_imageopt | IMAGE | Target image whose gaze direction to match. If provided, gaze is compared and prompt is auto-generated. | |
| promptopt | STRING | Manual edit prompt. Ignored when target_image is connected. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| edited_image | IMAGE | — |
| used_prompt | STRING | — |
| debug_info | STRING | — |