Nodes/ComfyUI_Nano_Banana/Nano Banana 2 AIO
ComfyUI Node

Nano Banana 2 AIO

Google's fastest image model, wired into ComfyUI

By ru4ls·Created 12 months ago·Updated 6 months ago· 60
Nano Banana 2 AIO
  • 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
  • images
  • thinking
  • grounding_sources
model_namegemini-3.1-flash-image-preview
promptA futuristic nano banana dish
image_count1
use_searchfalse
use_image_searchfalse
aspect_ratio1:1
image_size2K
temperature1.0

The name sounds like a prank, but this node is the real thing: it drops Google's fastest Gemini image model - Nano Banana 2 (gemini-3.1-flash-image-preview) - straight into your ComfyUI graph. It's one of four nodes in the ru4ls/ComfyUI_Nano_Banana pack and the speed-and-volume option: Nano Banana 2 launched back in February 2026 as the high-efficiency workhorse of Google's image lineup.

Here's the part people get wrong: nothing runs locally. There's no checkpoint to download, no GPU work, no vram pressure. The node ships your prompt and any reference images to Google's API and gets a finished image back. That means it costs real money per image and it needs credentials - but the quality ceiling is whatever Nano Banana 2 can do, not whatever your 8GB card can run.

Why you'd reach for it

Nano Banana's family tree has a Pro flagship and a fast sibling, and this node is the fast one. If you're iterating - a dozen variations of a product shot, a storyboard at weird aspect ratios, a batch of reference-true images for a character - this is the node to grab. It's the biggest surface of the "Nano Banana 2" side of the pack: up to 14 reference images (the model treats roughly 10 as high-fidelity object references and 4 as character references), Google Image Search grounding on top of plain web search, a 512px output option that the Pro model doesn't offer, and extreme aspect ratios like 1:8 and 8:1.

How it works

The mechanism is straightforward once you accept the cloud thing. The pack reads a .env file at ComfyUI startup - either a GOOGLE_API_KEY or a PROJECT_ID + LOCATION pair - and auto-detects which to use. When you run the node it converts any connected IMAGE tensors into PIL images, builds a GenerateContentConfig with text-plus-image response modalities, your aspect ratio, size and temperature, and (if you toggle it) attaches a Google search tool. One detail worth knowing: the code explicitly disables automatic function calling because it caused a MALFORMED_FUNCTION_CALL error on the earlier Pro preview model - that was the fix in pack v6.0.1. The returned image bytes come back into ComfyUI as a normal IMAGE tensor, ready for PreviewImage or SaveImage.

The inputs that matter

You don't set most of this. The ones a beginner actually touches:

  • prompt - the whole job. Multiline, so describe freely.
  • use_search and use_image_search - web grounding and image grounding; use_image_search does nothing unless use_search is also on, and both default to off here (the Pro AIO node defaults search on, same pack).
  • image_1 through image_14 - optional reference images from LoadImage. Give at least one for image-to-image work.
  • aspect_ratio - includes the NB2-exclusive extremes 1:4, 1:8, 4:1, 8:1, plus Auto which lets the model pick.
  • image_size - 512px, 1K, 2K, 4K. The 512px option is exclusive to Nano Banana 2 and is quietly great for cheap rapid drafts.
  • image_count - 1 to 10; with more than 1 the node generates that many sequential images.

Outputs: images (the IMAGE batch), thinking (the model's reasoning, only really populated via Vertex AI), and grounding_sources (citation URLs). One honest caveat from the README: on the plain API-key path, thinking and grounding_sources just return messages telling you to set up Vertex AI for the full experience.

Installing

This node ships inside the ComfyUI_Nano_Banana pack. Easiest route is ComfyUI Manager - search "ComfyUI_Nano_Banana" and install. Manual:

cd ComfyUI/custom_nodes
git clone https://github.com/ru4ls/ComfyUI_Nano_Banana.git
pip install -r ComfyUI_Nano_Banana/requirements.txt
pip install google-genai --upgrade   # required for Nano Banana 2 nodes

Then set up credentials. The simplest path is a Google AI Studio API key:

cd ComfyUI/custom_nodes/ComfyUI_Nano_Banana
cp .env.api.template .env   # then paste your GOOGLE_API_KEY

The pack deliberately skips its own torch, numpy and Pillow dependencies, assuming ComfyUI already has them - sensible, since it avoids version fights.

Gotchas

  • It's paid. Every image costs something on your Gemini bill, and 14 references plus search add up per call.
  • Censorship. The whole Nano Banana line is known for aggressive safety filtering - the KB sums up the community verdict as "powerful, unimaginative, massive hidden biasing." Don't plan a workflow that needs anything spicy; it will just refuse.
  • Everything carries a SynthID watermark, invisible but detectable.
  • Old google-genai breaks the NB2 nodes - if you get SDK-related errors, run the --upgrade line above first.

If you want the highest quality rather than the fastest, grab the NanoBananaAIO node from the same pack - that's the Pro model. This one is for volume.

CategoryRu4ls/NanoBanana

Inputs (22)

NameTypeDefaultDescription
model_nameCOMBOgemini-3.1-flash-image-preview1 options: gemini-3.1-flash-image-preview
promptSTRINGA futuristic nano banana dish
image_countINT11–10
use_searchBOOLEANfalse
use_image_searchBOOLEANfalse
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
aspect_ratiooptCOMBO1:115 options: 1:1, 1:4, 1:8, 2:3, 3:2, 3:4, +9
image_sizeoptCOMBO2K4 options: 512px, 1K, 2K, 4K
temperatureoptFLOAT1.00–2

Outputs (3)

NameTypeDescription
imagesIMAGE
thinkingSTRING
grounding_sourcesSTRING