LLM Messenger
Roleplay with a character, get a styled prompt out the other end
- ui_widget
- dataset
- config
- chat_history_json
- chat_history_string
- last_message
- last_user_message
- last_llm_message
- styled_prompt
- character_name
- outfit_name
- location_name
- style_name
- timeframe_name
LF_LLMMessenger is the pack's most ambitious node: a full messenger-style chat interface where you talk to a character, and the node compiles the conversation into a styled prompt you can send to an image generator. It's part roleplay tool, part prompt builder, and it's genuinely unlike anything the default ComfyUI ships.
The pitch is for character-driven workflows. Load a dataset of characters, pick one, and the chat tracks not just the dialogue but the character's outfit, location, style and timeframe - each as its own output. When the scene is right, styled_prompt hands you a prompt that captures the whole moment. It's the "LLM nodes, which also manage characters" thing the pack's own overview advertises.
How it works
The required input is the KUL_MESSENGER widget itself - the chat interface. The optional inputs are where the configuration comes in: dataset, a JSON containing the characters to talk to, and config, a JSON of parameters that initialize the interface (per the tooltips). The pack's docs point at the example workflows for the exact dataset shape - this is the one node where you genuinely want to copy the example before inventing your own format.
Outputs are rich because the node tracks the whole scene:
chat_history_jsonandchat_history_string- the conversation, structured or flat.last_message,last_user_message,last_llm_message- the recent lines.styled_prompt- the compiled prompt for image generation. The headline output.character_name,outfit_name,location_name,style_name,timeframe_name- the scene attributes, each as its own string so you can route them separately.
That last group is the clever design: the outfit, location and style aren't buried in the prompt, they're exposed as individual wires. Want to feed just the character name to one node and the style to another? They're right there.
The setup that matters
Same backend as the pack's other LLM nodes: a local, OpenAI-compatible endpoint (tested with KoboldCpp, no API key required). This node's whole character-management layer runs on top of that chat. If you haven't got a local LLM server running, the messenger has no one to talk to.
Installing it
Part of LF Nodes:
cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/comfyui-lf
Restart, or install via ComfyUI Manager (search LF Nodes). The pack pins openai==1.12.0 for these calls.
Gotchas
The dataset format is the learning curve - get the example dataset from the pack's example workflows before you build your own, because the character/outfit/location structure has to match what the node expects. And as with all the pack's chat UIs, if the messenger widget doesn't render, that's the frontend failing to load: update via Manager and restart rather than debugging your graph.
Pack note: comfyui-lf is legacy, frozen at Feb 2025; the messenger continues in lucafoscili/lf-nodes with the rebuilt LF Widgets frontend.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| ui_widget | KUL_MESSENGER | — | |
| datasetopt | JSON | The dataset JSON containing characters to talk to. | |
| configopt | JSON | Set of parameters that initializes the interface. |
Outputs (11)
| Name | Type | Description |
|---|---|---|
| chat_history_json | JSON | — |
| chat_history_string | STRING | — |
| last_message | STRING | — |
| last_user_message | STRING | — |
| last_llm_message | STRING | — |
| styled_prompt | STRING | — |
| character_name | STRING | — |
| outfit_name | STRING | — |
| location_name | STRING | — |
| style_name | STRING | — |
| timeframe_name | STRING | — |