Nodes/ComfyUI Gemini LiteLLM Nodes/Chat Params (OpenRouter)
ComfyUI Node

Chat Params (OpenRouter)

Temperature and max_tokens, OpenRouter edition — a dial node that does exactly one job

By ZUENS2020·Created 8 months ago·Updated 8 months ago· 0
Chat Params (OpenRouter)
  • base_config
  • config
temperature0.7
max_tokens2000

"Chat Params (OpenRouter)" is the OpenRouter half's version of the ChatParams node, and it's nearly identical: take the base_config from Base Config (OpenRouter), add temperature and max_tokens, emit a complete OR_CHAT_CONFIG for the Chat (OpenRouter) node. It never touches the network. Its entire existence is the middle link in Base Config (OpenRouter) → Chat Params (OpenRouter) → Chat (OpenRouter) → text.

The two inputs that matter

  • temperature - 0 to 2, default 0.7. Same creativity dial as the LiteLLM side: low for repeatable, format-strict answers, high for loose and interesting ones. If you're using this chat node to rewrite prompts or caption images, 0.7 is a reasonable starting point and you'll probably nudge it down once you want consistency.
  • max_tokens - 1 to 128,000, default 2000. The ceiling on reply length. Long structured output (JSON, multi-part breakdowns) is where you'll want to raise it - truncated replies are the classic symptom of a max_tokens that's too small for the job.

The single output is config of type OR_CHAT_CONFIG, which feeds the Chat (OpenRouter) node. Because it spreads the whole Base Config through, the optional site_url and site_name you set there ride along too, so your OpenRouter usage keeps its attribution headers downstream.

Installing it

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

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

Zero-dependency pack as always: no requirements.txt, no pip install, no model files - just stdlib urllib plus the numpy/torch/Pillow ComfyUI already ships.

Gotchas

The one thing to keep straight is the type system. OR_CHAT_CONFIG is typed for the OpenRouter pipeline, and LLM_CHAT_CONFIG is typed for the LiteLLM pipeline; ComfyUI won't let you cross them. If your connections are refusing, you've likely mixed the two halves of this pack. And since this node carries your key down the line, remember it's in the workflow JSON - a config node seems harmless, but it's part of the chain that ends in a live credential on disk.

CategoryGemini-OpenRouter/Config

Inputs (3)

NameTypeDefaultDescription
base_configOR_BASE_CONFIG
temperatureFLOAT0.70–2
max_tokensINT20001–128000

Outputs (1)

NameTypeDescription
configOR_CHAT_CONFIG