Nodes/ComfyUI-y277an-Gemini/Gemini Image (y277an)
ComfyUI Node

Gemini Image (y277an)

The Gemini Image (y277an) node

By y277an·Created 2 months ago·Updated 2 months ago· 0
Gemini Image (y277an)
  • image
  • image2
  • image3
  • image
  • log
prompta photo of a cat
model
seed0
aspect_ratioauto
api_key
temperature1.00
system_prompt
top_p0.95
top_k0
enable_safetytrue
use_cachetrue

This node is the shortest path from your ComfyUI canvas to Google's closed image models - the Nano Banana line, which you cannot download no matter how much VRAM you own. Gemini Image (y277an) wraps the Gemini API so a generation looks like any other node in your graph: prompt in, IMAGE out. Underneath it is an HTTP client with your Google AI Studio key. If that framing makes you pause, good - it's the same shape of thing this ecosystem has been burned by once before, so the security habits below are not decoration.

Why you'd reach for it

Two reasons, and they're the same two reasons anyone wires a closed API into a local workflow. One: there is no local door to Nano Banana, and people still want it in the workflow - the canonical pattern is a Nano Banana start frame animated by an open model like Wan on your own GPU. Two: it's genuinely good at things local models lag on, like clean multi-language text in an image and consistent edits from a reference.

The node does double duty without you asking. Provide only a prompt and it's text-to-image. Attach an image (or image2 / image3) and it flips to edit/compose mode, sending the pictures alongside your instruction. Same node, both jobs.

How it works

The pack ships all four Gemini nodes, but each one just talks to the google-genai client with your key. Key resolution is: node's api_key field → config.json in the pack folder → GEMINI_API_KEY or GOOGLE_API_KEY env. The seed is folded to int32 because that's Gemini's ceiling. When enable_safety is off, the four standard harm categories go to BLOCK_NONE - but read the fine print: this is a Google model on a Google server, so the filter follows the model, not your toggle. The January 2026 policy already restricts famous-IP and celebrity generation at the source; there is no abliterating a closed API.

Two thoughtful touches make it a good citizen. Errors don't crash the graph - you get a grey placeholder image and a log string explaining what happened. And every request is cached by a SHA-256 of its inputs (the key is never part of the hash), so an identical second run returns instantly and costs nothing.

The inputs that matter

Only three are required: prompt, model, and seed. The model dropdown is fetched live when a key is configured, falling back to a bundled list (gemini-2.5-flash-image through gemini-3.1-flash-image) otherwise.

  • image / image2 / image3 - attach any and you're in edit mode.
  • aspect_ratio - auto, or pin it (1:1, 16:9, 9:16…).
  • enable_safety - off relaxes the filters to BLOCK_NONE; the model's own refusals remain.
  • use_cache - on by default; flip it off to force a fresh call, or change the seed.

Outputs are image (IMAGE) and log (STRING). The image wires into any image consumer - SaveImage, an upscaler, or straight into an image-to-video node. The log carries the mode, model, and any errors; glance at it before you blame the sampler.

Install

Same for all four nodes in the pack - one install gets them all.

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/y277an/ComfyUI-y277an-Gemini.git
/path/to/ComfyUI/python -m pip install google-genai pillow numpy
cd ComfyUI-y277an-Gemini
cp config.json.example config.json   # then paste your AI Studio key into it

Then restart ComfyUI. ComfyUI Manager works too - search "ComfyUI-y277an-Gemini" under Install via Git URL. The heavy part isn't models (there are none to download); it's the key and the billing.

Gotchas

  • The free tier won't do it. Image generation needs a billing-enabled AI Studio account, and it's metered per image. A session of iterating on Nano Banana Pro can run real money.
  • Put the key in config.json, not the node field. The api_key input is saved into the workflow JSON when you share it. config.json is gitignored and never written into a workflow.
  • No variations from one seed. Gemini image models reject multiple candidates, and the pack deliberately doesn't fight it - use ComfyUI's run count with a randomized seed to get N variations.
  • Watch the cache. It's on by default. If you change nothing and rerun, you get the same image for free - change the seed or prompt when you want something new.

Censorship, cost, and your data leaving the machine are the honest price of a model Google never lets you download. For everything local models do fine, keep them local. This node is for the frontier you literally cannot run - and for that job, it's the cleanest door in the pack.

Categoryy277an/Gemini

Inputs (14)

NameTypeDefaultDescription
promptSTRINGa photo of a cat
modelCOMBO5 options: gemini-2.5-flash-image, gemini-3-pro-image-preview, gemini-3-pro-image, gemini-3.1-flash-image-preview, gemini-3.1-flash-image
seedINT00–18446744073709550000
imageoptIMAGE
image2optIMAGE
image3optIMAGE
aspect_ratiooptCOMBOauto8 options: auto, 1:1, 2:3, 3:2, 3:4, 4:3, +2
api_keyoptSTRING
temperatureoptFLOAT1.000–2
system_promptoptSTRING
top_poptFLOAT0.950–1
top_koptINT00–100
enable_safetyoptBOOLEANtrue
use_cacheoptBOOLEANtrue

Outputs (2)

NameTypeDescription
imageIMAGE
logSTRING