AgenticflowAIVariable
The node that turns an unresolved '{variable}' into a usable number — with a safety net
- STRING
- INT
- FLOAT
AgenticflowAIVariable is the most interesting node in the PixelML pack, and also the one you're least likely to use by hand. It's built for the specific moment when an agentic workflow hands your graph a variable that may or may not have been resolved - and you need the graph to survive either way.
Here's the situation it solves. In agent-driven ComfyUI setups, a value often arrives as a template placeholder. Instead of 7.5, you get {seed} - a variable name wrapped in curly braces, waiting for some orchestrator to fill it in. If that fill-in fails or the variable comes through empty, a normal node would crash or pass garbage downstream. This node's whole job is to catch that: when the variable input is empty or still wrapped in braces (an unresolved placeholder), it swaps in the fallback value instead, then tries to hand you the result in as many types as it can.
That {variable} templating pattern is exactly what the node's category - agenticflowai/variables - points at. AgenticFlow AI runs ComfyUI as part of an automation platform, and this node is the plumbing that makes graph variables resilient to an LLM that didn't resolve one of its own placeholders. The community's interest in this kind of agentic ComfyUI layer is real, even if this specific node is tiny and little-discussed.
How it works
The logic, from the source, is short and worth walking through:
- Strip whitespace from both
variableandfallback. - If
variableis empty, or starts with{and ends with}, replace it withfallback. - Convert the result three ways and return all three: the string form,
int()if it parses, andfloat()if it parses.
The neat bit is the last step. It attempts int() and float() independently, and each conversion fails quietly on its own - so a value like "3.5" yields string="3.5", int=0, float=3.5. A value like "7" yields string="7", int=7, float=7.0. And a non-numeric string like "low_detail" yields the string plus 0 and 0.0. You grab whichever output matches the type the downstream node wants.
The inputs
Only two, and only one you'll ever set:
- variable - an enum with a single empty choice. In a by-hand workflow this stays empty, which means the fallback is always used. It's populated at runtime by the agentic platform that feeds this node.
- fallback (STRING, default
"") - the safety-net value, used whenevervariableis empty or an unresolved{placeholder}. This is the field you set.
The outputs
Three, all derived from the same resolved value:
- STRING - the raw string form, always populated.
- INT - the integer conversion, or
0if it can't parse. - FLOAT - the float conversion, or
0.0if it can't parse.
Wire the one matching the downstream input type. The triple-output trick is the real feature: one node can feed a prompt string, a seed integer, and a CFG float without three separate conversion nodes.
Install
It's part of the PixelML ComfyUI Nodes pack - search "PixelML ComfyUI Nodes" in ComfyUI Manager, install, restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/PixelML/ComfyUI-PixelML-CustomNodes
Restart after either route. The usual pack caveat applies: requirements.txt pins an old diffusers==0.24.0 and lists dependencies (boto3, httpx, httpx-sse) the shipped nodes never import. This node only uses numpy and torch, both bundled with ComfyUI. If the requirements file drags your diffusers down and breaks other nodes, skip it.
Honest framing: you will not need this node in a hand-built workflow - set variable to empty and it's just a fallback constant with extra outputs. Its value is entirely in agentic pipelines where an orchestrator resolves variables at runtime. If that's your setup, this is the safety net that keeps an unresolved {seed} from killing the run.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| variable | COMBO | 1 options: | |
| fallback | STRING | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |
| INT | INT | — |
| FLOAT | FLOAT | — |