Nodes/Anthropic Claude/Anthropic Claude
ComfyUI Node

Anthropic Claude

Claude as your prompt engineer, wired straight into the graph

By alexmunteanu·Created 7 months ago·Updated 28 days ago· 0
Anthropic Claude
  • images
  • response
  • thinking
prompt
modelSonnet 4.6
seed739204185613097
templateNone
instructions
temperature1.00
max_tokens4096
extended_thinkingfalse
thinking_budget4096
max_image_size1024

The node that rewrites your prompt, but never touches your GPU

Here's the thing that makes AnthropicClaudeNode different from most of the LLM-in-the-graph crowd: it runs nothing on your machine. It's a thin bridge from your ComfyUI canvas to the Anthropic API. You type a rough idea, it hands the job to Claude, and Claude's rewritten prompt comes back as a string on the canvas - ready to feed into any text-to-image or text-to-video workflow.

Why reach for it over the local-LLM enhancers? Two reasons. First, quality: a frontier model writing a structured prompt is doing a different job than an 8B abliterated model, and for clean prompts the frontier version usually wins. Second, zero VRAM - no GGUF, no Ollama server, nothing squatting on your card next to your diffusion model. The flip side is a per-call API bill and the fact that a hosted API filters, so if your workflow needs the uncensored stuff, this isn't the node for you; go local. For clean, polished public prompts it's hard to beat, and it's a genuinely pretty package: searchable execution history, token/cost tracking in the footer, even a status dot for the API's health.

How it works

Mechanically it's simple and honest about it. This is a V3-style node, so you need a ComfyUI from 2025+ that supports those. At startup it calls the Anthropic API to fetch your available models, caches the list for an hour, and falls back to a built-in dropdown if it can't reach the API or the key isn't set yet. On a run it sends your prompt plus optional images to Claude, using the selected template or your own instructions as the system prompt, and returns the text.

Two mechanisms are worth understanding because they'll save you money. Seed-based caching: the seed input isn't seeding anything random - it's a cache key. Keep the same seed and change nothing else, and the node hands back the previous response without making an API call. Randomize (or let Control After Generate bump it) to force a fresh call. That's a real money-saver when you're iterating on downstream nodes but not the prompt itself. And vision: connect any IMAGE tensor and it converts each image to JPEG, resizes so the longest side fits max_image_size (the API cap is 1568px, default 1024), and sends it as base64. Every pixel costs tokens, so if your image bills feel fat, drop max_image_size to 512 - roughly a quarter of the tokens per image.

The inputs that matter

  • prompt - the only required text. Multiline, so don't be shy.
  • template - the headline feature. 60 built-in templates encoding how each model likes its prompts, generation and editing variants for FLUX, Kling, Veo, Wan, Seedance, Nano Banana, LTX, Sora, and friends. Pick one and its instructions load automatically. Connect your own text into instructions and it overrides the template.
  • seed - caching, above. This one surprises people.
  • images, max_tokens, temperature - the usual knobs. Note temperature is forced to 1.0 whenever extended_thinking is on; that's an Anthropic API requirement, not a bug.

Two outputs: response (STRING, wire it into your text encoder or a preview) and thinking (STRING - Claude's chain-of-thought when extended thinking is enabled, empty otherwise).

Install

No model downloads, no VRAM budget - the only real dependency is the official anthropic Python SDK. In ComfyUI Manager, search "Anthropic Claude" and install. Manually:

cd ComfyUI/custom_nodes
git clone https://github.com/alexmunteanu/comfyui-anthropic-claude.git comfyui_anthropic_claude
pip install "anthropic>=0.122.0"

Then set a CLAUDE_API_KEY (grab one at platform.claude.com) and restart ComfyUI. The pack's getting-started doc walks through the env-var setup per OS.

Common issues

The failure modes are almost all API-shaped, and the node meets you halfway: if the key is missing or wrong, a modal pops up where you can paste a corrected key and retry without restarting. See the model dropdown full of generic names? Same root cause - it fell back because it couldn't reach the API. 'anthropic' package not installed means pip landed in the wrong environment (activate ComfyUI's venv first on portable installs). A gray status dot just means the status.claude.com health poll is blocked by your network - purely cosmetic. The one trap that actually catches people is the caching: leave the seed fixed while you fiddle with downstream wiring, and you'll swear the node is broken when it's faithfully returning the cached answer. It isn't broken. Randomize the seed.

CategoryLLM/Anthropic

Inputs (11)

NameTypeDefaultDescription
promptSTRINGThe text prompt to send to Claude.
modelCOMBOSonnet 4.6Claude model to use. Fetched from the Anthropic API at startup; falls back to a built-in list if unavailable.
seedINT7392041856130970–1125899906842624Controls caching. Fixed = reuse cached result (no API call). Randomize = new API call each run.
imagesoptIMAGEOptional images for Claude's vision. Accepts batched images. Each is converted to JPEG before sending.
templateoptCOMBONonePre-built instructions for optimizing prompts for specific AI models. Overridden when instructions input is connected.
instructionsoptSTRINGSystem-level instructions that guide Claude's behavior and response style.
temperatureoptFLOAT1.000–1Controls randomness. 0.0 = deterministic, 1.0 = most creative. Forced to 1.0 when extended thinking is enabled.
max_tokensoptINT40961–128000Maximum number of tokens in Claude's response. Higher = longer responses, more cost.
extended_thinkingoptBOOLEANfalseEnable Claude's extended thinking for complex reasoning. Forces temperature to 1.0.
thinking_budgetoptINT40961024–128000Max tokens for the thinking process. Only used when extended thinking is enabled.
max_image_sizeoptINT102464–1568Max pixel dimension for images. Images are resized to fit. API max is 1568px. Lower = fewer tokens, lower cost.

Outputs (2)

NameTypeDescription
responseSTRINGClaude's text response to the prompt.
thinkingSTRINGClaude's internal reasoning when extended thinking is enabled. Empty otherwise.