WI Workflow Iterator
Queue an entire parameter experiment from one node, then go make coffee
- param_stack
- current_index
- total_count
- batch_name
- iteration_meta
WI Workflow Iterator is the control node at the center of the Workflow Iterator pack, and it exists because of a pain every ComfyUI regular knows: finding the right settings means manually changing a widget, hitting queue, squinting at the result, changing it again. There's a real community itch here - people still pine for A1111's old x/y plot and hand-roll sampler comparisons (thread 1twjl1k, +96). This node automates the whole loop. You tell it what to vary, it queues every combination for you, and you walk away.
The name underplays what actually happens. ComfyUI runs one prompt per queue entry, so a node can't "iterate" in the normal sense. Instead, the pack registers an on_prompt handler that intercepts your submission the moment you hit Queue. It finds this node, reads the chain of WI Parameter nodes connected to its param_stack input, parses all their values, generates the full set of combinations, then rewrites your prompt JSON for combination #1 and queues N-1 clones for the rest. Each queued copy gets the right values injected into the target node's widgets and a wi_iteration payload slipped into extra_pnginfo so the rest of the pack knows what it's looking at.
You set three things:
mode-matrixgives you the Cartesian product of every parameter (3 params × 10 values = 1,000 renders, so do the math before you queue).linearzips parameters index-by-index and cycles short lists, so the batch length always equals your longest list. Linear is the one to reach for when you want curated comparisons, not the entire space.batch_name- a prefix for filenames and the batch ID. Make it descriptive; you'll be looking at files likesampler_test_013.pngafterwards.enabled- flip it off and the workflow runs exactly once, no iteration. Handy for sanity-checking before you commit to a 40-render batch.
The param_stack input is how the iterator sees your parameters; the five parameter nodes chain into it. Outputs are current_index (0-based position in the batch), total_count, batch_name (pass-through), and iteration_meta - a dict that carries the batch name, ID, index, and which parameter values were actually applied. That last output is what you feed into WI Save Image and WI Grid Compositor.
Install
Through ComfyUI Manager, search "Workflow Iterator" and hit Install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/jason-n-tran/comfyui-workflow-iterator
The only Python dependency is Pillow>=9.0.0, which virtually every ComfyUI install already has - no model downloads, no torch surprises. Restart ComfyUI and the nodes appear under the Workflow Iterator category. It's a young, small project (v1.0.0, MIT, by Jason Tran, listed on the ComfyUI registry), so you're not getting years of battle-testing - you're getting a focused tool that is, notably, properly unit-tested.
Gotchas
- Watch your combination count. Matrix mode is exponential and the README's own example admits it: 3 params × 10 values = 1,000 renders. Queue that once by accident and you'll be cancelling a batch via the pack's HTTP API (
POST /wi/cancel_batch/{batch_id}, withGET /wi/active_batchesto list them). - If no parameters are enabled or the chain is broken, the node logs "running workflow once" and proceeds without iterating - silent, but harmless.
- The progress bar drawn on the node comes from the pack's JS extension polling the batch status endpoint, so it only appears while a batch is actually active.
Where people get burned: expecting the iterator to control nodes it can't see. Parameter matching is done by canvas title, and the title you type must actually match the target node's - that part is configured on the parameter nodes, but the failure shows up here as "could not find node with title" warnings and a batch that runs with values never applied. Worth a single test render before you queue the whole grid.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | 2 options: matrix, linear | |
| batch_name | STRING | batch_001 | — |
| enabled | BOOLEAN | true | — |
| param_stackopt | WI_PARAM_STACK | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| current_index | INT | — |
| total_count | INT | — |
| batch_name | STRING | — |
| iteration_meta | WI_ITERATION_META | — |