Any Node π (Anthropic)
The Claude variant of the node that codes nodes
- any
- any2
- any
- control
Same mushroom, different kitchen. Any Node π (Anthropic) is the Claude-flavored version of the pack's core idea: you describe what you want a node to do, the LLM writes a Python function, a sanitizer checks it, and ComfyUI runs it - only the brain that does the writing is Claude instead of GPT.
Functionally it's a near-clone of the OpenAI AnyNode. You get the same prompt input (still defaulting to "Take the input and multiply by 5"), the same two optional wildcard inputs any and any2 that get type-inspected and described to the model, and the same two outputs: any for the result and control for the metadata dict that carries the generated function. The difference is the model field: it's a free-form string defaulting to claude-3-5-sonnet-20240620, which is actually a small advantage over the OpenAI variant's frozen dropdown - you can type a newer Claude model id and it'll just use it. The code path goes through the anthropic Python library, which reads ANTHROPIC_API_KEY from your environment, then into the same AST sanitizer and executor as every other AnyNode. Same security model, same "no internet, no files, no command line" rules, same "hit Queue Prompt again to auto-correct" error mitigation.
Install is nothing new: this ships in the same lks-ai/anynode pack, so if you already have AnyNode installed you already have this one - search AnyNode in ComfyUI Manager or git clone https://github.com/lks-ai/anynode into custom_nodes, restart, and set ANTHROPIC_API_KEY. The only extra dependency is anthropic, which is already in the pack's requirements.txt.
The honest caveat: this is the least-documented of the four variants, and it shows. The README covers OpenAI, Gemini, and local LLMs in detail and never once mentions Anthropic - the class is wired into the code but it reads like it was added late and forgotten. That plus the hard 2024-era default model means you should treat it as "Claude, if you already pay for it." Which, to be fair, is a real use case: Claude is a strong coder, and if your ComfyUI box already has the key set for other things, this costs you nothing extra. But if you're choosing which mushroom to install and you don't already have an Anthropic subscription, the OpenAI or local variants are the better on-ramps.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Take the input and multiply by 5 | β |
| model | STRING | claude-3-5-sonnet-20240620 | β |
| anyopt | * | β | |
| any2opt | * | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| any | * | β |
| control | CTRL | β |