Universal OpenAI Hub
Talk to any local LLM server straight from your graph
- image_1
- image_2
- image_3
- image_4
- extra_parameters
- reasoning_text
- response_text
The Universal OpenAI Hub is the main node of the comfyui-llm-api-client pack, and it does exactly one job: it lets you call any OpenAI-compatible LLM server from inside a ComfyUI workflow. If your server speaks the /v1/chat/completions dialect - Ollama on 11434, LM Studio on 1234, vLLM on 8000, TabbyAPI or YALS on 5000, even a cloud API - this node will talk to it. You type a prompt, it returns two text strings, done.
That's more useful than it sounds. This is the "drop an LLM into the graph as a tool" pattern: turn a rough idea into a structured prompt, caption an image, generate dialogue for a video, rewrite output into a specific format. And because the model lives in your server rather than a cloud endpoint, every call is free, offline, and uncensored - the reasons the local-LLM layer in ComfyUI exists in the first place.
How it works
Under the hood it's a thin wrapper around the official openai Python package. It builds a standard chat-completions payload, sends it to your base_url, and hands back the reply. The interesting bits are on top of that:
- Dynamic model dropdown. On startup it pings ports 5000, 8000, 11434 and 1234, queries each server's
/v1/models, and fills themodeldropdown with what it finds. This is both the best feature and the biggest gotcha (below). - Native reasoning extraction. It parses
<think>...</think>(DeepSeek-R1) and Gemma's<|channel>thoughtblocks out of the reply, so chain-of-thought goes to one output and the final answer to the other. Backends that returnreasoning_contentnatively are handled too. - Vision, the easy way. Wire an
IMAGEtensor intoimage_1throughimage_4and it base64-encodes it inline into the request. No resizing, no file juggling - just make sure the model you picked actually has vision.
The inputs that matter
Most of the required inputs are standard OpenAI fare you'll recognize from any chat API: temperature, top_p, max_tokens, presence_penalty, frequency_penalty, seed. The ones worth thinking about:
base_url- the only thing you'll change most days.http://127.0.0.1:11434/v1for Ollama,http://127.0.0.1:1234/v1for LM Studio, whatever your server exposes.api_key- defaults to"EMPTY", which is fine: local OpenAI-compatible servers don't check it. Put a real key here only if you're hitting a hosted API.model- auto-populated at startup, but you can also type any model name directly into the widget if your server wasn't running yet.extra_parameters- the socket that connects the pack's Spoke nodes (TabbyAPI, YALS, vLLM Samplers). Ignore it until you have one of those wired up.
The two outputs, reasoning_text and response_text, are plain strings - they plug into any text input in the graph, or into a save/display node if you want to see the result.
Installing it
cd ComfyUI/custom_nodes/
git clone https://github.com/DBMePls/comfyui-llm-api-client
pip install openai
Then restart ComfyUI. The only real dependency is the openai package - torch, numpy and PIL already ship with ComfyUI. On Windows portable you install into the embedded environment instead: .\python_embeded\python.exe -m pip install openai. ComfyUI Manager works too: search for comfyui-llm-api-client. Note the pack downloads no model files at all - the models live in the servers you point it at.
One honesty flag: the README's own clone command is a leftover template (git clone https://github.com/YOUR_USERNAME/...). Use the real URL above or the Manager search. It's a small thing, but it tells you how new and unpolished this pack is - it's one file of Python written by a hobbyist, first commit May 2026. That's not a reason to skip it; it is a reason to skim the source before you trust it with anything sensitive, which you should do for every fresh LLM node anyway.
Where people get burned
- The model dropdown is frozen at startup. The port scan runs once when ComfyUI loads. Start your LLM server before ComfyUI, or the dropdown only shows the fake fallbacks
default_modelandgpt-3.5-turbo. If that happens, just type your real model name into the widget manually. 'openai' Python package is not installedin the console - you missed the pip step, or installed it into the wrong Python (portable installs are the usual culprit).API Error: ...in the response output - the node couldn't reach your server. Checkbase_urland that the server is actually up; the startup probe only tests/v1/models, not the chat endpoint.
If you're generating in ComfyUI with a local model and want it to do more than answer text - think structured JSON, or the fancy anti-repetition samplers - the three Spoke nodes in this pack are where that happens.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Describe this image or answer the question. | — |
| base_url | STRING | http://127.0.0.1:5000/v1 | — |
| api_key | STRING | EMPTY | — |
| model | COMBO | 2 options: default_model, gpt-3.5-turbo | |
| system_prompt | STRING | You are a helpful AI assistant. | — |
| temperature | FLOAT | 1.000–2 | — |
| top_p | FLOAT | 1.000–1 | — |
| max_tokens | INT | 81921–128000 | — |
| presence_penalty | FLOAT | 0.00-2–2 | — |
| frequency_penalty | FLOAT | 0.00-2–2 | — |
| seed | INT | 00–18446744073709550000 | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| extra_parametersopt | LLM_PARAMS | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| reasoning_text | STRING | — |
| response_text | STRING | — |