Any Node π
The mushroom node that writes its own function
- any
- any2
- any
- control
"Tell it what you want, it makes you the node." That's the whole pitch, and the flagship Any Node π is the version that started it. It's a single node that takes a plain-English prompt, sends it to OpenAI, and gets back a working Python function that runs live inside your ComfyUI graph. No local model, no Ollama - just an API key and a sentence like "make an Instagram-like sepia filter" and you have a node that filters like Instagram.
This one is the classic OpenAI build, so there's no local LLM setup to fuss with. Under the hood it builds a system prompt describing ComfyUI's conventions and the exact type, shape, and structure of whatever you wire into its two optional wildcard inputs (any and any2), sends that to a model you pick, and the model replies with code. A sanitizer parses the code before it runs and blocks dangerous stuff - eval, exec, subprocess, file writes, shell access - then the function executes in-process and the result comes out the any output. The README's own demos are worth looking at: red channel extraction, random HSV tweaks, a Sobel edge detector, all prompted into existence. For one-off image transforms it's genuinely the fastest way to a custom node that exists.
The inputs are minimal. prompt is the whole game, defaulting to "Take the input and multiply by 5." The model dropdown is the one to watch, because it's frozen in 2024: gpt-4o, gpt-4-turbo, gpt-4, gpt-3.5-turbo, gpt-3.5. The pack shipped in May 2024 and the last commit was June 2024, so that list never grew - no gpt-4o-mini, no o-series. The API still works, and gpt-4o still writes decent image-processing functions, but you're locked to the classics. Outputs are any (the result, wire it anywhere) plus control, a metadata dict with the generated function that feeds the pack's export tooling.
Install is boring in the good way: search AnyNode in ComfyUI Manager, or cd ComfyUI/custom_nodes && git clone https://github.com/lks-ai/anynode, restart, then add the key. The one setup step beyond that is pip install openai and putting OPENAI_API_KEY in your environment variables. The pack's requirements.txt drags in a long list - torch, opencv, chromadb, anthropic, google-generativeai - but most of it's already present in a stock ComfyUI install.
Now the part worth taking seriously. This community had a real malware incident - a custom node pack that ran code on import and compromised machines, including at Disney - so the idea of executing AI-generated code should give you a pause, and it did the author too. The sanitizer is genuinely trying: it blocks dangerous calls, restricts open() to a whitelist of safe uses, catches while True infinite loops, and the function runtime only sees a curated list of imports. But it's a weekend-project sanitizer from 2024, not a sandbox. Two practical habits: read the generated code in the console before you trust a node you'll reuse, and treat this as a prototyping tool, not the backbone of a production pipeline. It's also the same node the community argued about in the "Anything Anywhere" debates - a wildcard that accepts and emits any type is convenient until you can't debug a workflow anymore, because nothing tells you what's actually flowing through it.
Where people get tripped up: the node can't touch the filesystem or the internet by design, so "load this image from disk" prompts fail - use a loader node and feed the result in. It can crash ComfyUI if you wire a giant tensor into any and the generated code does something expensive with it. And errors aren't errors: when the generated function fails, just hit Queue Prompt again and the node feeds the traceback back to the model to auto-correct. Fun, fast, a little dangerous, and abandoned-but-still-working - exactly what you'd expect from a viral weekend project.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Take the input and multiply by 5 | β |
| model | COMBO | gpt-4o | 5 options: gpt-4o, gpt-4-turbo, gpt-4, gpt-3.5-turbo, gpt-3.5 |
| anyopt | * | β | |
| any2opt | * | β |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| any | * | β |
| control | CTRL | β |