Claude Conversation
Actually chat with Claude inside ComfyUI, and keep the thread
- client
- conversation_history
- response
- conversation_history
Claude Conversation is the node that makes the "C" in ComfyUI actually stand for conversational. Unlike the one-shot text generation node, this one keeps a running thread: you feed it your message, it replies, and it hands back a conversation_history object you feed into the next Conversation node. Chain a few of them and Claude remembers what it said earlier - which is the whole difference between "generate a caption" and "iterate on a caption with someone who remembers the feedback."
The execution model is a little unusual for ComfyUI, so it's worth spelling out. Each Claude Conversation node is one turn in the conversation, and you link them by passing the history through: node 1's conversation_history output goes into node 2's conversation_history input, and so on. Change your message in an earlier node and everything downstream re-runs with the updated context. It's a static chain, not a dynamic chat widget, but for scripted multi-step dialogues - ask a question, refine, refine again - it works great.
The inputs that matter
- prompt - your message for this turn.
- conversation_history - connect the previous Conversation node's history output here to continue the thread. Leave it unconnected to start fresh.
- system_prompt - sets the character/instructions, but only for a new conversation (it's stored with the history and ignored on later turns).
- auto_trim - on by default; automatically drops old messages to keep the thread inside the context window. Leave it on.
- reset_conversation - flip on to discard history and start over.
- temperature (0–1) and max_tokens - response behavior; defaults 0.7 and 2048.
Outputs are the response STRING (the reply, wire it into any text display or downstream node) and conversation_history (the thread state, chain it forward). The seed widget is cache control only - it's not a real generation seed.
How it works
Under the hood it builds a message list, appends your new prompt, calls Anthropic with the system prompt attached, and stores the updated history - trimming older messages when auto_trim is on so you don't run out of context. The client input is optional; unconnected, it resolves the key from Settings and creates a standalone client.
Installing it
Part of the ERPK Collection (eRepublik-Labs/comfyui-nodes-erpk). ComfyUI Manager: search erpk → ERPK Custom Nodes → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk
pip install -r requirements.txt
Needs anthropic>=0.96.0 and an Anthropic API key (Settings → ERPK → API Keys). No model downloads.
Common issues
- It forgot what I said - you didn't chain the history, or
reset_conversationgot flipped on. Check the wiring and the toggle. - System prompt only applied once - that's by design; it's captured when the conversation starts. Restart the thread to change it.
- "Prompt cannot be empty" - every turn needs a message.
- Context runs long - that's what
auto_trimis for. If you genuinely need the whole thread, disable trim, but expect longer (and pricier) calls.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Your message in the conversation | |
| seed | INT | -1-1–2147483647 | Seed for cache control. Randomizes by default to ensure fresh results each run. |
| clientopt | CLAUDE_API_CLIENT | Claude API client (optional if API key is configured in Settings) | |
| conversation_historyopt | CLAUDE_CONVERSATION | Previous conversation state (connect from previous conversation node) | |
| system_promptopt | STRING | Optional system prompt (only used for new conversations) | |
| auto_trimopt | BOOLEAN | true | Automatically trim old messages to fit context window |
| reset_conversationopt | BOOLEAN | false | Start a new conversation, discarding history |
| temperatureopt | FLOAT | 0.700–1 | Creativity level |
| max_tokensopt | INT | 2048256–4096 | Maximum length of response |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |
| conversation_history | CLAUDE_CONVERSATION | — |