Nodes/PromptModels Studio/Nano Banana - Imagen IA (PMS)
ComfyUI Node

Nano Banana - Imagen IA (PMS)

Nano Banana in ComfyUI, without renting a GPU for it

By cdanielp·Created 9 months ago·Updated 2 months ago· 28
Nano Banana - Imagen IA (PMS)
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image
  • description
promptA beautiful cinematic portrait, photorealistic, 8K detail
modelgemini-3.1-flash-image
aspect_ratio1:1
image_size2K
seed0
randomize_seedtrue
api_key
system_promptYou are an expert image composition engine. Use the reference images to understand the visual style, character traits, and composition goals. Generate a new image that matches the described scenario.
safety_thresholdBLOCK_ONLY_HIGH

The name "Nano Banana" is Google's own branding for its Gemini image model - the same one behind ImageFX, rebranded after an anonymous HuggingFace codename stuck (Google executives started dropping banana emojis and it went official). This node is that model, reachable from inside ComfyUI as a plain API call. No 20 GB checkpoint to download, no VRAM to sweat, no local diffusion at all: type a prompt, get a tensor back.

That's the pitch, and for once the reality matches. PMS_NanaBanana (full name "Nano Banana - Imagen IA") is a thin REST wrapper over Gemini's generateContent endpoint with image output enabled. It's the same trick the whole PromptModels pack is built on - zero SDKs, just requests and Pillow. If you want Google's image quality, a specific model's style, or the reference-image consistency trick where you feed it character photos and it keeps them recognizable, this is the node. The honest caveat: it's a paid API. The pack is free; each image you generate costs Gemini credits, and heavy use on the free tier runs straight into 429s.

What it actually sends

Mechanically it's simple and worth knowing: the node turns your prompt into a Gemini generateContent call with responseModalities: ["TEXT", "IMAGE"]. Your up-to-five reference images are compressed and sent as base64 inlineData parts alongside the text, a system_prompt gives the model its composition instructions, and the response is decoded straight into a ComfyUI IMAGE tensor. The pack's core client retries rate limits with exponential backoff (2/4/8/16s), which is why a busy free-tier key just makes it slow instead of failing instantly.

The inputs that matter

  • prompt - the actual image description. The default ("a beautiful cinematic portrait…") is fine as a starting point but you'll replace it.
  • model - defaults to gemini-3.1-flash-image (Nano Banana 2). gemini-3-pro-image is Nano Banana Pro.
  • aspect_ratio - 14 official ratios. The extremes (1:4, 4:1, 1:8, 8:1) are Nano Banana 2 only, per the tooltip.
  • image_size - 512px through 4K; 0.5K and 4K only on NB2/Pro. 4K is Pro territory and bills accordingly.
  • seed / randomize_seed - reproducible if you turn randomize off. Heads up: this pack fixed a bug where seeds over 32-bit silently corrupted, so don't go past the 2^32 neighborhood if you want them to actually replay.
  • image_1 … image_5 - reference images for style/character consistency. Optional, but this is the killer feature.

The safety_threshold dropdown (default BLOCK_ONLY_HIGH) is worth a glance - it's the most permissive of Google's four content-filter settings, which is what most people want. And api_key? Leave it empty and use the .env file; more on that below.

Outputs

Two of them: image (the IMAGE tensor - wire it to a Preview/Save node) and description (a STRING, Google's caption of what it generated, handy if you're auto-captioning a dataset or feeding the result back into a text node).

Installing it

It ships in the COMFYUI_PROMPTMODELS pack, so via ComfyUI Manager search "COMFYUI_PROMPTMODELS" (or "PromptModels Studio") and install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/cdanielp/COMFYUI_PROMPTMODELS

Then create a .env in the pack folder with GEMINI_API_KEY=AI... and restart ComfyUI. Needs ComfyUI >= 0.26.0 and Python >= 3.10; only requests and Pillow are required, so no heavy install.

The gotcha that actually bites people

Never paste your key into the api_key widget. It gets saved in your workflow JSON, and worse, when you save a PNG from ComfyUI the whole workflow - key included - is embedded in the PNG metadata. The author flags this explicitly. Put it in .env or an environment variable, leave the field blank, and your key never travels in your files. That, plus the billing question (this node is useless without a Gemini key), is where most beginners get burned.

CategoryGoogle AI/Image

Inputs (14)

NameTypeDefaultDescription
promptSTRINGA beautiful cinematic portrait, photorealistic, 8K detail
modelCOMBOgemini-3.1-flash-image5 options: gemini-3.1-flash-image, gemini-3-pro-image, gemini-3.1-flash-image-preview, gemini-3-pro-image-preview, gemini-2.5-flash-image
aspect_ratioCOMBO1:114 ratios oficiales. Extremos (1:4,4:1,1:8,8:1) solo NB2.
image_sizeCOMBO2K512px, 0.5K (solo NB2), 1K, 2K, 4K (NB2/Pro).
seedINT00–18446744073709550000
randomize_seedBOOLEANtrue
api_keyoptSTRING
system_promptoptSTRINGYou are an expert image composition engine. Use the reference images to understand the visual style, character traits, and composition goals. Generate a new image that matches the described scenario.
image_1optIMAGEReferencia 1.
image_2optIMAGEReferencia 2
image_3optIMAGEReferencia 3
image_4optIMAGEReferencia 4
image_5optIMAGEReferencia 5
safety_thresholdoptCOMBOBLOCK_ONLY_HIGHNivel de filtro. BLOCK_ONLY_HIGH = menos restrictivo.

Outputs (2)

NameTypeDescription
imageIMAGE
descriptionSTRING