Nodes/WorkflowX Configurator/NanoBanana Full API
ComfyUI Node

NanoBanana Full API

Google's Gemini image models, dropped straight into a ComfyUI graph

By haroonaslam·Created 4 months ago·Updated 7 days ago· 10
NanoBanana Full API
  • mask
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_batch
  • text_output
api_key
model_versiongemini-3.1-flash-image
promptA majestic golden retriever, watercolor style
system_promptYou are a helpful image generation assistant.
aspect_ratio1:1
seed0
temperature1.0
top_p0.95
candidate_count1
safety_harassmentBLOCK_DEFAULT
safety_hate_speechBLOCK_DEFAULT
safety_sexualBLOCK_DEFAULT
safety_dangerousBLOCK_DEFAULT
edit_mode_enabledno
resolution4K
timeout_seconds120
show_thoughtstrue
thinking_levelhigh

Nano Banana - Google's Gemini image model - has no open weights. You can't run it locally, so the only way to get it inside a ComfyUI workflow is through an API node that calls it for you. That's exactly what this node is: an HTTP client dressed as a generator. You type a prompt, it talks to Google's generateContent endpoint, and the returned image lands on a normal IMAGE socket that feeds the same preview, upscale, and save nodes as your local output. From the canvas it looks like any sampler. Underneath it's a network call with your API key.

The class name (NanoBanana_Gemini_2_5_Flash_V2) is a historical artifact - the node keeps the old workflow ID for compatibility, but it's been updated to Google's current endpoints and models. You get two model choices in model_version:

  • gemini-3.1-flash-image (default) - the general-purpose Nano Banana successor.
  • gemini-3-pro-image - the premium tier for complex instructions and professional asset work. Note: thinking_level is a Flash-only control; Pro manages its own thinking.

Keys and credentials

The key resolves in order: the api_key widget, then the GEMINI_API_KEY env var, then GOOGLE_API_KEY. It's sent in the x-goog-api-key header, never the URL or body. Two practical notes: keys typed into the widget get serialized into the workflow JSON, so use the environment variable for anything you'll share; and the node surfaces empty-credential, provider, timeout, and safety errors instead of dying silently.

The inputs that actually matter

  • prompt - the instruction. system_prompt - only prepended if you change it from the default.
  • aspect_ratio and resolution (1K/2K/4K) - the output shape. 4K default is greedy; 1K is plenty for drafts.
  • seed, temperature, top_p - generation controls you mostly leave alone until you're iterating.
  • candidate_count (1–10) - how many candidates to ask for per call.
  • safety_harassment / safety_hate_speech / safety_sexual / safety_dangerous - per-category blocking policy (default BLOCK_DEFAULT). Google enforces its own content rules at the source regardless; this only tunes how aggressively the built-in filter blocks.
  • edit_mode_enabled - set to yes to treat the optional mask as a mask for image 1, for image editing.
  • Optional image_1image_5 (IMAGE) - reference images; up to five for editing or composition.
  • show_thoughts and thinking_level - request/report the model's reasoning.

Outputs: image_batch (IMAGE) - the returned candidates - and text_output (STRING) - provider text or response details, including thoughts if you asked for them.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/haroonaslam/WorkflowX-Configurator

or search WorkflowX Configurator in ComfyUI Manager, restart, refresh. No pip deps and no model download - the "model" lives on Google's servers.

The honest tradeoffs

  • Per-call cost, and it adds up. Every generation is a metered API call. Draft at 1K, not 4K.
  • Your inputs leave the machine. Prompt and reference images go to Google. If that's a dealbreaker, this node isn't for you - it's the mechanism, not a bug.
  • Filtering follows the model. You cannot abliterate a closed model's refusals; whatever Google refuses, this node refuses.
  • It's a third-party pack with your key. That's the category that once shipped credential-stealing malware (ComfyUI_LLMVISION), so install it via Manager from the registry and keep the key in an env var - not pasted into every workflow you share.

The cleanest way to get Nano Banana-class generation into a local workflow, with the API tax fully in view.

CategoryWorkflowX/API

Inputs (24)

NameTypeDefaultDescription
api_keySTRINGGoogle Gemini API key. When blank, GEMINI_API_KEY then GOOGLE_API_KEY are checked.
model_versionCOMBOgemini-3.1-flash-image2 options: gemini-3.1-flash-image, gemini-3-pro-image
promptSTRINGA majestic golden retriever, watercolor style
system_promptSTRINGYou are a helpful image generation assistant.
aspect_ratioCOMBO1:110 options: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, +4
seedINT00–2147483647
temperatureFLOAT1.00–2
top_pFLOAT0.950–1
candidate_countINT11–10
safety_harassmentCOMBOBLOCK_DEFAULT5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH
safety_hate_speechCOMBOBLOCK_DEFAULT5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH
safety_sexualCOMBOBLOCK_DEFAULT5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH
safety_dangerousCOMBOBLOCK_DEFAULT5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH
edit_mode_enabledCOMBOno2 options: no, yes
resolutionCOMBO4K3 options: 1K, 2K, 4K
timeout_secondsINT1201–3600Maximum time to wait for the Google API response.
show_thoughtsBOOLEANtrueRequest and include model thought text in text_output.
thinking_levelCOMBOhighGemini 3.1 Flash Image only. Gemini 3 Pro Image uses its model-managed thinking level.
maskoptMASK
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE

Outputs (2)

NameTypeDescription
image_batchIMAGE
text_outputSTRING