Nodes/NanoBanana&Veo_Suite_3DeLAB/Nano Banana Pro (Gemini Direct)
ComfyUI Node

Nano Banana Pro (Gemini Direct)

Nano Banana Pro, but you bring your own API key

By PATAGONIABIM·Created 7 months ago·Updated 6 months ago· 1
Nano Banana Pro (Gemini Direct)
  • images
  • mask
  • scribble
  • images
  • response_text
promptDescribe the image you want to generate...
modelgemini-3-pro-image-preview
operationGENERATE
api_key
service_account_json
seed42
aspect_ratio1:1
resolution1K
response_modalitiesIMAGE
thinkingfalse
system_promptYou are an expert image-generation engine. You must ALWAYS produce an image.

The name is the pitch. ComfyUI's official Nano Banana Pro node runs on prepaid Comfy credits through Partner Nodes; this one - "Gemini Direct" - takes a plain Google AI Studio key and hits the Gemini API straight from your graph. No Comfy account, no credit meter, no model download, no GPU required. Your graphics card is completely irrelevant to this node, and that's the point.

Nano Banana Pro (Gemini 3 Pro Image) is Google's flagship closed image model: 4K native output, up to 14 reference images, and a "thinking" mode that reasons about the prompt before it generates. There are no weights to download - if you want it, you call it, and this node is the door into a ComfyUI workflow. The broader pack's docs also expose the older Imagen 3/4 variants here, because the heavy edit operations (inpaint, outpaint, background swap) run through Vertex AI.

How it works

Under the hood it's an HTTP client wearing a generator's clothes. For the Gemini models it builds a REST payload against generativelanguage.googleapis.com, base64-encodes your input images and scribbles inline, and parses the returned image out of the response. For the Imagen variants it switches to the google-genai client against Vertex AI, auto-detecting your GCP project ID from the service account JSON you hand it. The node decides the route from the model you picked - Gemini models force the direct key path, Imagen models expect Vertex credentials.

The auth split is the single thing most people trip on, and the tooltips spell it out:

  • api_key (Google AI Studio) - all you need for gemini-3-pro-image-preview and gemini-3.1-flash-image-preview generation. You can paste the key or give it a path to a .txt file containing the key.
  • service_account_json - absolute path to a Vertex AI service account key, required for the Imagen editing operations.

The inputs and outputs that matter

  • prompt - the whole game. It's a system-instructed Gemini model; it reads natural language well, so write like you mean it.
  • model - defaults to gemini-3-pro-image-preview (the Pro model, 4K native). gemini-3.1-flash-image-preview is Nano Banana 2, the speed/quality hybrid. The three imagen-* variants are the Vertex editing path.
  • operation - GENERATE for txt2img/img2img; INPAINT_INSERTION, INPAINT_REMOVAL, OUTPAINT and BACKGROUND_SWAP for editing.
  • images - wire in any IMAGE output (a plain Load Image, or this pack's LoadScribbleImage). A batch feeds multi-reference generation, up to 14.
  • mask - for inpainting. White = edit, black = keep. This pack's Load Video (Extract Frame) + Load Image (Passthrough) pair exists specifically to get you into ComfyUI's Mask Editor.
  • scribble - a sketch overlay with transparent background for controlled edits; pair it with the pack's Scribble Editor node.
  • aspect_ratio (1:1, 16:9, 9:16, 4:3, 3:4, 2:3, 3:2), resolution (1K/2K/4K - and 4K costs more), thinking (High thinking level, Pro/Flash only), response_modalities (IMAGE or IMAGE+TEXT), seed, system_prompt.

Outputs: images (IMAGE tensor - drops back into the graph like any generator) and response_text (STRING). The second one is also the node's error channel: when something goes wrong it returns a blank black tensor and shoves the error text into response_text. If you get a 64×64 black image, read that string before you blame the model.

Install

This is a wrapper, not a model - install is trivial and there's nothing heavy to download:

cd ComfyUI/custom_nodes
git clone https://github.com/PATAGONIABIM/comfyui-NanoBananaPro_3DeLAB.git
cd comfyui-NanoBananaPro_3DeLAB
pip install -r requirements.txt

Restart ComfyUI, or search comfyui-NanoBananaPro_3DeLAB in ComfyUI Manager. Dependencies are google-genai, requests, numpy, Pillow, google-cloud-storage, and opencv-python - the heavy lifting happens on Google's servers.

Where people get burned

  • You get a blank image. Check response_text - it's almost always a missing or invalid key (the node tells you explicitly).
  • Editing ops fail with just an API key. Inpaint/outpaint/background swap need the Vertex service account, not the AI Studio key.
  • It costs real money. Google's own pricing runs roughly $0.039–0.24 per image depending on resolution. Resolution is a price dial as much as a quality one.
  • Everything leaves your machine. Your reference images and prompt go to Google, and the model's content filter is baked in at the source - there's no local weights to abliterate. This is true of every closed-model API node, and it's the tradeoff you're signing up for.

One more: a node that carries a credential and phones home by design is exactly the shape of the thing that got the ecosystem burned once. Install from the pack's repo or Manager - and given how small this one is, skim the source before you paste a live key into it.

Category3DELAB

Inputs (14)

NameTypeDefaultDescription
promptSTRINGDescribe the image you want to generate...The text description of the image you want to generate.
modelCOMBOgemini-3-pro-image-previewSelect the AI model to use (API Key for Gemini models to generate | JSON Key for Imagen variants for Inpaint, Outpaint, Background Swap).
operationCOMBOGENERATEChoose the operation mode: GEN (TXT2IMG|IMG2IMG|MULTIREFERENCE), INPAINT (Edit|Remove), OUTPAINT, BG_SWAP.
api_keyoptSTRINGYour Google AI Studio API Key. Required for Gemini models.
service_account_jsonoptSTRINGAbsolute path to your Vertex AI Service Account JSON key file. Required for Imagen 3 editing/inpainting.
imagesoptIMAGEInput image for editing, inpainting, or image-to-image generation.
maskoptMASKMask image for inpainting (white = edit, black = keep).
scribbleoptIMAGEScribble or sketch image (transparent BG) for controlled editing.
seedoptINT420–18446744073709550000Seed for random number generation.
aspect_ratiooptCOMBO1:1The aspect ratio of the generated image.
resolutionoptCOMBO1KResolution of the output image (1K, 2K, 4K).
response_modalitiesoptCOMBOIMAGEChoose image only or image + reasoning text.
thinkingoptBOOLEANfalseEnable High thinking level (gemini-3.1 flash/pro only).
system_promptoptSTRINGYou are an expert image-generation engine. You must ALWAYS produce an image.System-level instructions to guide the model's behavior.

Outputs (2)

NameTypeDescription
imagesIMAGE
response_textSTRING