Nodes/ComfyUI-NanoBananaAPI/NanoBanana API🍌
ComfyUI Node

NanoBanana API🍌

Nano Banana inside ComfyUI — no GPU, just a Google API key

By daehwa00·Created about a year ago·Updated 12 months ago· 4
NanoBanana API🍌
  • image
  • reference_image_1
  • reference_image_2
  • reference_image_3
  • reference_image_4
  • edited_image
promptEdit the image as requested.
model_namegemini-2.5-flash-image-preview
api_key

The name is a lie, sort of. NanoBanana API🍌 doesn't call any "NanoBanana API" - it's a thin client that sends your image to Google's Gemini image models over their standard API and hands you back the edited result as a normal ComfyUI IMAGE tensor. Remember the "ComfyUI is dead after Nano Banana" panic at launch? This is the reason it wasn't. Google's image models run on Google's hardware, so the way you use them from Comfy is a node like this one, not a checkpoint sitting in your models folder. If you've been eyeballing Nano Banana's instruction-following and text rendering but don't want to leave ComfyUI to go poke around in ImageFX, this is the node you'd reach for.

How it works

Under the hood it's simpler than it looks. The node takes your tensor, converts it to a PIL image, serializes it to PNG bytes, and sends it to client.models.generate_content() with response_modalities=[Modality.IMAGE] - that's the flag that tells Gemini "answer with an image, not prose." It then grabs the first inline image from the response and converts it back to a (1, H, W, 3) float tensor. All of that lives in the official google-genai SDK, so you're not fighting a private reverse-engineered API that can break tomorrow.

The only real dependency is google-genai - no model files, no big download, no VRAM. PIL, numpy, and torch are already in any working ComfyUI install. This is an API node: your GPU sits this one out.

Inputs that matter

Four required, and honestly you'll touch two or three of them:

  • image - the base image to edit. Feed it one image at a time; the conversion code only handles a single frame, so don't send it a batch of ten and expect a montage.
  • prompt - your edit instruction. The default is the unhelpful "Edit the image as requested," so set it.
  • api_key - your Google AI Studio key. Leave it blank and the node falls back to the GOOGLE_API_KEY environment variable, which is the version I'd use - otherwise your key lives in every saved workflow.
  • model_name - defaults to gemini-2.5-flash-image-preview, which is classic Nano Banana. The README's advice stands: type any public model id you want. Newer Gemini image models land with new preview strings, and since the default is a preview model, Google can retire it whenever they like.

The optional reference_image_1 through reference_image_4 are where it gets interesting - they're sent to the model as extra image parts, which is exactly how you'd do style or character reference without training anything.

The single output, edited_image, wires straight into a Preview Image or Save Image node. That's it.

Installing

ComfyUI Manager: search "ComfyUI-NanoBananaAPI" and hit install. Or do it by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/daehwa00/ComfyUI-NanoBananaAPI
cd ComfyUI-NanoBananaAPI
pip install -r requirements.txt

Restart ComfyUI, and the node appears under the "Google Gemini" category. No model downloads to babysit - the heavy lifting is "get a Google API key and enable billing," which happens on Google's site, not yours.

Where people get burned

The most common failure is the node's own error message: "No image data found in model response. Model returned text instead," followed by a snippet of whatever Gemini said. Nine times out of ten that's the safety filter - Nano Banana has aggressive IMAGE_SAFETY filtering and strict rules around celebrities and IP, and Google tightened it further in early 2026. The model refuses by returning text, not a refusal image, and this node surfaces exactly that. It's not a bug; it's the wall.

The other classic: a missing google-genai install, which throws a Korean-language RuntimeError about the SDK. If you used the Manager to install but skipped the pip step, that's your problem.

And the one nobody thinks about: this sends every image you feed it to Google. Cost per image, SynthID watermark baked in, and your art goes over the wire. For quick one-off edits and honest-to-God text rendering it's unbeatable. For anything private, or if you want reproducibility you control, a local model is still the move.

CategoryGoogle Gemini

Inputs (8)

NameTypeDefaultDescription
imageIMAGE
promptSTRINGEdit the image as requested.
model_nameSTRINGgemini-2.5-flash-image-preview
api_keySTRING
reference_image_1optIMAGE
reference_image_2optIMAGE
reference_image_3optIMAGE
reference_image_4optIMAGE

Outputs (1)

NameTypeDescription
edited_imageIMAGE