BYOKey OpenRouter LLM
OpenRouter as your in-graph LLM
- images
- output
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.promptandsystem_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-offby 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 itoffunless 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | OpenRouter API key (sent as Bearer token). | |
| base_url | STRING | https://openrouter.ai/api/v1 | OpenRouter API base URL. Override only for relays/mirrors. |
| model | COMBO | anthropic/claude-opus-4.7 | The OpenRouter model used to generate the response. |
| prompt | STRING | Text input to the model. | |
| seed | INT | 00–2147483647 | Seed for sampling. Set to 0 to omit. Most models treat this as a hint only. |
| system_promptopt | STRING | Foundational instructions that dictate the model's behavior. | |
| imagesopt | IMAGE | Optional reference image(s) for vision-capable models. Sent as inline data URIs. | |
| reasoning_effortopt | COMBO | off | Reasoning effort for reasoning-capable models. 'off' disables reasoning entirely. |
| search_context_sizeopt | COMBO | off | Web search context size (Perplexity Sonar models). Larger = more grounded but slower/pricier. 'off' omits web search options. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | STRING | — |