ComfyUI Node

Chat (OpenRouter)

A Gemini chat node that needs zero setup beyond an OpenRouter key

By ZUENS2020·Created 8 months ago·Updated 8 months ago· 0
Chat (OpenRouter)
  • config
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • STRING
promptHello!
system

"Chat (OpenRouter)" is the zero-friction version of the pack's chat node. Same idea as the plain Chat node - a Gemini conversation that returns a STRING you can pipe into the rest of your graph - but instead of talking to a LiteLLM server you run, it calls OpenRouter's API directly. Paste a key, and there is no other infrastructure. That one difference is why most beginners land here first.

Where does a chat node belong in an image workflow? It's the natural fit for the "LLM as a node" pattern this pack is built around: prompt expansion before a CLIP encoder, image captioning, dataset tagging, or a system prompt that forces the model into a strict output format. The STRING output feeds anything that consumes text, so you can also chain it into other nodes' prompt inputs mid-graph.

How it works

Structurally it's a sibling of the LiteLLM Chat node with a different transport. It reads the OR_CHAT_CONFIG you built with Base Config (OpenRouter) and Chat Params (OpenRouter), then POSTs to https://openrouter.ai/api/v1/chat/completions with an optional system message and your prompt. Any images you feed into image_1image_5 get base64-encoded as PNG data URLs inside the user message, which is what makes it multimodal - Gemini can look at your reference images and answer questions about them. Failed calls get one retry before the error lands in the console.

One implementation detail worth knowing: the config also carries the site_url and site_name from Base Config, and the node sends them as HTTP-Referer and X-Title headers. That's OpenRouter's app-attribution convention - nice for keeping track of API usage, entirely optional.

The inputs that matter

  • config - the OR_CHAT_CONFIG from Chat Params (OpenRouter). This is everything: key, model, temperature, max_tokens.
  • prompt - your actual question or instruction. Multiline, so instructions can breathe.
  • system - optional and easy to skip, but it's where you win. "You are a prompt engineer. Reply with a single comma-separated prompt, no explanation" turns a chatty model into a workflow tool.

Installing it

# ComfyUI Manager: search "Gemini LiteLLM", Install, restart

# or:
cd ComfyUI/custom_nodes
git clone https://github.com/ZUENS2020/ComfyUI-Gemini-LiteLLM

No pip install, no model files. The pack's entire dependency list is Python's standard urllib plus numpy/torch/Pillow, all of which ComfyUI already has. Your only setup is an OpenRouter key and, realistically, a bit of credit on the account.

Gotchas

Two things will surprise you. First, the OpenRouter nodes are loud - they log debug steps on every request, so the console fills with [OpenRouter DEBUG] noise on each run. That's normal behavior, not a crash. Second, Error: Missing parameters in the output means your Base Config has an empty key or model; check there before blaming OpenRouter. And the usual security reminder that applies to the whole pack: your key lives in the workflow JSON, so don't share workflows with keys baked in.

CategoryGemini-OpenRouter

Inputs (8)

NameTypeDefaultDescription
configOR_CHAT_CONFIG
promptSTRINGHello!
systemoptSTRING
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE

Outputs (1)

NameTypeDescription
STRINGSTRING