π For Each Done
The loop's finalizer β without it, your batch loop never advances
- image
- foreach
For Each Done [DVB] is the half of the pack's file-iteration loop that everyone forgets, and the loop doesn't work without it. Its partner, For Each Filename [DVB], hands you the next file in a folder every time you queue a run. This node is the bookkeeping that says "that file is processed, move on" - you feed it your finished image and the foreach handle from the start node, and it marks the current file as done in the loop's state file. No outputs, because its whole job is a side effect.
Why it has to be late in the graph
The node is designed to sit very late in the workflow - after all the heavy generation and processing, right before the graph ends. That's not an accident: it's an output node whose purpose is to record completion after the work is actually done. If you put it early, or wire it to something that isn't the fully-processed image, you're telling the loop "done!" before the work happened, and the queue advances while you still had frames left to process. The README says it plainly: add it very late, and only after the real processing.
Mechanically, each queue run does this: For Each Filename pops the next path from the state file and hands it out; your workflow processes that file; For Each Done pops the same entry again and marks it finished. Next queue run, the start node hands out the following file. Miss the Done node and the state never advances - you'll re-process the same file forever and wonder why the batch never moves.
The inputs, such as they are
Two required inputs, both boring:
- image - the processed result of your per-file workflow. It exists to force ordering: the node only fires after your image pipeline has produced output.
- foreach - the state handle straight out of For Each Filename. Wire the start node's
foreachoutput here.
That's it. is_output_node is true, so it shows up as a terminal in the graph.
The gotchas
Three, in order of how often they bite. First: forgetting the node entirely - the loop re-runs the same file. Second: reusing the same id on For Each Filename across two different loops, which shares one queue and scrambles which folder is being processed. Third: interrupting a long batch - the state file lives on disk next to the scanned folder, so a crash or a restart mid-loop actually resumes from where you left off, which is a feature until you forget it's there and a fresh run starts mid-batch. If you want a clean restart, delete the foreach_<id>.json file before queuing.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-video-batches.git
cd comfyui-dream-video-batches
pip install -r requirements.txt
Restart ComfyUI, or search "Dream Video Batches" in ComfyUI Manager. No model downloads. And yes - the output of the loop, like everything in this pack, is only useful once you pass it through Unwrap Frame Set [DVB] on the way to a real save node; that's the recurring rule of this pack, and it applies to the batch loop just as much as to the fades.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | β | |
| foreach | FOREACH | β |
Outputs (0)
No outputs