Iterator Load Video Path
Batch video-to-video without touching the path box
- VIDEO_PATH
- FILE_NAME
- INDEX
- TOTAL
Unlike its siblings in the pack, IteratorLoadVideoPath doesn't load anything. It scans a directory for video files and hands you a path - a plain string - one per run. That's deliberately dumb, and it's the point: the actual decoding happens downstream in a video loader node, so this stays cheap and your workflow decides how to open the file.
How it works
Same persistent-cursor machinery as the rest of ComfyUI-Simple-Iterator. The directory is scanned on each run, hits are sorted by order, and one entry is emitted per execution with the cursor parked in .iterator_state.json in the plugin folder, keyed by node id plus directory plus pattern. Because the output is just a string, there's no heavy decode inside the node - check the pack's requirements and you'll find numpy and Pillow, no PyAV, no ffmpeg bindings. torch comes from your ComfyUI install itself.
Supported extensions: .mp4/.mov/.mkv/.avi/.webm/.m4v/.mpg/.mpeg/.wmv/.flv - but note the default pattern is just *.mp4. Mixed footage? Set the pattern to something like *.mp4,*.mov,*.mkv.
The inputs that matter
directory- where the videos live.pattern- default*.mp4, comma/semicolon separated.order-name_asc/name_desc/mtime_asc/mtime_desc.mtime_descis the one for "newest clip first" review loops.loop_mode/reset- pack-wide:stop(default) raises when you run out,loopwraps,hold_lastrepeats the last item;resetonly rewinds on a False→True edge.load_always- force the node to re-execute every run even when ComfyUI thinks nothing changed.filename_with_ext- whetherFILE_NAMEkeeps the extension. Default True.
Outputs: VIDEO_PATH (full path string), FILE_NAME (with or without extension), INDEX (0-based), TOTAL. Wire VIDEO_PATH into the path input of your video loader - the VideoHelperSuite-style nodes that take a path and do the ffmpeg work are the natural pairing - or into a text display node to see which clip is current.
Installing it
Pack-wide install - ComfyUI Manager, search "ComfyUI-Simple-Iterator", or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/yangzhuangqiu/ComfyUI-Simple-Iterator
Restart ComfyUI after. Dependencies are just numpy and Pillow; nothing heavy downloads.
Where people get confused
The node shows no preview because there's nothing to preview - it's a path, not a video. If nothing changes on screen, check that your loader is actually consuming the string. The usual iterator traps apply too: an empty directory with stop raises "Iterator exhausted", and if you keep getting the same clip, look at load_always and whether the downstream loader is caching its output.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| directory | STRING | — | |
| pattern | STRING | *.mp4 | — |
| recursive | BOOLEAN | false | — |
| order | COMBO | name_asc | 4 options: name_asc, name_desc, mtime_asc, mtime_desc |
| loop_mode | COMBO | stop | 3 options: loop, stop, hold_last |
| reset | BOOLEAN | false | — |
| load_alwaysopt | BOOLEAN | false | — |
| enable_logopt | BOOLEAN | false | — |
| filename_with_extopt | BOOLEAN | true | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| VIDEO_PATH | STRING | — |
| FILE_NAME | STRING | — |
| INDEX | INT | — |
| TOTAL | INT | — |