🤖 LLMs Chat | 智能对话
The chat node that rewrites your prompts — no local model, just an API key
- gpt_response
The name makes it sound like it's about to dump a 7B model into your VRAM. It isn't. LLMs Chat is a thin wrapper around the OpenAI chat API - no weights, no quantized checkpoints, nothing to download. You hand it a prompt, it talks to a cloud model, and it hands you back a string you can feed straight into a CLIP Text Encode or a Show Text node.
It's the first node I'd grab from the ComfyUI-LLMs pack, mostly because of what the author set as the default system prompt: "act as prompt generator, I will give you text and you describe an image that matches that text in details…" That's the whole pitch. You drop a rough idea in, it comes back as a polished image prompt. The author's own use case, and it's a good one - hand LLMs the grunt work of expanding "cyberpunk street at dusk" into something a sampler can actually sink its teeth into.
How it works
Mechanically it's embarrassingly simple, in the good way. The node reads settings.yaml from the pack folder, pulls out the api_base, api_key, and organisation for whatever api section you pick, and builds an OpenAI client pointed at that base URL. Then it calls chat.completions.create with your system prompt and user prompt and returns the first completion's text.
That configurable api_base is the real superpower. It means "OpenAI-compatible" isn't marketing fluff - you can point this at actual OpenAI, or at a self-hosted vLLM box, an Ollama server exposing an OpenAI-compatible route, or any of the Chinese gateways like One API. The pack is bilingual (Chinese/English UI) and it shows in the defaults: the sample config ships with glm-4, ERNIE-Bot-4, and qwen-turbo-internet alongside the GPT names.
The inputs that matter
- api - which config section from
settings.yamlto use. Defaults todefault; you add more sections if you juggle multiple providers. - model - a dropdown of the models listed in that section's config. Add model names in
settings.yaml, not in the node. - system_prompt / user_prompt - both multiline. The system prompt defaults to the prompt-generator instruction; swap it if you want the node to do something else entirely.
- temperature - 0 to 2, default 0.99, which is noticeably hot. If it's riffing too hard, drop it toward 0.7.
- top_p (optional) - defaults to 1. Leave it alone until you know why you're changing it.
The one output is gpt_response (a STRING). Wire it into whatever consumes text.
Installing it
ComfyUI Manager: search "ComfyUI-LLMs" and install. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/leoleelxh/ComfyUI-LLMs
cd ComfyUI-LLMs
pip install -r requirements.txt
cp settings.yaml.sample settings.yaml
Then edit settings.yaml with your key and endpoint and run python validate_config.py to confirm the config loads. No model files, ever - dependencies are just the four cloud SDKs (openai, zhipuai, dashscope, google-generativeai).
Where people get burned
- The placeholder key. The sample config ships with
sk-xxxxxxx. Forget to change it and every call fails with an auth error that looks like a much bigger problem than it is.validate_config.pyeven warns you about it. - The README's clone URL is wrong. It says
leoleexh/ComfyUI-LLMs; the real repo isleoleelxh. Use the Manager, or copy the URL above. - Defaults are creative. Temperature 0.99 means you'll get variety run to run. Good for prompt ideation, bad if you want the same phrasing back.
- Proxies. Some model endpoints (OpenAI outside China, the Chinese APIs inside it) need a proxy. The README says it plainly: "Some models may require proxy access."
- A licensing quirk. The README claims MIT, but the LICENSE file in the repo is GPL-3.0. Nobody's chasing you for a node, but know which one governs if you redistribute.
- Don't grab a random "LLM vision/chat" node to do this job. The category has a genuinely infamous malware history (the ComfyUI_LLMVISION incident of 2024 got someone a federal prosecution). Install this pack from the official repo only.
One more nice thing: your API key lives in settings.yaml, not in the workflow JSON. So when you share a workflow built on this node, you're not leaking a key in the PNG metadata - which is more than you can say for a lot of LLM nodes.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| api | COMBO | default | 1 options: default |
| model | COMBO | gpt-3.5-turbo | 1 options: gpt-3.5-turbo |
| system_prompt | STRING | act as prompt generator, I will give you text and you describe an image that matches that text in details, answer with one response only.if I input in Chinese to communicate with you, but it is crucial that your response be in English. | — |
| user_prompt | STRING | your user prompt here | — |
| temperature | FLOAT | 0.990–2 | — |
| top_popt | FLOAT | 1.000.001–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| gpt_response | STRING | — |