NanoBanana Full API
Google's Gemini image models, dropped straight into a ComfyUI graph
- mask
- image_1
- image_2
- image_3
- image_4
- image_5
- image_batch
- text_output
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_levelis 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_ratioandresolution(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 (defaultBLOCK_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 toyesto treat the optionalmaskas a mask for image 1, for image editing.- Optional
image_1…image_5(IMAGE) - reference images; up to five for editing or composition. show_thoughtsandthinking_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.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Google Gemini API key. When blank, GEMINI_API_KEY then GOOGLE_API_KEY are checked. | |
| model_version | COMBO | gemini-3.1-flash-image | 2 options: gemini-3.1-flash-image, gemini-3-pro-image |
| prompt | STRING | A majestic golden retriever, watercolor style | — |
| system_prompt | STRING | You are a helpful image generation assistant. | — |
| aspect_ratio | COMBO | 1:1 | 10 options: 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, +4 |
| seed | INT | 00–2147483647 | — |
| temperature | FLOAT | 1.00–2 | — |
| top_p | FLOAT | 0.950–1 | — |
| candidate_count | INT | 11–10 | — |
| safety_harassment | COMBO | BLOCK_DEFAULT | 5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH |
| safety_hate_speech | COMBO | BLOCK_DEFAULT | 5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH |
| safety_sexual | COMBO | BLOCK_DEFAULT | 5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH |
| safety_dangerous | COMBO | BLOCK_DEFAULT | 5 options: BLOCK_DEFAULT, BLOCK_NONE, BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH |
| edit_mode_enabled | COMBO | no | 2 options: no, yes |
| resolution | COMBO | 4K | 3 options: 1K, 2K, 4K |
| timeout_seconds | INT | 1201–3600 | Maximum time to wait for the Google API response. |
| show_thoughts | BOOLEAN | true | Request and include model thought text in text_output. |
| thinking_level | COMBO | high | Gemini 3.1 Flash Image only. Gemini 3 Pro Image uses its model-managed thinking level. |
| maskopt | MASK | — | |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image_batch | IMAGE | — |
| text_output | STRING | — |