Nano Banana Pro (Gemini Direct)
Nano Banana Pro, but you bring your own API key
- images
- mask
- scribble
- images
- response_text
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 forgemini-3-pro-image-previewandgemini-3.1-flash-image-previewgeneration. You can paste the key or give it a path to a.txtfile 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 togemini-3-pro-image-preview(the Pro model, 4K native).gemini-3.1-flash-image-previewis Nano Banana 2, the speed/quality hybrid. The threeimagen-*variants are the Vertex editing path.operation-GENERATEfor txt2img/img2img;INPAINT_INSERTION,INPAINT_REMOVAL,OUTPAINTandBACKGROUND_SWAPfor 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.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Describe the image you want to generate... | The text description of the image you want to generate. |
| model | COMBO | gemini-3-pro-image-preview | Select the AI model to use (API Key for Gemini models to generate | JSON Key for Imagen variants for Inpaint, Outpaint, Background Swap). |
| operation | COMBO | GENERATE | Choose the operation mode: GEN (TXT2IMG|IMG2IMG|MULTIREFERENCE), INPAINT (Edit|Remove), OUTPAINT, BG_SWAP. |
| api_keyopt | STRING | Your Google AI Studio API Key. Required for Gemini models. | |
| service_account_jsonopt | STRING | Absolute path to your Vertex AI Service Account JSON key file. Required for Imagen 3 editing/inpainting. | |
| imagesopt | IMAGE | Input image for editing, inpainting, or image-to-image generation. | |
| maskopt | MASK | Mask image for inpainting (white = edit, black = keep). | |
| scribbleopt | IMAGE | Scribble or sketch image (transparent BG) for controlled editing. | |
| seedopt | INT | 420–18446744073709550000 | Seed for random number generation. |
| aspect_ratioopt | COMBO | 1:1 | The aspect ratio of the generated image. |
| resolutionopt | COMBO | 1K | Resolution of the output image (1K, 2K, 4K). |
| response_modalitiesopt | COMBO | IMAGE | Choose image only or image + reasoning text. |
| thinkingopt | BOOLEAN | false | Enable High thinking level (gemini-3.1 flash/pro only). |
| system_promptopt | STRING | You are an expert image-generation engine. You must ALWAYS produce an image. | System-level instructions to guide the model's behavior. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| response_text | STRING | — |