Nodes/Gemini Nano Banana for ComfyUI/🍌 Gemini Nano Banana
ComfyUI Node

🍌 Gemini Nano Banana

Nano Banana in ComfyUI, but the name is a lie — it's a paid API call

By orion4d·Created 12 months ago·Updated 12 months ago· 12
🍌 Gemini Nano Banana
  • image1
  • image2
  • image3
  • image4
  • image
  • text_output
◄promptA beautiful cinematic photo.â–ș
◄seed0â–ș
◄enable_upscalefalseâ–ș
◄upscale_modelâ–Ÿâ–ș
◄upscale_factor2.0â–ș
◄upscale_methodâ–Ÿâ–ș

This is not a local model

Let's get the important thing out of the way first: despite the "Nano" in the name and the fact that it lives in ComfyUI, this node downloads nothing and generates nothing on your machine. GeminiNanoStudio is a thin wrapper around Google's Gemini API. It ships your prompt (and optionally up to four images) to gemini-2.5-flash-image-preview - that's Nano Banana, Google's rebrand of Gemini-native image generation - waits for the response, and hands the returned image back to your graph. No GPU needed, no checkpoint to download. What it needs instead is a Google API key and an internet connection, and every call costs you money.

Why would you bolt a paid cloud model into a tool built to keep everything local? Because Nano Banana is genuinely good at what local diffusion models are weakest at: faithful image-to-image editing, style transfer that actually holds, multi-image blending. The community has been using it in ComfyUI to produce character sheets and varied reference sets for LoRA training. So think of this node as a bridge: local pipeline on one side, Google's closed model on the other.

How it works

The mechanism is straightforward. On every run it reads your API key from a file called apikey.txt in the node's folder - never from the workflow JSON or image metadata, which matters more than it sounds: ComfyUI workflows get shared and embedded in PNGs all the time, and a hardcoded key would leak with every export. Then it builds the request: your prompt plus any connected images converted to PIL. Connect nothing and it's text-to-image; connect one image and describe the edit; connect several for fusion.

There's a genuine gotcha hiding in the seed input. The node accepts it - and then never uses it. Look at the source: seed is in the function signature and nothing reads it afterward. Gemini's API doesn't take a seed parameter, so you get no reproducibility here. Don't expect to re-run the same seed and get the same banana. The model string is also hardcoded to the base Flash Image preview; there's no dropdown to switch to Nano Banana Pro or Nano Banana 2, so if you want those you're editing source or using a different pack.

The inputs and outputs that matter

The full list is short, and you'll only touch a few:

  • prompt - multiline, and it does the heavy lifting. The author ships a "100 Prompts" guide with the pack (pattern: keep → style → add details) that's worth a skim before you start fighting the model.
  • image1–image4 - optional IMAGE inputs. Leave them empty for text-to-image; wire one in for editing, several for multi-image blend.
  • enable_upscale + upscale_model / upscale_factor / upscale_method - a built-in upscaler on the output. If you pick a real ComfyUI upscale model it uses that; otherwise it falls back to OpenCV resizing with your chosen method (lanczos is the sensible default).

Outputs are image (the generated/edited result) and text_output (whatever text Gemini returned alongside - handy for debugging, wire it to a ShowText node or just read the console). Two things to know before you judge your first result: every image carries Google's invisible SynthID watermark, and Nano Banana is aggressively filtered. The KB sums up the community verdict as "powerful, unimaginative, massive hidden biasing" - it'll refuse or silently rewrite plenty of prompts that your local model would shrug at.

Installing it

There's no requirements.txt in this repo, so ComfyUI Manager can clone the node but won't install its dependencies for you - that's the trap. You need these, into your ComfyUI venv:

cd ComfyUI
source venv/bin/activate   # or venv\Scripts\activate on Windows
pip install google-generativeai opencv-python

Then either use Manager (search "Gemini Nano Banana") or:

cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/Gemini_Banana_by_orion4d.git

Next, the step the README calls "Very Important": create apikey.txt in ComfyUI/custom_nodes/Gemini_Banana_by_orion4d/, paste your Google API key from AI Studio in it, and nothing else. Restart ComfyUI and you'll find the node under Gemini Banana.

Where people get burned

  • Error 429 - you hit the quota. The README says wait 2–3 minutes; with the free tier that's a daily rhythm, not a one-off.
  • "apikey.txt not found" - it's empty or in the wrong folder. It must be at the root of the node directory with only the key inside.
  • Node not showing up - you restarted, right? Custom nodes load at startup.
  • Upscale surprise - the upscale_factor multiplier only applies when upscale_model is "None". Pick a real model and the model's own scale (2x, 4x, 8x) wins.

Worth the setup if you want Google's editing magic inside your graph. Just don't mistake the banana for something that runs on your GPU.

CategoryGemini Banana

Inputs (10)

NameTypeDefaultDescription
promptSTRINGA beautiful cinematic photo.—
seedINT00–18446744073709550000—
image1optIMAGE—
image2optIMAGE—
image3optIMAGE—
image4optIMAGE—
enable_upscaleoptBOOLEANfalse—
upscale_modeloptCOMBO1 options: None
upscale_factoroptFLOAT2.01–8—
upscale_methodoptCOMBO4 options: lanczos, nearest-exact, bilinear, area

Outputs (2)

NameTypeDescription
imageIMAGE—
text_outputSTRING—