Nodes/Ruucm's ComfyUI Nodes/Nano Banana Edit
ComfyUI Node

Nano Banana Edit

Put someone else's gaze in your photo without touching anything else

By ruucm·Created 2 years ago·Updated 6 months ago· 3
Nano Banana Edit
  • image
  • target_image
  • edited_image
  • used_prompt
  • debug_info
api_key
modelNano Banana 2 (Flash)
output_qualityoriginal
composite_modeeyes_only
blend_radius30
detect_modegemini
compare_modelgemini-2.5-pro (accurate, ~10 won)
gaze_threshold0.03
max_retries2
save_debugfalse
prompt

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) (the gemini-3.1-flash-image-preview model) or Nano 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 - gemini uses a Gemini vision model to compare gaze (accurate, costs a couple of "won" per check), insightface uses 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 default gemini-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; full returns 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 with gemini-2.5-flash for 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.

Categoryimage/ai

Inputs (13)

NameTypeDefaultDescription
imageIMAGE
api_keySTRINGGoogle AI API key (from aistudio.google.com)
modelCOMBONano Banana 2 (Flash)2 options: Nano Banana 2 (Flash), Nano Banana Pro
output_qualityCOMBOoriginalOutput resolution. 'original' keeps the input size.
composite_modeCOMBOeyes_onlyfull: return entire edited image. eyes_only: paste only the eye region onto the original.
blend_radiusINT301–100Gaussian blur radius for eye region blending (eyes_only mode).
detect_modeCOMBOgeminigemini: use Gemini vision for gaze comparison. insightface: use local landmarks (free, less accurate).
compare_modelCOMBOgemini-2.5-pro (accurate, ~10 won)Model used for gaze comparison. Only used in gemini detect_mode.
gaze_thresholdFLOAT0.030–0.5Minimum gaze difference to trigger edit. Only used in insightface detect_mode.
max_retriesINT21–5Max edit attempts. After each edit, gaze is verified. If worse, retries from scratch. Only used with target_image.
save_debugBOOLEANfalseSave intermediate images and debug info to ruucm-comfy/debug_output/
target_imageoptIMAGETarget image whose gaze direction to match. If provided, gaze is compared and prompt is auto-generated.
promptoptSTRINGManual edit prompt. Ignored when target_image is connected.

Outputs (3)

NameTypeDescription
edited_imageIMAGE
used_promptSTRING
debug_infoSTRING