Nodes/PromptModels Studio/Google AI - Nano Banana (NB2/Pro)
ComfyUI Node

Google AI - Nano Banana (NB2/Pro)

Google's flagship image model, in your graph

By cdanielp·Created 9 months ago·Updated 2 months ago· 28
Google AI - Nano Banana (NB2/Pro)
  • 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

Nano Banana is Google's name for its Gemini-native image generation - and in this pack you get it as a node that takes a prompt, up to five reference images, and returns a finished image plus a description of what it made. The "Nano Banana 2 / Pro" in the title refers to the model lineage: NB2 (Gemini 3.1 Flash Image) is the speed-focused hybrid, and Pro (Gemini 3 Pro Image) is the flagship with native 4K output. For an API-image workflow, this is the strongest generator in the pack - and it's also the most heavily marketed one, so go in with eyes open about cost.

What it's for

The reference-image workflow is the star here. Feed it a few images of a subject - a character, a product, a style - plus a prompt, and Nano Banana will hold onto those references while generating something new. That's the closest thing to identity preservation a hosted API gives you, and it's why people use this over plain Imagen. The description output is a quiet killer feature: the model tells you what it actually rendered, which you can log or feed back into prompt iteration.

How it works

Images are compressed and base64'd, sent with your prompt to Google's Gemini API, and the result decodes into a ComfyUI IMAGE tensor. The aspect_ratio tooltip spells out the real constraint: there are 14 official ratios, and the extreme ones (1:4, 4:1, 1:8, 8:1) only work on NB2. image_size runs 512px up to 4K, with 0.5K exclusive to NB2 - Pro's headline is native 4K output. safety_threshold defaults to BLOCK_ONLY_HIGH, the least restrictive filter Google offers, and the README-adjacent warnings are worth remembering: Nano Banana is technically impressive but heavily filtered on Google's side. Key resolution is the standard pack order, and errors come back as a placeholder error image rather than a crash.

Inputs and outputs that matter

  • prompt (STRING, multiline) - what you want made.
  • model (COMBO, default gemini-3.1-flash-image) - NB2 by default; switch to the Pro model for 4K and more references.
  • aspect_ratio (COMBO) and image_size (COMBO) - read the tooltips; not every combo works on every model.
  • image_1 … image_5 (IMAGE) - reference images. This is the node's superpower; wire a couple in and tell it what to keep.
  • system_prompt (STRING) - a default that describes image composition; you can tighten it.
  • safety_threshold (COMBO) - leave on BLOCK_ONLY_HIGH unless a prompt is getting blocked, then it won't help anyway.
  • seed / randomize_seed - reproducibility.
  • image (IMAGE) and description (STRING) - the result and the model's own summary of it.

Installing it

One of the 15 Google nodes in COMFYUI_PROMPTMODELS (PromptModels Studio in Manager):

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

Add GEMINI_API_KEY=AI... to the pack's .env, restart. Needs ComfyUI 0.26.0+. No local downloads - everything runs at Google's end.

Common issues

Cost first: Nano Banana Pro bills per image based on resolution, and the community's line on this whole pack is that the nodes are free but the API very much isn't. Safety blocks are the other thing to expect - Google's filters are stricter than most open models, so prompts that "just work" locally may return an error image here. And check model-vs-size compatibility: asking for 4K from an NB2-only combo is a fast way to get a confusing error.

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