Nodes/PromptModels Studio/Gemini Chat (PMS)
ComfyUI Node

Gemini Chat (PMS)

A text LLM, vision model, and YouTube analyzer in one node

By cdanielp·Created 9 months ago·Updated 2 months ago· 28
Gemini Chat (PMS)
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • text
promptDescribe esta imagen en detalle.
modelgemini-3.1-pro-preview
thinking_budgetOff
api_key
system_prompt
youtube_url
max_tokens4096
temperature0.70

This is the workhorse of the PromptModels pack: a single node that talks to Gemini over REST and returns text, but can also look at images and even a YouTube video while it answers. Want a caption for the image you just generated? A LoRA trigger word? A rewritten prompt in a different style? Wire the image in, ask, and get a string out the other side. It's "Gemini in a box" for anything that fits in a text input.

Mechanically it's a thin wrapper over Gemini's generateContent endpoint. Text plus up to five images become parts in one request (images get compressed to base64 JPEG before they're sent), and the node returns the text from the first candidate. There's no local model, no VRAM cost, and no SDK - just requests. The cost is per-token Gemini API usage, and you need a GEMINI_API_KEY to make it do anything at all.

The inputs that matter

  • prompt - your actual instruction. Multiline, so treat it like a chat message.
  • model - defaults to gemini-3.1-pro-preview; the combo includes flash variants for faster/cheaper runs. When you're iterating, flash is usually the right call.
  • thinking_budget - Off / Low / Medium / High. This is Gemini's reasoning knob: on the 3.x models it maps to thinkingLevel, on 2.5 to thinkingBudget. Turn it on for hard analysis, leave it Off for speed.
  • image_1 … image_5 - optional IMAGE tensors for vision questions ("describe this image in detail" is the default prompt for a reason).
  • youtube_url - a real standout: paste a video URL and it's attached as fileData for Gemini's native video understanding. Ask it to summarize a tutorial and paste the result into your workflow.
  • system_prompt, temperature, max_tokens - standard LLM controls. max_tokens goes up to 65,536.

Output is a single text string. Feed it into a text display node, a prompt textbox, or any downstream node that takes a STRING.

GeminiChat vs GeminiChat V3

PMS_GeminiChat is flagged deprecated in the pack - it's a compatibility alias of the older GoogleAI_TextNode, kept alive so saved workflows keep loading. It still works exactly the same. If you're building fresh, use PMS_GeminiChatV3 instead: same guts, same generateContent call, but it's the actively maintained one, adds a custom_model override, and doesn't carry the deprecated flag.

Installing it

ComfyUI Manager → search "COMFYUI_PROMPTMODELS" → install → restart, or:

cd ComfyUI/custom_nodes
git clone https://github.com/cdanielp/COMFYUI_PROMPTMODELS

Then create a .env in the pack folder:

GEMINI_API_KEY=AI...

and restart. That's it - requests and Pillow are the only real dependencies, and ComfyUI >= 0.26.0 is required.

Where people get burned

The key-handling trap again: don't paste GEMINI_API_KEY into the node's api_key field. It ends up in your workflow JSON and, if you save a PNG, in the PNG metadata. The .env route keeps the field empty and your key out of your files.

Second: Gemini is multimodal, but the images you feed in get downscaled to fit a 1024px JPEG. Don't expect the node to read fine text from a tiny screenshot - that's an API limit, not the node being broken. And if you're hammering the free tier with 65k max tokens and thinking on High, you'll meet the 429 rate limiter; the pack's client retries with backoff, so it just slows down rather than dying.

CategoryGoogle AI/Text

Inputs (13)

NameTypeDefaultDescription
promptSTRINGDescribe esta imagen en detalle.
modelCOMBOgemini-3.1-pro-preview4 options: gemini-3.1-pro-preview, gemini-3-flash-preview, gemini-2.5-pro, gemini-2.5-flash
thinking_budgetCOMBOOffGemini 3+: thinkingLevel. Gemini 2.5: thinkingBudget.
api_keyoptSTRING
system_promptoptSTRING
image_1optIMAGEImagen 1 para análisis multimodal.
image_2optIMAGEImagen 2 (opcional).
image_3optIMAGEImagen 3 (opcional).
image_4optIMAGEImagen 4 (opcional).
image_5optIMAGEImagen 5 (opcional).
youtube_urloptSTRING
max_tokensoptINT409664–65536
temperatureoptFLOAT0.700–2

Outputs (1)

NameTypeDescription
textSTRING