URL语言丨API
Point a chat node at any OpenAI-compatible LLM — local vLLM included
- generated_text
- conversation_info
- total_tokens
- raw_response
- status
The named API nodes in this pack are nice, but they only talk to their own providers. CustomURLLanguageAPI is the escape hatch: you give it any OpenAI-compatible base_url, a model, and an optional key, and it becomes a chat node for whatever that endpoint serves. That means a local vLLM or Ollama server on your own machine, an OpenRouter key, a Chinese gateway, a corporate proxy - if it speaks the OpenAI chat format, this node talks to it. It's the most flexible LLM node in the pack, and for many people it's the only one they need.
It's part of ComfyUI-QING's API category, and it shares the pack's multi-turn history framework, so it behaves like the other language nodes - with one crucial difference: the endpoint is entirely yours to specify.
How it works. Under the hood it's an OpenAI chat-completions client pointed at your base_url. The tooltip tells you the base URL can be a root address or include /v1 - the client normalizes it. The model field is the model ID as your server actually names it (no friendly-name mapping here, no platform routing - you type what the endpoint expects). The key comes from three places in priority order: the node's own api_key_override, the CUSTOM_URL_API_KEY environment variable, or the QING settings panel's custom_url_api_key. Conversation history is kept in memory for history rounds, and clear_history resets it.
The inputs that matter.
text_input- your message (multiline).system_prompt- optional system instruction.base_urlandmodel- the whole point of the node. Get these right and everything else is standard.max_tokens(default 2048) andhistory(default 10).- Optional:
temperature(0.7),top_p(0.9),repetition_penalty(1.0),timeout_sec(120),clear_history.
Also useful when the endpoint needs special auth or extra fields: custom_headers_json (e.g. {"X-API-Key":"..."}) and extra_body_json, which merges arbitrary JSON into the request body - that's how you set provider-specific parameters the node doesn't expose as widgets.
Outputs: generated_text, conversation_info, total_tokens, raw_response, and status - the last two are your debugging window when an endpoint misbehaves.
How to install. ComfyUI-QING is a one-pack install - search "ComfyUI-QING" in ComfyUI Manager, or:
cd ComfyUI/custom_nodes
git clone https://github.com/GAO-SHIQING/ComfyUI-QING
cd ComfyUI-QING
python install_dependencies.py
The pack depends on the openai library, which is already in its requirements, so nothing extra for the API plumbing. Restart after installing. The README's clone URL is typo'd (GAOSHI-QING, missing the H) - use the URL above or Manager.
Troubleshooting. Most failures here are endpoint problems, not node problems. The classic trio: wrong base_url (check for a trailing-path mismatch - try both root and /v1), wrong model ID for that server, and a key that isn't where the node looks. The status and raw_response outputs exist precisely to show you the server's actual error - read them before changing anything else. If you're pointing at a local server, make sure it's actually running and reachable, and note that timeout_sec defaults to 120s, which is plenty for chat but tight if the server is loading a model on first call. And a security note the KB's API essay makes loudly: an arbitrary-Python API node that holds a key and phones home is exactly the shape that got this ecosystem burned once - with a custom URL node you're handing it your endpoint and your key, so install the pack from the official repo and don't paste third-party workflow keys you don't understand.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| text_input | STRING | 发送给模型的用户文本 | |
| system_prompt | STRING | 可选 system prompt | |
| custom_headers_json | STRING | 可选JSON对象,例如 {"X-API-Key":"..."} | |
| extra_body_json | STRING | 可选JSON对象,会合并进请求体 | |
| base_url | STRING | OpenAI兼容服务地址,可填根地址或 /v1 | |
| model | STRING | 模型ID,按自定义服务实际名称填写 | |
| api_key_override | STRING | 仅当前节点生效;留空时读取 CUSTOM_URL_API_KEY 或 QING custom_url_api_key | |
| max_tokens | INT | 20481–128000 | — |
| history | INT | 101–40 | 保留的历史对话轮数 |
| temperatureopt | FLOAT | 0.700–2 | — |
| top_popt | FLOAT | 0.900–1 | — |
| repetition_penaltyopt | FLOAT | 1.000.5–2 | — |
| timeout_secopt | INT | 1205–600 | — |
| clear_historyopt | BOOLEAN | false | 清除该节点内存中的对话历史 |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| generated_text | STRING | — |
| conversation_info | STRING | — |
| total_tokens | INT | — |
| raw_response | STRING | — |
| status | STRING | — |