Nodes/SDVN_Comfy_node/🎨 Nano Banana (Gemini 2)
ComfyUI Node

🎨 Nano Banana (Gemini 2)

Nano Banana inside ComfyUI

By StableDiffusionVN·Created 2 years ago·Updated about a month ago· 118
🎨 Nano Banana (Gemini 2)
  • image
  • image
  • prompt
Gemini_API
max_size_input0
preset
prompt
sub_prompt
translateenglish
seed0
show_previewtrue

This is Google's Nano Banana - Gemini 2.5 Flash Image - wired into a ComfyUI node so you can call it mid-workflow instead of tabbing over to a browser. It's an API node, not a local model. Nothing gets downloaded, nothing runs on your GPU, and it will not work without a Google API key. If you were hoping for weights on disk, this is the other thing: your prompt (and an optional reference image) goes to Google, an image comes back.

Worth being clear about what Nano Banana is, because the branding is a mess. The name started as an anonymous codename on a HuggingFace leaderboard, Google execs leaned into the banana emoji bit, and it stuck. Under the hood it's Gemini-native image generation. This node is the plain Flash tier - fast, cheap, good at prompt-driven edits when you feed it a reference image. If you want the 4K, up-to-14-reference-images flagship, that's the separate Nano Banana Pro node in this same pack.

How it works

You give it text, optionally an image, and it sends a request to the Gemini API. The SDVN twist is the conveniences baked around that call. The translate field defaults to english, which means it auto-translates your prompt before sending - handy if you write in another language, and the reason a Vietnamese-community pack ships it on by default. There's Google Translate and dynamic-prompt support on the text fields across this whole pack, so {red|blue|green} car style wildcards work here too.

The inputs and outputs that matter

  • Gemini_API - your key. Paste it here, or leave it blank and set it once in the pack's API_key.json (more on that below).
  • prompt (and sub_prompt) - what you want. prompt is the main instruction; sub_prompt is a second text field to stack extra detail without cramming one box.
  • image (optional) - a reference. This is where Nano Banana earns its keep: hand it a photo plus "put this person on a beach" and it edits rather than generates from scratch.
  • max_size_input - caps how large the reference image is before it's sent (0 means don't resize). Bigger reference = more tokens = more cost, so this is a real lever, not decoration.

Two outputs: image (wire into a Save Image or downstream node) and prompt (the final text actually sent, after translation - useful for logging what got generated).

How to install it

Two ways. In ComfyUI Manager, open the Custom Nodes Manager, search SDVN_Comfy_node, install, restart. Or by hand:

cd ComfyUI/custom_nodes
git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node

then from your ComfyUI root install the deps - pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt - and restart.

For the key: grab one at aistudio.google.com/app/apikey. You can paste it into the Gemini_API field, but the cleaner move is to rename API_key.json.example to API_key.json in the pack folder and drop it there once, so it's not sitting in your saved workflow JSON.

Common issues & troubleshooting

Blank output or an API error. Almost always the key: missing, wrong, or a Google account with no billing/quota. Test the same key in Google AI Studio first to isolate it.

"But it's censored." Yes. Gemini's image safety filtering is aggressive and got stricter in a January 2026 policy update, with hard limits on celebrity and famous-IP generation. If a prompt silently comes back empty or refused, that's the filter, not the node. This is server-side - you can't tune it out.

Every image carries a watermark. Google embeds an invisible SynthID watermark in everything Gemini generates. It won't show, but it's there, which matters if you care about provenance.

"Requirement already satisfied" spam on startup. Harmless - that's ComfyUI re-checking this pack's requirements.txt on every launch. It's noise, not an error.

Category📂 SDVN/💬 API

Inputs (9)

NameTypeDefaultDescription
Gemini_APISTRINGGet API: https://aistudio.google.com/apikey
max_size_inputINT00–2048Giới hạn kích thước ảnh
presetCOMBOPreset prompt cho tạo ảnh.
promptSTRINGNội dung yêu cầu chính
sub_promptSTRINGPrompt phụ, ghép giống node chatbot
translateCOMBOenglishNgôn ngữ dịch
seedINT00–18446744073709550000The random seed
show_previewBOOLEANtrueHiển thị preview ảnh output trên node
imageoptIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
promptSTRING