Nodes/comfyui-byokey/BYOKey OpenRouter LLM
ComfyUI Node

BYOKey OpenRouter LLM

OpenRouter as your in-graph LLM

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey OpenRouter LLM
  • images
  • output
api_key
base_urlhttps://openrouter.ai/api/v1
modelanthropic/claude-opus-4.7
prompt
seed0
system_prompt
reasoning_effortoff
search_context_sizeoff

An LLM in your ComfyUI graph is mostly useful for one job: short structured rewriting. Prompt enhancement, captioning, dialogue for a video clip - the thing you want is a model that follows a format and stops, not one that thinks out loud for a page. OpenRouter is the classic way to get that without committing to any single lab: one key, one bill, and access to two hundred-plus models from every provider at once.

BYOKey_OpenRouter is the "bring your own key" version of the official OpenRouter node. Same idea as the whole BYOKey pack - the official ComfyUI API node forces requests through Comfy's proxy on prepaid credits, this one talks to OpenRouter directly with your key. You paste your OpenRouter key in api_key, pick a model, type a prompt, and get a STRING out.

How it works. Simple POST to openrouter.ai/api/v1 (the default base_url) with your key as a Bearer token. If you wire images into the node, they're sent as inline base64 data URIs so vision-capable models can actually see them. Output is a plain text STRING, which means it feeds into any text display node, prompt builder, or whatever downstream node takes a string.

The inputs that matter:

  • model - a curated dropdown of 21 popular models: Claude, GPT, Gemini, Grok, DeepSeek, Qwen, Mistral, GLM, Kimi, and Perplexity Sonar. Note that it's an enum, not a free-text field. If the exact slug you want isn't listed, you can't type it in - you're choosing from the pack author's snapshot of the popular list. That's the main limitation to know about.
  • prompt and system_prompt - your request and the behavioral instructions on top of it. For prompt-rewriting jobs, a firm system prompt ("return only the rewritten prompt, no commentary") does more for you than a bigger model.
  • reasoning_effort - off by default, with low/medium/high for reasoning-capable models. For short structured rewriting you almost never want reasoning on; it spends tokens and can leak chain-of-thought into the output. This KB's hard-won lesson applies here too.
  • search_context_size - Perplexity Sonar models only. Turns on web search; larger means more grounded but slower and pricier. Leave it off unless the prompt genuinely needs fresh facts.
  • seed - set to 0 to omit it entirely; most models treat a seed as a hint anyway, so don't expect reproducibility.

Output: one output (STRING). From there it's your call - into a prompt encoder, a captioner, a text viewer.

Install. Shared pack, plain clone:

cd ComfyUI/custom_nodes
git clone https://github.com/MeteorAndy/comfyui-byokey.git
# restart ComfyUI; nodes live under api/byokey/...

No dependencies beyond what ComfyUI already ships. The pack is young and has no community footprint yet, so eyeball the source before you trust it with a key - that's the standing advice for any API-wrapper node.

The honest tradeoffs. You're paying per call and your prompt leaves the machine - that's the point, but it's why a local abliterated 8B still wins for anything you want uncensored, offline, or free. Reach for OpenRouter when you want genuine large-chat quality in the graph and don't care about any of that.

Categoryapi/byokey/text

Inputs (9)

NameTypeDefaultDescription
api_keySTRINGOpenRouter API key (sent as Bearer token).
base_urlSTRINGhttps://openrouter.ai/api/v1OpenRouter API base URL. Override only for relays/mirrors.
modelCOMBOanthropic/claude-opus-4.7The OpenRouter model used to generate the response.
promptSTRINGText input to the model.
seedINT00–2147483647Seed for sampling. Set to 0 to omit. Most models treat this as a hint only.
system_promptoptSTRINGFoundational instructions that dictate the model's behavior.
imagesoptIMAGEOptional reference image(s) for vision-capable models. Sent as inline data URIs.
reasoning_effortoptCOMBOoffReasoning effort for reasoning-capable models. 'off' disables reasoning entirely.
search_context_sizeoptCOMBOoffWeb search context size (Perplexity Sonar models). Larger = more grounded but slower/pricier. 'off' omits web search options.

Outputs (1)

NameTypeDescription
outputSTRING