Batch Load Image Sequence With Stop Index
Load numbered frames between two indices
- IMAGE
When you export a video to frames you usually get files like frame000001.png, frame000002.png, and so on - a zero-padded numbered sequence. This node loads a range of those in one go. You give it a filename pattern with a number placeholder, a start index and a stop index, and it loads every frame in that window into a batch.
It's the front door for frame-by-frame video work in ComfyUI: load a stretch of an exported clip, run it through whatever you're doing, and move on. The "with stop index" bit is the point - it loads a bounded range rather than everything, so you can process a long sequence in chunks that actually fit in memory instead of trying to load ten thousand frames at once.
How it works
The pattern uses Python-style formatting: ./frame{:06d}.png means "frame, then a six-digit zero-padded number, then .png." The node walks from the start index to the stop index, substitutes each number into the pattern, loads that file, and stacks the results into one batch.
Inputs and outputs
- path_pattern - the filename template, e.g.
./frame{:06d}.png. The{:06d}is the number slot; the06means six digits with leading zeros. Match this to how your files are actually named. - start_index - the first frame number to load.
- stop_index - where to stop (default 16).
- inclusive -
false(default) excludes the stop index,trueincludes it. Same convention as slicing a list. - ignore_missing_images -
trueskips gaps in the numbering instead of erroring on a missing file.
Output is a single IMAGE batch.
Installing it
It lives in the pack's comfyui_image_sequence file. Install via ComfyUI Manager (search Various ComfyUI Nodes by Type / comfyui-various) or clone:
cd ComfyUI/custom_nodes
git clone https://github.com/jamesWalker55/comfyui-various
Restart ComfyUI. No models, no extra dependencies.
Common issues
The pattern is where everything goes wrong, and it goes wrong in exactly one way: the padding has to match your files. If your frames are named frame000001.png (six digits) but your pattern says {:04d} (four digits), it'll look for frame0001.png, not find it, and fail. Count the zeros in your actual filenames and set the {:0Nd} to match. If your files aren't zero-padded at all, use {:d}.
Same batch rule as every other loader here: all the frames must be the same size. Mixed dimensions can't stack into one batch. Exported video frames are usually uniform, so this rarely bites, but a hand-assembled folder might.
Also mind the inclusive flag if your frame count comes out one off - default is exclusive, so start 0 / stop 16 gives you sixteen frames (0–15). And turn on ignore_missing_images if your sequence has holes you'd rather skip than crash on.
On a hosted runner the local filesystem is ephemeral, so paths from your own machine won't be there - this node is happiest on a local ComfyUI where you control the folder. If it appears red as a missing node in a shared workflow, install the pack via Manager's "Install Missing Custom Nodes" or clone the repo.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| path_pattern | STRING | ./frame{:06d}.png | — |
| start_index | INT | 00–999999 | — |
| stop_index | INT | 161–999999 | — |
| inclusive | COMBO | false | 2 options: false, true |
| ignore_missing_images | COMBO | false | 2 options: false, true |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |