Nodes/ComfyUI_LLM_Banana/NanoBanana-GeneralAPI
ComfyUI Node

NanoBanana-GeneralAPI

One node to rule all the Nano Banana mirrors

By xuchenxu168·Created 12 months ago·Updated 9 months ago· 46
NanoBanana-GeneralAPI
  • image
  • image2
  • image3
  • image4
  • text
  • image
prompt生成一张清晰的香水产品图
mirror_sitenano-banana官方
api_key
base_urlhttps://generativelanguage.googleapis.com
modelgemini-3-pro-image-preview
custom_model
versionAuto
auth_modeauto
response_modeTEXT_AND_IMAGE
aspect_ratioAuto
image_sizeAuto
upscale_factor1x (不放大)
gigapixel_modelHigh Fidelity
temperature0.90
top_p0.90
top_k40
max_output_tokens2048
seed0
strict_nativefalse
system_instruction
image_mimeimage/png
timeout300
use_system_proxytrue
extra_payload_json

If you only install one node from ComfyUI_LLM_Banana, this is the one to consider. NanoBanana-GeneralAPI is the pack's universal image-generation-and-editing node: it can generate an image from text or edit up to four input images, through Google's official API or any of ~14 mirror sites, with a unified endpoint/auth system that the rest of the pack has now been aligned to. The README is explicit that Banana2-提示词模板 and Gemini-Multimodal share its design. Learn this node and the others start to look like variants.

It's a closed-model API node, so the usual rules apply (see the external-api-nodes KB doc): per-call cost, your data leaves the machine, Google's filter still applies no matter which mirror you use.

How it works

The config file Gemini_Banana_config.json defines the mirror_sites (nano-banana官方, comfly, Comfly-HK/US, Kuai, T8 variants, API4GPT, OpenRouter, Comet, aabao, custom), each with a URL and optional key. The node resolves settings by priority: your input → mirror-site config → global config → provider default. So you can leave api_key and base_url blank and let the selected mirror fill them in, or override everything yourself.

The endpoint builder and auth are the pack's core logic: if your base_url is already a full endpoint (.../models/<model>:generateContent) it's used as-is; otherwise it's assembled as base_url/<version>/models/<model>:generateContent (or appended to a /v1-style base). auth_mode=auto uses x-goog-api-key on Google domains and Authorization: Bearer elsewhere; google_xgoog and bearer force one or the other. version=Auto picks v1beta/v1alpha on Google and v1 on mirrors.

The inputs that matter

  • prompt - the generation/edit request (default: "生成一张清晰的香水产品图" - generate a clear perfume product image).
  • mirror_site - the provider. Default nano-banana官方 (official Google). Pick custom and you must fill api_key + base_url or it errors.
  • api_key / base_url - override or let the mirror config supply them.
  • model - gemini-3-pro-image-preview or custom (then fill custom_model).
  • version, auth_mode - endpoint/header control, described above.
  • response_mode - TEXT_AND_IMAGE / IMAGE_ONLY / TEXT_ONLY.
  • aspect_ratio + image_size - geometry and 1K/2K/4K output.
  • upscale_factor / gigapixel_model - Topaz Gigapixel hook (2x–6x).
  • temperature / top_p / top_k / max_output_tokens / seed - sampling.
  • strict_native - force the Gemini-native format (helps with mirrors that drift).
  • system_instruction, image_mime (png/jpeg/webp), timeout, use_system_proxy - the rest.
  • Optional: imageimage4 (for editing), extra_payload_json (raw JSON to merge into the request).

Outputs: text (STRING) and image (IMAGE).

Install

ComfyUI Manager → ComfyUI_LLM_Banana, or:

cd ComfyUI/custom_nodes
git clone https://github.com/xuchenxu168/ComfyUI_LLM_Banana
cd ComfyUI_LLM_Banana
pip install -r requirements.txt

Needs google-genai>=1.51.0. Restart.

Gotchas

The priority fallback can be confusing when things silently "work" with a config key you didn't intend - check the logs (the README tells you to watch Request URL and Request Headers) to confirm which endpoint and auth actually fired. strict_native is the escape hatch if a mirror returns format errors on the OpenAI path. And the image_size 4K option is the bill-inflator: drop to 1K for drafts. Mirrors churn, so if a site 404s, the fix is usually "pick a different mirror," not a config deep-dive.

CategoryKen-Chen/LLM-Nano-Banana

Inputs (28)

NameTypeDefaultDescription
promptSTRING生成一张清晰的香水产品图
mirror_siteCOMBOnano-banana官方15 options: nano-banana官方, comfly, Comfly-HK, Comfly-US, Kuai API, T8的贞贞AI工坊, +9
api_keySTRING
base_urlSTRINGhttps://generativelanguage.googleapis.com
modelCOMBOgemini-3-pro-image-preview2 options: gemini-3-pro-image-preview, custom
custom_modelSTRING当model选择'custom'时,在此输入自定义模型名称
versionCOMBOAuto4 options: Auto, v1, v1alpha, v1beta
auth_modeCOMBOauto3 options: auto, google_xgoog, bearer
response_modeCOMBOTEXT_AND_IMAGE3 options: TEXT_AND_IMAGE, IMAGE_ONLY, TEXT_ONLY
aspect_ratioCOMBOAuto11 options: Auto, 1:1, 16:9, 9:16, 4:3, 3:4, +5
image_sizeCOMBOAuto4 options: Auto, 1K, 2K, 4K
upscale_factorCOMBO1x (不放大)使用Topaz Gigapixel AI进行智能放大
gigapixel_modelCOMBOHigh FidelityGigapixel AI放大模型
temperatureFLOAT0.900–2
top_pFLOAT0.900–1
top_kINT401–1000
max_output_tokensINT20481–32768
seedINT00–2147483647
strict_nativeBOOLEANfalse
system_instructionSTRING
image_mimeCOMBOimage/png3 options: image/png, image/jpeg, image/webp
timeoutINT30030–600API请求超时时间(秒),默认300秒
use_system_proxyBOOLEANtrueTrue=使用系统代理, False=禁用代理
imageoptIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
extra_payload_jsonoptSTRING

Outputs (2)

NameTypeDescription
textSTRING
imageIMAGE