Claude
Captioning, titles, and prompt work without leaving the canvas
- response
IsekaiClaude puts an Anthropic Claude call directly inside a ComfyUI graph. You type a prompt, it calls the API, and a response string comes out the other side. That's useful for the automation-y bits of a workflow people usually hack around: auto-generating a caption or title for the image you just made, rewriting a prompt before it hits the text encoder, or summarizing a block of text into a tag. It's a text-in-text-out node that happens to live in a ComfyUI pack.
How it works
The name is a bit of a lie in the best way - there's no SDK involved. The node builds a JSON payload and POSTs it to Anthropic's /v1/messages endpoint with requests, then pulls content[0].text out of the response. Everything rides on HTTP, which is why the pack's only hard dependencies are Pillow and requests.
The important bit about keys: the node checks the ANTHROPIC_API_KEY environment variable first, and only falls back to the api_key input field if the env var is empty. So the clean way to run this is to set the env var once in your ComfyUI startup environment and never type a key into a workflow JSON - that file may get shared, and you do not want an API key embedded in a PNG's workflow metadata. The node's own placeholder text tells you the same thing.
It's a paid API. Every queue run burns tokens. Claude Sonnet and Haiku are cheap enough that you won't think about it; Opus is not something you want firing on every batch step.
The inputs that matter
prompt- your user message. Required.model-claude-sonnet-4-5,claude-opus-4-5, orclaude-3-5-haiku-latest. Sonnet is the sensible default; Haiku for cheap bulk; Opus when you want the best text.system_prompt- optional instructions, sent as Claude's separatesystemfield.api_key- only used if the env var isn't set. Prefer the env var.temperature- 0–1, default 1.max_tokens- up to 4096, default 1024. If your response comes back truncated, raise this.
Output is response, a plain STRING. Wire it into IsekaiConcatenateString to build a prompt, or into a text display node to read it.
Installing it
Part of isekai-comfy-node - one install covers every node in this pack.
ComfyUI Manager: search "isekai" → install → restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/isekai-sh/isekai-comfy-node
cd isekai-comfy-node
pip install -r requirements.txt
Restart, and it's under Isekai → LLMs. Set ANTHROPIC_API_KEY in your environment before starting ComfyUI.
Common issues
Model names drift over time. If the dropdown lists a model that Anthropic has retired or renamed, you get an API error string back (the node returns error text rather than raising - check the output for anything starting with "Error:"). That's a pack-update problem, not a you problem.
Also note the node hits a 60-second timeout. Long max_tokens settings plus slow API responses can trip it on Opus. If you're hitting timeouts, drop the model or trim max_tokens.
One caveat about doing LLM prompt-rewriting inside a graph: model-era prompts want to be natural language, and LLM outputs love adding punctuation and commentary. If you're piping Claude's output into a text encoder, tell it in the system_prompt to return only the prompt with no extra words - otherwise you'll get "Here's your refined prompt: ..." in the middle of your generation. Learning that the hard way is a rite of passage.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| model | COMBO | 3 options: claude-sonnet-4-5, claude-opus-4-5, claude-3-5-haiku-latest | |
| system_promptopt | STRING | — | |
| api_keyopt | STRING | — | |
| temperatureopt | FLOAT | 1.00–1 | — |
| max_tokensopt | INT | 10241–4096 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |