LLM Chat
Chat with a local LLM inside your workflow, then use the answer
- ui_widget
- chat_history_json
- last_message
- last_user_message
- last_llm_message
- all_messages
This is the node the author highlighted when the pack launched its big refactor: a chat window that lives inside your workflow, talks to a local LLM in real time, and lets you submit the resulting prompt the moment the response looks interesting. LF_LLMChat is a full chat UI on a node - with the conversation's contents as real outputs you can feed downstream.
The workflow it's built for is prompt iteration. You want to brainstorm, refine, or generate prompt text, and you want the good result to drop straight into your sampler instead of being copy-pasted across windows. Chat until the model nails the prompt, then wire last_llm_message (or the whole history) into your text encode. No switching apps, no clipboard.
How it works
Here's the surprising part: the node has no required inputs other than its KUL_CHAT widget. No model URL, no temperature, no endpoint. The chat interface is the interface - and under the hood it talks to the same local OpenAI-compatible endpoint the rest of the pack's LLM nodes use (default http://localhost:5001/v1/chat/completions). That endpoint choice is configured at the pack level; this node inherits it.
Outputs cover everything you'd want from a conversation:
last_message- the most recent message, whoever sent it.last_user_message- your last line, for logging or echoing back.last_llm_message- the model's last answer. This is the one you'll usually wire into your prompt.all_messages- every message as a list, for full-context handoff.chat_history_json- the whole conversation as JSON, for saving or feeding a multi-turn prompt builder.
If you're building a pipeline that needs the LLM to see its own previous turns - iterative prompt refinement, for instance - the chat_history_json output is how you preserve context.
The setup that matters
Like every LLM node in this pack, LF_LLMChat needs a local, OpenAI-compatible LLM server running and does not need an API key. The README says it was tested with KoboldCpp; any compatible local endpoint works. If you're not running one, the chat will simply do nothing - this is not a node that generates text on its own.
Installing it
Part of LF Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/comfyui-lf
Restart ComfyUI, or search LF Nodes in ComfyUI Manager. The pack pins openai==1.12.0 as the client library for these LLM calls.
Gotchas
Two failure modes dominate. First: no server running, so the chat spins forever or errors - get KoboldCpp (or whatever endpoint you use) up before testing. Second: the chat widget is custom frontend, and if it doesn't render you're looking at a frontend-load failure, not a logic bug - update the pack and restart clean.
Pack note: comfyui-lf is legacy, frozen at Feb 2025. The author's continued work lives in lucafoscili/lf-nodes, where the chat widget was rebuilt on the new LF Widgets library.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| ui_widget | KUL_CHAT | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| chat_history_json | JSON | — |
| last_message | STRING | — |
| last_user_message | STRING | — |
| last_llm_message | STRING | — |
| all_messages | STRING | — |