Nodes/Comfyui-geminiapi/Nano Banana Pro
ComfyUI Node

Nano Banana Pro

4K Gemini images without running a model

By zhanglongxiao111·Created 11 months ago·Updated 9 months ago· 3
Nano Banana Pro
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image_11
  • image_12
  • image_13
  • image_14
  • image
api_key
aspect_ratio
temperature0.50
top_p0.85
seed69
image_count1
modelgemini-3-pro-image-preview
image_size1K
prompt
system_instruction
prompt_input
system_instruction_input
api_key_input
image_count_input0
use_concurrencyfalse

Let's get the one thing that matters out of the way: this node does not run anything locally. It's a thin, well-made wrapper around Google's Gemini API, and the model it calls by default - gemini-3-pro-image-preview - is Nano Banana Pro, Google's flagship image model. You feed it up to 14 reference images and a prompt, it phones home, and a batch of images comes back as a normal ComfyUI tensor. If you've been watching people get character-consistent multi-image generation and native 4K output out of Google's stack and wondering how to get it into your graph, this is the node.

Why would you reach for it instead of a local checkpoint? Because Nano Banana Pro does things most open models still struggle with: it holds a subject across up to 14 reference images, renders text that's actually legible, and outputs natively at 4K. That's the whole pitch. The cost is that it's a paid API call (roughly $0.04–$0.24 per image depending on resolution), every image carries Google's invisible SynthID watermark, and the censorship is aggressive - the community consensus is "powerful, unimaginative, massive hidden biasing." It's a tool for when the job justifies it, not a daily driver.

How it works

Mechanically it's clean. The node turns each reference image into PNG bytes, packs them into the Gemini request alongside your prompt and system instruction, asks for an IMAGE response, and pulls the images back out of the reply before converting them to a batch tensor. One nice touch: when aspect_ratio is auto it simply omits the field from the request, which avoids the INVALID_ARGUMENT error you'd get from sending it anyway.

For image_count over 1 it loops; flip use_concurrency on and it fans the calls out across a thread pool instead. Expect rate limits - Google throttles concurrent requests, and the README's advice is to drop image_count or turn concurrency off when you see [Nano Banana Pro] Request failed: in the log.

Inputs and outputs that matter

  • prompt - your actual instruction. Leave it blank and the model just draws from reference images alone.
  • image_1 through image_14 - the reference slots. This is where the character-consistency magic lives.
  • image_count - 1 to 15 images per run.
  • aspect_ratio (auto, 1:1, 9:16, 16:9, etc.) and image_size (1K/2K/4K) - the shape and resolution.
  • seed, temperature, top_p - the usual knobs. seed of -1 means random.
  • api_key - your Google AI Studio key. Leave it blank and it falls back to the GEMINI_API_KEY environment variable.

Output is a single image output of type IMAGE - a batch tensor you can preview, save, or feed straight into an upscaler.

The optional *_input ports are an override system: prompt_input, api_key_input, image_count_input and so on let an upstream node feed values in, and an incoming value beats the widget. Useful in a workflow, confusing the first time you see a node doing the opposite of what its panel says.

Installing it

The pack is zhanglongxiao111/Comfyui-geminiapi (a maintained fork of Aryan185's ComfyUI-ExternalAPI-Helpers). Easiest route is ComfyUI Manager - search "Comfyui-geminiapi". Otherwise:

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/zhanglongxiao111/Comfyui-geminiapi.git
cd Comfyui-geminiapi
python -m pip install -r requirements.txt

Then restart ComfyUI. The node lives under ExternalAPI/Image/Generation. One real gotcha: the requirements.txt installs the newer google-genai SDK, and the node hard-checks its version - if it's below 1.0.0 the node refuses to load with instructions to run pip install google-genai --upgrade. If you see a load error on first start, that's almost certainly it.

Troubleshooting

The most common failure is the API key not being read - set GEMINI_API_KEY in the terminal that launches ComfyUI, or wire it in via the key port. If a request fails you get a black placeholder frame in the output rather than a crash, plus a logged error, so always check the console before assuming the model generated something intentionally dark. And remember the cost: crank image_count to 15 with concurrency on, and you've just spent a few dollars on one workflow run.

CategoryExternalAPI/Image/Generation

Inputs (29)

NameTypeDefaultDescription
api_keySTRING
aspect_ratioCOMBO11 options: auto, 1:1, 2:3, 3:2, 3:4, 4:3, +5
temperatureFLOAT0.500–1
top_pFLOAT0.850–1
seedINT69-1–2147483646
image_countINT11–15
modelSTRINGgemini-3-pro-image-preview
image_sizeCOMBO1K3 options: 1K, 2K, 4K
promptoptSTRING
system_instructionoptSTRING
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE
image_9optIMAGE
image_10optIMAGE
image_11optIMAGE
image_12optIMAGE
image_13optIMAGE
image_14optIMAGE
prompt_inputoptSTRING
system_instruction_inputoptSTRING
api_key_inputoptSTRING
image_count_inputoptINT00–15
use_concurrencyoptBOOLEANfalse

Outputs (1)

NameTypeDescription
imageIMAGE