Nodes/ComfyUI DashuaiTools/Gemini_API_Image☀
ComfyUI Node

Gemini_API_Image☀

Google's image model, called straight from your graph — no local GPU required

By Hasasasa·Created about a year ago·Updated 2 months ago· 7
Gemini_API_Image☀
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • image_11
  • image_12
  • image_13
  • image_14
  • image
  • text
API_Key<your_key>
prompt
model_namegemini-3-pro-image-preview
aspect_ratio5:4
resolution2K
thinking_modefalse
noise_seed0
aspect_ratio_text

Every so often you want a generation that your local GPU just can't produce - a Gemini-class image model, running entirely in the cloud. Gemini_API_Image wraps Google's image generation API in a node, so it plugs into a ComfyUI graph like any other generator: prompt in, IMAGE tensor out. No checkpoint download, no VRAM pressure, no local model at all. If you've got a Gemini API key, this is the least-friction way to mix cloud generations into a local workflow.

The node's default model, gemini-3-pro-image-preview, is the "Nano Banana Pro" flagship the community talks about: 4K-native output, up to 14 reference images, and a thinking mode - which is exactly why the node exposes those inputs. Google's own branding calls it the image model to beat; the node just puts it in your graph.

How it works

The node uses the official google-genai Python library. It builds a request with your prompt, an aspect ratio, a resolution, and optionally up to 14 reference images (which act as image-to-image conditioning - you can feed it a person, a product shot, a style reference, and ask for variations). The request runs in a background thread so ComfyUI stays responsive, and it actually checks for your interrupt: cancel the Queue and the node returns a "Task cancelled" message instead of wasting your tokens. Responses come back with both an image and text, and the node returns both.

That interrupt handling is a genuinely thoughtful touch for an API node - most cloud nodes in this space just hang until the request finishes, and here a misclicked prompt doesn't cost you a full generation.

Inputs

  • API_Key - required, from Google AI Studio.
  • prompt - what you want generated.
  • model_name - default gemini-3-pro-image-preview; change it as new model versions land.
  • aspect_ratio - 10 presets from 1:1 to 21:9, default 5:4. There's also an optional aspect_ratio_text field that overrides the dropdown if you need something custom.
  • resolution - 1K / 2K / 4K, default 2K.
  • thinking_mode - toggles the model's thinking config where the API supports it.
  • noise_seed - passed through when set; useful for reproducible runs.
  • image_1 … image_14 - optional reference images, wired in like any IMAGE input.

Outputs: image (an IMAGE tensor you can preview, save, or feed onward) and text (the model's text reply).

Gotchas

  • The key is the whole security model. It lives in the workflow; treat it like a password.
  • google-genai install is fiddly. The pack depends on it, and the node's own error message calls out the classic failure: the bare google package can shadow google-genai and break the import. If you hit that, the fix is:
pip uninstall -y google
pip install -U google-genai
  • Cloud generation costs money and has content policies. This is not your uncensored local Z-Image. For anything your local box can do, it should.
  • Empty responses are handled. If the API returns no image, you get a 1×1 placeholder tensor plus an error string in text rather than a crash.

Install

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

then restart ComfyUI, or install via ComfyUI Manager. Note google-genai is in the pack's requirements, so Manager handles it.

Use it when you want a Gemini-quality result in a graph that otherwise runs locally - mix it with SaveImageWithName for deterministic output names and it slots right into a production pipeline.

CategoryDaNodes/API

Inputs (22)

NameTypeDefaultDescription
API_KeySTRING<your_key>
promptSTRING
model_nameSTRINGgemini-3-pro-image-preview
aspect_ratioCOMBO5:410 options: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, +4
resolutionCOMBO2K3 options: 1K, 2K, 4K
thinking_modeBOOLEANfalse
noise_seedINT00–18446744073709550000
aspect_ratio_textoptSTRING
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE
image_9optIMAGE
image_10optIMAGE
image_11optIMAGE
image_12optIMAGE
image_13optIMAGE
image_14optIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
textSTRING