ComfyUI Node

Gemini Chat

The multimodal Swiss army knife of this pack

By Aryan185·Created about a year ago·Updated about a month ago· 14
Gemini Chat
  • image
  • audio
  • response
prompt
api_key
modelgemini-3.5-flash
temperature0.2
top_p0.95
thinkingfalse
google_searchfalse
url_contextfalse
seed69
system_instruction
thinking_budget0

If you install one node from this pack, it should probably be this one. Gemini Chat is the flexible utility that ties the whole thing together: it's a full Gemini LLM call that accepts text, an image, and even audio, and hands back a plain string. That makes it a prompt-rewriter, an image captioner, an audio transcriber, and a workflow "brain" all in one node - the thing you use to generate a better prompt for your local SDXL render, or to describe what's actually in that reference photo.

The KB's framing of Gemini is that it's the Google multimodal workhorse, and this node exposes exactly that: one input for a prompt, one optional image, one optional audio, one response string out. It's the least surprising node in the pack and the most reusable.

How it works

It uses the google-genai SDK - same genai.Client as the pack's other Google nodes - and calls models.generate_content() with your prompt plus whatever image or audio you attached (converted to inline parts in memory). Two switches add real capability: google_search attaches the Grounding with Google Search tool, letting the model answer with live web context, and url_context enables grounding on the URL content you point it at. thinking turns on the model's reasoning mode, with thinking_budget controlling how much it thinks.

The inputs that matter

  • prompt - the instruction. With an image attached, this becomes "describe this" / "what's wrong with this pose" / "write a prompt for a similar image."
  • model - eleven choices spanning the Gemini 2.5 and 3.x lines. gemini-2.5-flash is the sensible default; gemini-2.5-pro when you need the smartest answer; the flash-lite variants when you want it cheap and fast.
  • temperature (default 0.2) and top_p (default 0.95) - keep temperature low for captioning/prompt-rewriting so you get stable output.
  • thinking - on/off. Off by default; flip it on for harder reasoning tasks and set thinking_budget (with -1 = auto, 0 = disabled).
  • google_search / url_context - the grounding switches. google_search is the one you'll actually use; it makes answers current and factual but adds latency and can fail on quota.
  • system_instruction (optional) - the "you are a prompt engineer" role-setting field. Underrated; use it.
  • image and audio (optional) - attach either (or both) to the same call.
  • seed / api_key - key in the field or .env (GEMINI_API_KEY).

The output

response - a STRING. Wire it into any text input elsewhere: a prompt encoder, another node's prompt field, or a save-text node.

Installing it

One of ~20 nodes in the Aryan185/ComfyUI-ExternalAPI-Helpers pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Aryan185/ComfyUI-ExternalAPI-Helpers.git
cd ComfyUI-ExternalAPI-Helpers
pip install -r requirements.txt

Restart ComfyUI; find it under text/generation. The google-genai dependency is the one that matters. Grab a free key at aistudio.google.com/app/api-keys, paste it in or set GEMINI_API_KEY in .env (copy .env.example).

Where people get burned

The google_search toggle is the classic trap - flip it on, get an API error about the search tool, and blame the node. Search grounding is quota-limited and sometimes needs the tool enabled on the model; if it errors, turn it off rather than debugging. Also, with thinking on, responses can take noticeably longer and cost more - use it for the hard questions, not every call. And remember the seed is for ComfyUI caching here, same as the rest of the pack, so if a re-run gives you a different caption that's expected.

Real talk: this node is the reason to keep the pack installed even if you never touch the flashier image/video nodes. It's the glue.

Categorytext/generation

Inputs (13)

NameTypeDefaultDescription
promptSTRING
api_keySTRINGDirectly put Gemini API key or .env variable name (GEMINI_API_KEY)
modelCOMBOgemini-3.5-flash11 options: gemini-3.6-flash, gemini-3.5-flash, gemini-3.5-flash-lite, gemini-3.1-pro-preview, gemini-3.1-flash-lite, gemini-3-flash-preview, +5
temperatureFLOAT0.20–2
top_pFLOAT0.950–1
thinkingBOOLEANfalse
google_searchBOOLEANfalse
url_contextBOOLEANfalse
seedINT69-1–2147483646
system_instructionoptSTRING
thinking_budgetoptINT0-1–24576-1 = auto, 0 = disabled
imageoptIMAGE
audiooptAUDIO

Outputs (1)

NameTypeDescription
responseSTRING