Nodes/ERPK Collection/Claude Conversation
ComfyUI Node

Claude Conversation

Actually chat with Claude inside ComfyUI, and keep the thread

By eRepublik-Labs·Created 11 months ago·Updated 21 days ago· 1
Claude Conversation
  • client
  • conversation_history
  • response
  • conversation_history
prompt
seed-1
system_prompt
auto_trimtrue
reset_conversationfalse
temperature0.70
max_tokens2048

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 erpkERPK 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_conversation got 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_trim is for. If you genuinely need the whole thread, disable trim, but expect longer (and pricier) calls.
CategoryERPK/Claude

Inputs (9)

NameTypeDefaultDescription
promptSTRINGYour message in the conversation
seedINT-1-1–2147483647Seed for cache control. Randomizes by default to ensure fresh results each run.
clientoptCLAUDE_API_CLIENTClaude API client (optional if API key is configured in Settings)
conversation_historyoptCLAUDE_CONVERSATIONPrevious conversation state (connect from previous conversation node)
system_promptoptSTRINGOptional system prompt (only used for new conversations)
auto_trimoptBOOLEANtrueAutomatically trim old messages to fit context window
reset_conversationoptBOOLEANfalseStart a new conversation, discarding history
temperatureoptFLOAT0.700–1Creativity level
max_tokensoptINT2048256–4096Maximum length of response

Outputs (2)

NameTypeDescription
responseSTRING
conversation_historyCLAUDE_CONVERSATION