BYOKey LLM (OpenAI Compatible)
One LLM node that talks to basically every chat API (and relays)
- images
- output_text
This is the workhorse of the BYOKey pack, and probably the one to install first. BYOKey_LLM is a drop-in replacement for ComfyUI's official OpenAI chat node, except it calls the model with your own key instead of routing through Comfy's credit system. Because it speaks plain /chat/completions, it isn't just for OpenAI - point base_url at DeepSeek, Qwen, Groq, OpenRouter, or any OpenAI-compatible endpoint and the same node just works. That's the entire appeal: one node, every chat API.
What it's actually for inside a workflow: prompt enhancement, image captioning, structured text generation that feeds other nodes. The KB's LLM essay makes the case that this kind of in-graph LLM is mostly a short structured-rewriting job - turn your rough idea into a model-ready prompt, write dialogue for a video, caption an image before you feed it to an image-to-video node. You don't need a frontier reasoning model for that, but you do want a model that follows a format, and this node hands the choice to you via the model field.
How it works
It builds a standard OpenAI chat request (POST {base_url}/chat/completions) with your prompt and optional instructions (sent as the system message), then returns the model's text as a STRING. Wire an image into images and it's included as inline base64 in the message, so vision-capable models like gpt-5 can actually see what you're working on - for multiple images, the tooltip points you at the Batch Images node.
The inputs that matter
base_url- default ishttps://api.openai.com/v1. This is the field that makes the node special: set it tohttps://api.deepseek.com/v1and modeldeepseek-chat, orhttps://dashscope.aliyuncs.com/compatible-mode/v1for Qwen, and you're on a different provider with zero other changes./chat/completionsis appended for you.model- a free-text field defaulting togpt-5. The tooltip lists the current OpenAI ids (gpt-5.5-pro,gpt-4.1,o4-mini,o3,o1…), but any id your backend knows works.prompt+instructions- the user message and the system prompt respectively.temperature(0–2, default 1),top_p(default 1),max_tokens(default 4096) - the usual dials.seedis best-effort; the tooltip is honest that not all backends honor it.
Output is output_text (STRING) - feed it into a prompt text field, a Show Text node, or any other STRING consumer.
Installing it
This ships with the whole BYOKey pack, and the pack has zero extra dependencies - it only uses what ComfyUI bundles (torch, aiohttp, PIL, numpy, av). Either use ComfyUI Manager (search "byokey") or:
cd ComfyUI/custom_nodes
git clone https://github.com/MeteorAndy/comfyui-byokey.git
Restart ComfyUI and the node appears under api/byokey/text. No model downloads, no GPU needed - the actual inference happens on whoever hosts the API.
Gotchas
The thing to internalize with any BYOKey node: your api_key lives in the widget, which means it gets saved inside the workflow JSON. Don't share a workflow with your key still in it. Also, a direct-call pack like this only works if the API you're pointing at actually is OpenAI-compatible - the README's whole pitch is that most major Chinese and Western providers are, but a vendor that isn't (like Anthropic's native API) needs the dedicated Claude node instead. And before you paste a key into any custom node, remember this category has been weaponized once before (the LLMVISION incident) - this pack is open source and widely readable, so skim the code if you're cautious. That's the one security habit worth keeping with API nodes.
If you're just trying to get a frontier-quality text generator into a ComfyUI graph without running an LLM locally, this is the node to reach for. Point it at whichever API you already have a key for, and move on.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Your API key (sent as 'Authorization: Bearer <key>'). | |
| base_url | STRING | https://api.openai.com/v1 | API base URL. Override for OpenAI-compatible relays (e.g. DeepSeek, Qwen). '/chat/completions' is appended. |
| model | STRING | gpt-5 | The model used to generate the response. Common OpenAI ids: gpt-5.5-pro, gpt-5.5, gpt-5, gpt-5-mini, gpt-5-nano, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, o4-mini, o3, o1-pro, o1 |
| prompt | STRING | Text inputs to the model, used to generate a response. | |
| imagesopt | IMAGE | Optional image(s) to use as context for the model. To include multiple images, use the Batch Images node. | |
| instructionsopt | STRING | System instructions for the model on how to generate the response (sent as the 'system' message). | |
| temperatureopt | FLOAT | 1.000–2 | Controls randomness in the response (0.0-2.0). |
| top_popt | FLOAT | 1.000–1 | Controls diversity via nucleus sampling (0.0-1.0). |
| max_tokensopt | INT | 409616–16384 | Upper bound for the number of tokens generated for a response. |
| seedopt | INT | 00–2147483647 | Sampling seed (best-effort; not honored by all backends). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output_text | STRING | — |