Iterator Signal
The node that makes a ComfyUI graph actually loop
- image
- SIGNAL
- IMAGE
ComfyUI has no native for-loop. You can't draw a wire from the end of a workflow back into its start - the graph has to stay a directed acyclic graph, and any attempt to feed a result backwards either errors out or re-runs everything in an uncontrolled way. So packs like this one fake a loop: keep the index outside the graph, advance it one step per generation, and re-queue yourself. Iterator Signal is the node that does that re-queuing. It's the heart of the whole "Stateful Iterator System" in ComfyUI-Automation, and without it the other iterator nodes are inert props.
How it works
You wire your final generated image into the image input and give it the same iterator_id string your Iterator List uses. That string is the key into a global state dictionary the pack keeps in memory. When the signal runs and sees a valid image (and active is on), it increments the index stored under that id.
Then the clever part: it grabs the workflow currently executing, finds every node flagged as an output node, and pushes the whole thing back onto ComfyUI's own prompt queue under a fresh prompt id. ComfyUI executes the graph again, your Iterator List now reads the bumped index, and you're one item further along. It returns NaN from IS_CHANGED, which forces ComfyUI to re-run the node on every pass - that's deliberate, not a bug, and it's what keeps the loop stepping.
The inputs and outputs that matter
image- the output of your generation chain (KSampler, VAE decode, whatever). If it's a valid image, the loop advances.iterator_id- must match the List's id. The classic failure point, more on that below.active- toggle to freeze the loop while still passing the image through.is_finished(optional) - wire the List'sIS_FINISHEDoutput here so the loop stops cleanly once you've run the last item. Leave it disconnected and the loop keeps re-queuing forever.- Outputs:
SIGNAL(a boolean that's true when it saw a real image) andIMAGE- the exact image you fed in, passed straight through. That passthrough exists so you can hang a Save Image or Preview node after the signal; the signal itself is marked as an output node, so without it ComfyUI might not render your final image at all.
Installing it
Install the pack once and all five nodes appear:
cd ComfyUI/custom_nodes
git clone https://github.com/franciscotorrado/ComfyUI-Automation
pip install -r requirements.txt
then restart ComfyUI. Or use ComfyUI Manager and search for "ComfyUI-Automation". One heads-up: the README's own install block contains a placeholder URL (github.com/your-repo/...) that was never fixed - use the real repo link above. The only dependency is ffmpeg-python, and there are no models to download.
Common issues
The two things that trip people up are both in the node's nature. First, mismatched iterator_id: the Signal advances state under whatever id you typed, and the List reads under its own. If they don't match, nothing ever advances and you'll wonder why item one renders five times. Type both in one sitting, or copy-paste.
Second, the loop needs Auto Queue. The re-queue trick only works if ComfyUI is set to automatically run the next queued prompt. Run it in single-queue mode and you get exactly one iteration, which looks like a broken loop. Turn on Auto Queue, hit run once, and watch it eat through your list.
And if your List is returning IS_FINISHED but the loop won't stop, check that you actually wired that output into the Signal's is_finished input - the pack won't stop itself, because stopping is your job.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| iterator_id | STRING | default_iterator | — |
| active | BOOLEAN | true | — |
| is_finishedopt | BOOLEAN | false | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| SIGNAL | BOOLEAN | — |
| IMAGE | IMAGE | — |