Script Pile
Stack a whole batch into a scripted node
- pipe_in
- pipe_out
- script_rule_data
Script Pile is the batch-feeding cousin of ScriptNode in the 0246 pack. ScriptNode wraps one node and runs it once; Script Pile wraps the routing so a scripted node can chew through a stack of inputs - a pile of pins, run over a pile of data. The pack's own one-liner calls it the "generic stacker execution mechanism for Script node."
The idea: you've got a Highway or Junction pipe full of several inputs, and one target node (say, a sampler) that should run over them. Script Pile maps the target's output names onto the input pins using a regex, then drives the Script node to execute the target once per stack item - zipping or cycling the inputs as you choose. Where ScriptRule controls iteration shape, Script Pile controls where the inputs come from and how they get fed.
The inputs that matter
pipe_in- the Highway or Junction pipe carrying your data.script_rule_pin_mode- how the pipe unpacks into pins. The four choices are the honest names:pin_highway_batch(named Highway lanes, batch-style),pin_highway_junction,pin_junction_highway, andpin_junction(sequential). In the source, each maps to a different unpacking strategy, with the comments showing exactly what data shape you get per choice.script_rule_loop_mode-_(single pass),slice(zip), orcycle(cartesian product) - same semantics asScriptRule.script_rule_regex- the mapping regex, default(?P<m>^(@model|%MODEL)$)|(?P<c>^(@clip|%CLIP)$)|(?P<_>^$). It matches input pins (@name) to target outputs (%NAME):@modelpairs with%MODEL,@clipwith%CLIP. If your target's pins don't match the defaults, rewrite this regex.count- cap on iterations (default 0 = no cap).
The outputs
pipe_out- passes the pipe through untouched.script_rule_data- theSCRIPT_DATApacket that drives theScriptnode.
How to install it
The usual:
cd ComfyUI/custom_nodes
git clone https://github.com/Trung0246/ComfyUI-0246
restart, or ComfyUI Manager → search "ComfyUI-0246". No models.
Common issues & troubleshooting
"Missing corresponding output for input ..." - your regex matched an input pin but found no matching target output. Check that @name / %NAME pairs line up; this is the #1 Script Pile failure, and it's a regex problem, not a ComfyUI one.
Nothing runs / runs once. script_rule_loop_mode is _ or count is set to 1. Set the loop mode to slice or cycle for iteration.
Unexpected combinations. cycle produces the cartesian product - with three pins of three values each, that's 27 runs. If that's not what you wanted, slice (zip) is the tamer option. And the standing pack caveat: this whole scripting system is single-author, dormient since early 2025, and depends on internals - validate against your ComfyUI version before leaning on it.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| pipe_in | * | — | |
| script_rule_loop_mode | COMBO | 3 options: _, slice, cycle | |
| script_rule_regex | STRING | (?P<m>^(@model|%MODEL)$)|(?P<c>^(@clip|%CLIP)$)|(?P<_>^$) | — |
| script_rule_pin_mode | COMBO | 4 options: pin_highway_batch, pin_highway_junction, pin_junction_highway, pin_junction | |
| count | INT | 00–9223372036854776000 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| pipe_out | * | — |
| script_rule_data | SCRIPT_DATA | — |