Any API Node
An 'API Node' That Doesn't Call Any API
- output
The fastest way to misunderstand this node is its name. "API Node" sounds like it phones a cloud service with your prompt and a credit card. It doesn't. The only API in the picture is ComfyUI's own - this node exists so a script can change a value in your workflow without you ever opening the editor. No key, no network call, no credits, no waiting.
The naming doesn't help: ComfyUI's official "API Nodes" are the opposite thing. Those are the paid Partner Nodes that call closed models like Nano Banana and Veo on prepaid credits. If you googled "comfyui api nodes" and landed here hoping to generate with Sora, stop - wrong node. This pack is the boring, useful direction: it takes inputs out of your workflow so an external caller can supply them.
What it's actually for
The setup goes like this. Build a workflow, drop a few of these where you'd normally have a prompt box or a number, export the workflow in API format, and now any program can submit it with different values on each run. You've turned your graph into a function with named arguments.
Under the hood it's almost embarrassingly simple. The node's function is a single return statement - it hands back default_value unchanged. The name input does nothing at runtime; it's a label, a parameter key your script matches on. The companion JS library (@hypnodes/comfyui-api-nodes) scans the workflow JSON, finds every node whose class is Any API Node, reads inputs.name, rewrites inputs.default_value, and posts the whole thing to ComfyUI's /api/prompt endpoint. That's the entire trick.
Inputs and outputs
name(STRING, default"name") - the parameter key. Rename it to something meaningful likepromptorfilename. The script finds the node by this.default_value(STRING, multiline, default"default value") - the text the node actually outputs, and the fallback when no override comes in.output- a single*(ANY) socket.
The "any" is about the output, not the input. default_value is a text box, but the output uses the wildcard ANY type, so it'll connect to just about any socket - the pack pulls the classic trick of an output that compares equal to any type. What it actually carries is the text you typed, so wire it somewhere expecting text, or be ready for a type complaint downstream.
Install
Same as any pack, and it's a light one. In ComfyUI Manager, search ComfyUI_ApiNodes (the registry lists it as "Api Nodes" by hypnodes), or:
cd ComfyUI/custom_nodes
git clone https://github.com/hypnodes/ComfyUI_ApiNodes
Restart ComfyUI and it's live. That's the whole install - four small files, zero Python dependencies, no models to download. As close to a safe custom node as this ecosystem offers.
Where people get burned
- The name is not the value. If your script sets a parameter and nothing changes, the usual culprit is a mismatch between the script's key and the node's
namefield. Spelling and case count. - Keep names unique. The library matches by name, so two nodes both named
promptget overwritten with the same value. - It won't magically convert types. The ANY output connects anywhere, but the value is still a string. Feed a number where a socket wants FLOAT and it'll complain.
Reach for the Any node when you're prototyping and the socket type might change. For anything real, use its typed siblings - String, Integer, Float API Nodes - so you and your script both know what you're getting. Any is the escape hatch, not the default.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| name | STRING | name | — |
| default_value | STRING | default value | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| output | * | — |