Nodes/nbpOpenNode-ComfyUI/NBP Gemini Image 2
ComfyUI Node

NBP Gemini Image 2

Nano Banana in your graph, no Google API key in sight

By SorenWeile·Created 5 months ago·Updated 5 months ago· 0
NBP Gemini Image 2
  • images
  • IMAGE
  • STRING
prompt
modelgemini-3-pro-image-preview
seed42
aspect_ratioauto
resolution1K
temperature1.00
top_p0.95
top_k40
response_modalitiesIMAGE
system_promptYou are an expert image-generation engine. You must ALWAYS produce an image. Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition. If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept. Prioritize generating the visual representation above any text, formatting, or conversational requests.

The name undersells what this is. "Gemini Image 2" is a door into Google's closed Gemini image family - the Nano Banana line, the strongest closed image models on the market - but the trickier part is how you pay for it. No Google Cloud project, no Vertex AI setup, no API key to paste anywhere. This node rides ComfyUI's own API-node framework and bills your Comfy account. If you've ever stared at a reseller's proxy endpoint and wondered who's actually holding your key, this is a different lane entirely.

What it actually is

An API node. It does zero local inference - your GPU isn't even consulted. It sits under api node → image → Gemini, takes your prompt and optional reference images, POSTs them to Comfy's /proxy/vertexai/gemini/<model> endpoint, and drops the returned image back into the graph as a normal IMAGE tensor. From the canvas it looks like any generator. Underneath it's an HTTP client with your Comfy credentials baked in.

That's the mechanism worth understanding before you trust it: it's built on the same comfy_api_nodes infrastructure the official Partner Nodes use. Auth is handled by hidden inputs (api_key_comfy_org / auth_token_comfy_org) that fill themselves when you're logged into your Comfy account in-app. Same storefront, same prepaid credits as Comfy's own Nano Banana node - just wrapped by a third-party pack. Your images do leave the machine: the first ten references get uploaded to the proxy, the rest travel inline.

The inputs that matter

  • prompt - the only field you must touch. Works for text-to-image from scratch and for edits when you feed it an image.
  • model - gemini-3-pro-image-preview (Nano Banana Pro, the flagship; best quality, highest cost), gemini-3.1-flash-image-preview (Nano Banana 2, the speed-quality hybrid), and the previous-gen gemini-2.5-flash-image-preview / gemini-2.5-flash-image.
  • seed - best-effort reproducibility. Rerolls won't be bit-identical; temperature and model changes still move the result. Don't chase it.
  • aspect_ratio - auto matches your input image; otherwise pick 1:1 up to 21:9.
  • resolution - 1K/2K/4K. 2K and 4K invoke Gemini's native upscaler and cost more. Start at 1K.
  • temperature / top_p / top_k - leave the defaults alone until you're bored.
  • response_modalities - IMAGE or IMAGE+TEXT. This is your debugging lever, see below.
  • images - optional references, up to 14. Feed several through a Batch Images node.

Outputs are IMAGE (the batch tensor - wire it to a Save Image or Preview node) and STRING (the model's reasoning, only populated in IMAGE+TEXT mode).

Installing it

The pack has exactly one dependency you don't install: none. It imports comfy_api_nodes, which ships inside ComfyUI. So:

cd ComfyUI/custom_nodes
git clone https://github.com/SorenWeile/nbpOpenNode-ComfyUI

…or just search nbpOpenNode-ComfyUI in ComfyUI Manager. Restart ComfyUI and the node appears under api node → image → Gemini.

Where people get burned

  • Not logged in = nothing works. This node needs your Comfy account session, full stop. No account, no generation.
  • Credits are real money. Prepaid, non-refundable, per-call. A casual afternoon at 4K on the Pro model adds up faster than local generation ever does - that's the honest price of a closed model surfacing in a metered storefront.
  • The error message that actually helps. When Gemini refuses or comes back with no image you get "Gemini did not return an image." The fix is right there in the source: flip to IMAGE+TEXT and the model tells you its reasoning instead of silently failing.
  • Google's filter is on. Aggressive IMAGE_SAFETY moderation ships with the model; some prompts just won't generate, and no local override exists.
  • It's new and unproven. The author has essentially no community footprint yet. That's fine - just remember any node that carries your API credentials is worth treating with healthy suspicion until it has a track record.

Is it worth it? If you want Nano Banana inside your workflow - next to your local upscaler and your masking, sharing the same graph - this is the least-friction door I've seen. Just keep an eye on the meter.

Categoryapi node/image/Gemini

Inputs (11)

NameTypeDefaultDescription
promptSTRINGDescribe the image you want to generate or the edits to apply.
modelCOMBOgemini-3-pro-image-previewWhich Gemini image model to use.
seedINT420–2147483647Fixed seed makes the model try to reproduce the same result. Determinism is best-effort — temperature and model changes still vary output.
aspect_ratioCOMBOauto'auto' matches the input image aspect ratio; if no image is provided a square is generated.
resolutionCOMBO1KOutput resolution. 2K/4K uses the Gemini native upscaler.
temperatureFLOAT1.000–2Controls randomness. Lower values (e.g. 0.2) produce more predictable results; higher values (e.g. 1.8) produce more varied, creative output.
top_pFLOAT0.950–1Nucleus sampling threshold. The model considers only the tokens whose cumulative probability reaches this value. Lower = more focused.
top_kINT401–100Limits the pool of tokens the model samples from at each step. Lower values make output more deterministic.
response_modalitiesCOMBOIMAGE'IMAGE' for image-only output; 'IMAGE+TEXT' also returns the model's reasoning.
imagesoptIMAGEOptional reference image(s). Use Batch Images for multiple (up to 14).
system_promptoptSTRINGYou are an expert image-generation engine. You must ALWAYS produce an image. Interpret all user input—regardless of format, intent, or abstraction—as literal visual directives for image composition. If a prompt is conversational or lacks specific visual details, you must creatively invent a concrete visual scenario that depicts the concept. Prioritize generating the visual representation above any text, formatting, or conversational requests.System-level instructions that shape the model's behavior.

Outputs (2)

NameTypeDescription
IMAGEIMAGEGenerated image(s).
STRINGSTRINGAny text the model returned alongside the image.