Claude Chat
Put Claude in your ComfyUI graph (with a real API key and a real bill)
- image
- response_text
- usage_info
- input_tokens
- stop_reason
- conversation_id
- history_messages
- cost_usd
- model_info
This node ("Claude Chat" in the menu) drops Anthropic's Claude right into your graph as a chat-and-vision node. It's not a local model and it's not free: you paste an API key, every run makes a real API call to Anthropic, and your prompt (and any image you feed it) leaves your machine. That's the entire deal, so know it going in - this is the "bring an LLM in to write a prompt or look at an image" pattern, not another sampler.
So why reach for it? In the videoclipgenerator world it slots in nicely upstream of everything else: Claude writes the lyrics, the voiceover script, or the per-shot image prompts that VibeMusicEngine and MovingTitles then consume. Feed it a generated frame through the optional image input and it'll describe what's on screen - useful when you're trying to prompt a consistent style across a video's worth of shots. The output plumbing is unusually generous: response_text, plus input_tokens, cost_usd, stop_reason, and a conversation_id you can reuse to keep chatting.
The inputs that actually matter
api_key- your Anthropic key. Leave it blank and it falls back to anANTHROPIC_API_KEYenvironment variable; blank both and it throws.model- four choices baked in:claude-3-5-sonnet-latest,claude-3-opus,claude-3-sonnet,claude-3-haiku. The tooltip's cost framing is the point: Opus is the expensive brain, Haiku is the cheap fast one.promptandsystem_prompt- your message and the persona/constraints it operates under. The default system prompt is "you are a helpful AI assistant in ComfyUI" which is fine to replace.max_tokens(default 1024) andtemperature(default 0.7) - response length and randomness. Drop temperature toward 0 when you want structured, repeatable output.new_sessionandclear_history(no/yes/all) - control conversation state.conversation_idin the optional section lets you resume a specific thread later.summarize(default on) - auto-summarizes history as you approach the context window so a long dialogue doesn't hard-fail.
The optional image input takes an IMAGE tensor, with image_prompt being the specific question ("What can you see in this image?"). Note the tooltip's fine print: vision is only supported by Claude 3 models except Haiku.
What comes out
response_text is what you actually use. usage_info and input_tokens track spend, cost_usd is the nice-to-have that tells you what that run just cost you in dollars, history_messages reports how much context got carried, and model_info is a readout when you tick show_model_info.
Installing it
It ships inside the videoclipgenerator pack. ComfyUI Manager → search "videoclipgenerator", or:
cd ComfyUI/custom_nodes
git clone https://github.com/lazniak/videoclipgenerator
cd videoclipgenerator
pip install -r requirements.txt # or: python install.py
Restart ComfyUI. The only pack dependency this node pulls in beyond the usual is the anthropic Python package.
Gotchas
The two things that bite people: forgetting the key (paste it in the widget or set ANTHROPIC_API_KEY in your environment) and forgetting you're paying per call - wire this into a batch workflow and watch cost_usd for a while before you trust it. Also, every node in this pack has a buy_me_a_coffee checkbox, and ticking it makes the node open a browser tab to the author's Buy Me a Coffee page. It's opt-in, it just surprises people. And the standard API-node warning applies: this is custom Python holding a credential and phoning home by design, so know what you installed - the LLMVISION incident should keep you honest about which packs you trust with a key.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Your Anthropic API key. Can be set as ANTHROPIC_API_KEY environment variable. | |
| model | COMBO | claude-3-5-sonnet-latest | Select Claude model. Each has different capabilities and costs. |
| prompt | STRING | Hello, Claude! | The message to send to Claude |
| system_prompt | STRING | You are a helpful AI assistant in ComfyUI environment. Provide clear, accurate, and concise responses. When discussing code or technical concepts, use specific examples where helpful. If you're not sure about something, say so. | System prompt to set context and behavior for Claude |
| max_tokens | INT | 10241–8192 | Maximum number of tokens in response |
| temperature | FLOAT | 0.700–1 | Controls randomness (0 = deterministic, 1 = creative) |
| new_session | BOOLEAN | false | Start a new conversation session |
| clear_history | COMBO | no | Clear history options: no: Keep history yes: Clear current session all: Clear all saved conversations |
| summarize | BOOLEAN | true | Automatically summarize conversation history when approaching token limits |
| show_model_info | BOOLEAN | false | Display detailed information about the selected model |
| buy_me_a_coffee | BOOLEAN | false | Support the development! ☕ |
| imageopt | IMAGE | Optional image to analyze. Only supported by Claude 3 models (except Haiku). | |
| image_promptopt | STRING | What can you see in this image? | Specific question about the image. Used only when image is provided. |
| conversation_idopt | STRING | Optional conversation ID to continue specific conversation |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| response_text | STRING | — |
| usage_info | STRING | — |
| input_tokens | INT | — |
| stop_reason | STRING | — |
| conversation_id | STRING | — |
| history_messages | INT | — |
| cost_usd | FLOAT | — |
| model_info | STRING | — |