ComfyUI Node

Chat (LLM)

Chat with a local LLM inside ComfyUI — and hand its answer to your prompt chain

By Conlller·Created 8 months ago·Updated 4 days ago· 0
Chat (LLM)
  • llm_config
  • assistant_response
  • readable_history
model_namellama3
base_urlhttp://127.0.0.1:11434
user_message
actionsend
session_iddefault
system_prompt
refresh_sessionfalse
auto_clear_inputtrue

LLM-assisted prompting stopped being a browser-tab habit and became a node. The corpus numbers say it plainly: prompt enhancer went from 12 mentions in 2023 to 253 in the first half of 2026. If your image model reads prompts as instructions - which the Qwen3-class encoders do - then having another LLM write that instruction is a translation between two things that speak the same language. This node is the "talk to the LLM" half of that workflow, sitting right on the graph.

Let's get the name out of the way first: Chat (Ollama) is a lie in one direction only. It's also the chat node for Hugging Face, OpenAI, DeepSeek, Qwen, and Claude - the Ollama name is just the default provider and the path of least resistance. With no extra config it talks to a local Ollama instance at http://127.0.0.1:11434 using the default model llama3. So the only thing standing between you and a working multi-turn chat node is an Ollama install and one ollama pull llama3.

How it actually works

Under the hood the node is a thin wrapper around Ollama's /api/chat endpoint. You give it a user_message and an action, it keeps a running message history in memory (keyed by session_id), and each send appends your input, calls the model, and stores the reply. Nothing exotic - the exotic bit is the UI. The frontend adds an Execute button that posts straight to a local /chat_optimize/chat endpoint, so you can chat without queueing up an image-generation run. Nice touch if you're iterating on a prompt five times a minute.

The four action values are the whole personality of this node:

  • send - append your message, get an answer.
  • regenerate - drop the last assistant turn and ask again.
  • clear - wipe history for this session (keeps the system prompt).
  • deliver_to_optimizer - the one that matters for prompt workflows. This action doesn't call the model at all. It just returns the latest assistant reply from history, ready to feed downstream.

Here's the trap everyone hits first: the assistant_response output is empty for send, regenerate, and clear. Only deliver_to_optimizer fills it. So the rhythm is: chat away with send, then flip the action to deliver_to_optimizer, Execute again, and the final answer flows out of assistant_response into your optimizer node or prompt text field. The second output, readable_history, always carries the full transcript as a Role: content dump - wire that into Chat History Viewer and you've got a scrollable log.

Inputs that matter

Set model_name, base_url, and user_message - that's the daily-driver trio. The optional side: session_id (default "default"; give each conversation its own id), system_prompt (stuck at the top of history), refresh_session (reset history when toggled), and auto_clear_input (default on - the message box empties after a successful send). And llm_config - connect an LLM Config node here to switch provider or tune temperature without touching this node; once it's connected, base_url and model_name grey out because the config takes over.

Install and the honest cost

Two ways:

  • ComfyUI Manager → search ComfyUI_LLM_Embeder → Install.
  • Or cd ComfyUI/custom_nodes && git clone https://github.com/RCAKangle/ComfyUI_LLM_Embeder, then restart ComfyUI.

There's no requirements.txt and nothing pip-heavy to resolve - the node only uses requests, which ComfyUI already ships. No model downloads from the pack itself. The real prerequisite is on your machine, not ComfyUI's: Ollama running, and the model pulled (ollama pull llama3, or whatever model_name you set). If you'd rather not run anything locally, plug in an LLM Config with a provider and api_key instead.

Where people get burned

  • Connection refused on 11434. Ollama isn't running, or it's bound to a different host (check OLLAMA_HOST). That's the #1 error.
  • Errors hide in the transcript. Exceptions get caught and written back into history as [chat error] ..., so your "reply" might literally be an error string. Read the message.
  • History is in-memory only. Restart ComfyUI and every session is gone. refresh_session resets one session on demand.
  • Model not found. You set model_name to something Ollama hasn't pulled. ollama list is your friend.

Verdict

It's a small, honest pack with no dependencies and no community footprint - basically zero reddit presence and no impressions here - but the pattern it nails is real, and it's the node you'll actually reach for when the prompt-chain LLM step needs a human in the loop. Start with Ollama + llama3, chat your prompt into shape, flip to deliver_to_optimizer, and let the graph take it from there.

CategoryChatOptimize

Inputs (9)

NameTypeDefaultDescription
model_nameSTRINGllama3
base_urlSTRINGhttp://127.0.0.1:11434
user_messageSTRING
actionCOMBOsend4 options: send, regenerate, clear, deliver_to_optimizer
session_idoptSTRINGdefault
system_promptoptSTRING
refresh_sessionoptBOOLEANfalse
auto_clear_inputoptBOOLEANtrue
llm_configoptLLM_CONFIG

Outputs (2)

NameTypeDescription
assistant_responseSTRING
readable_historySTRING