Nodes/comfyui-byokey/BYOKey LLM (OpenAI Compatible)
ComfyUI Node

BYOKey LLM (OpenAI Compatible)

One LLM node that talks to basically every chat API (and relays)

By MeteorAndy·Created 4 months ago·Updated 3 months ago· 0
BYOKey LLM (OpenAI Compatible)
  • images
  • output_text
api_key
base_urlhttps://api.openai.com/v1
modelgpt-5
prompt
instructions
temperature1.00
top_p1.00
max_tokens4096
seed0

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 is https://api.openai.com/v1. This is the field that makes the node special: set it to https://api.deepseek.com/v1 and model deepseek-chat, or https://dashscope.aliyuncs.com/compatible-mode/v1 for Qwen, and you're on a different provider with zero other changes. /chat/completions is appended for you.
  • model - a free-text field defaulting to gpt-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. seed is 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.

Categoryapi/byokey/text

Inputs (10)

NameTypeDefaultDescription
api_keySTRINGYour API key (sent as 'Authorization: Bearer <key>').
base_urlSTRINGhttps://api.openai.com/v1API base URL. Override for OpenAI-compatible relays (e.g. DeepSeek, Qwen). '/chat/completions' is appended.
modelSTRINGgpt-5The 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
promptSTRINGText inputs to the model, used to generate a response.
imagesoptIMAGEOptional image(s) to use as context for the model. To include multiple images, use the Batch Images node.
instructionsoptSTRINGSystem instructions for the model on how to generate the response (sent as the 'system' message).
temperatureoptFLOAT1.000–2Controls randomness in the response (0.0-2.0).
top_poptFLOAT1.000–1Controls diversity via nucleus sampling (0.0-1.0).
max_tokensoptINT409616–16384Upper bound for the number of tokens generated for a response.
seedoptINT00–2147483647Sampling seed (best-effort; not honored by all backends).

Outputs (1)

NameTypeDescription
output_textSTRING