Load Image Sequence
A numbered folder of frames, loaded as one batch
- images
- count
- filenames
- image_list
- filename_list
Video work in ComfyUI usually starts with a folder full of numbered frames, and Load Image Sequence is the node that turns that folder into one batch. It reads in filename order, applies a range and a sampling strategy, resizes every frame to a common size, and hands you the whole run on a single IMAGE socket - the difference between this and Load Image Batch being that the batch version serves one frame per run, while this serves the run of frames a video pipeline wants. It defaults to 16 frames because a folder can hold thousands and a batch is one tensor in memory.
The sampling controls
strategy- hownum_framesare chosen from the range:uniform(evenly spaced),head,center,tail,random(seeded), orevery_nth.nth- a thinning step applied before the strategy picks, soheadwith nth 2 takes the opening on alternate frames.num_frames- how many to keep. 0 takes every frame in range, up to the 4096 ceiling.seed- matters only forrandom, so a re-run grabs the same frames.
Here's the part that separates it from a dumb folder loader: only the chosen files are opened. Sample a 5,000-frame capture down to 16 uniform frames and the node reads sixteen files, not five thousand. The description makes the point deliberately - "sampling a long capture costs the frames you keep rather than all of them."
Size and the round-trip outputs
Frames of mixed sizes still have to stack, so resize_mode decides how each meets width/height: fit and pad (keeps the whole frame, pads the rest), fill and crop (fills and trims the overhang), stretch (distorts), crop or pad (never resamples). Leave width and height at 0 and the size comes from the first frame kept - with max_size capping the long edge so a folder of huge frames doesn't blow up memory.
The real gem is the paired outputs. images and count are the batch and its length; filenames lists every loaded name. But image_list and filename_list hand you the same frames one at a time - image_list runs a downstream node once per frame, and filename_list pairs with Image Save's filename_prefix (extension dropped) so every frame is written back under its own name. That's the folder round-trip the README advertises: load a sequence, process it, save each frame with the name it came in with.
Installing it
Part of WAS Node Suite:
cd ComfyUI/custom_nodes
git clone https://github.com/WASasquatch/was-node-suite-comfyui.git
or ComfyUI Manager → "WAS Node Suite v3", then restart. Requires ComfyUI 0.14.0+ and Python 3.10+; v3 installs no pip packages.
Where people trip
The memory surprise is the classic: wire a folder of 2,000 frames straight in at num_frames 0 and you've asked for one giant tensor - that's why the default is 16 and why max_size exists. Second, pattern matches inside the folder only, and filename order is lexical, so frame_10.png sorts before frame_2.png - pad your numbering (frame_02) or use start/end ranges rather than fighting the sort. And remember random is seeded per seed, not per run: leave the seed alone and "random" is deterministic, which is usually what you want for reproducible workflows.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | COMBO | Which folder to read. A bare 'input', 'output' or 'temp' is that folder itself; 'plates/shot_01 [input]' is that folder below it. Any folder added under paths.allow_read in config.yaml is listed under its own name, and so are the folders inside it. | |
| pattern | STRING | * | Which files to take, as a glob. `*` takes every image in the folder, `frame_*.png` takes one numbered run out of a folder holding several. Matching is inside the folder only. |
| num_frames | INT | 160–4096 | How many frames to keep, chosen by the strategy below. 16 by default, because a folder can hold thousands and a batch is one tensor in memory. 0 takes every frame in the range, up to the 4096 ceiling. |
| strategy | COMBO | uniform | How num_frames are chosen. uniform = evenly spaced; head = first; center = middle; tail = last; random = a seeded pick; every_nth = every nth. Only the chosen files are opened, so sampling a long capture costs the frames you keep rather than all of them. |
| nth | INT | 11–4096 | Step between the frames the strategy may choose from. 1 uses every frame; 2 thins to every other one first, so `head` takes the opening of the clip on alternate frames. It applies to every strategy. |
| seed | INT | 00–18446744073709550000 | Seed for random, so a re-run keeps the same frames. Ignored by the other strategies. Any whole number; `0` is as good a seed as any. |
| resize_mode | COMBO | fit and pad | How each frame meets the size below, so a folder of mixed sizes still stacks. `fit and pad` keeps the whole frame and pads the rest, `fill and crop` fills the size and trims the overhang, `stretch` distorts to fit, `crop or pad` never resamples. |
| width | INT | 00–16384 | Width every frame is brought to. 0 takes the width of the first frame kept, which is what loads a sequence at its own size. |
| height | INT | 00–16384 | Height every frame is brought to. 0 takes the height of the first frame kept. |
| startopt | INT | 0-4096–4096 | First file to consider, counting from 0 through the matching files in filename order. Negative counts back from the end. |
| endopt | INT | -1-4096–4096 | Last file to consider, inclusive. -1 is the final file, which is the whole sequence together with a start of 0. |
| max_sizeopt | INT | 10240–16384 | Longest edge the derived size is held to, keeping the aspect. Only read when width and height are 0, which is where a folder of large frames would otherwise fill memory. 0 lifts the cap. |
| interpolationopt | COMBO | lanczos | Resampling filter. `lanczos` is the sharpest for a downscale. |
| alignopt | COMBO | middle center | Which part of a frame survives a crop, and which side carries the wider bar of a pad. |
| pad_coloropt | STRING | #000000 | Fill for space a frame does not cover. Any Pillow colour. |
| channelsopt | COMBO | RGB | Channels the batch carries. `RGBA` keeps the pad transparent. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | The sequence as one batch, in filename order. |
| count | INT | How many frames the batch holds once the range and the strategy have been applied. |
| filenames | STRING | The filename of each loaded frame, in order, one per line. |
| image_list | IMAGE | The same frames as one image each rather than one batch, so a node wired here runs once per frame. Pair it with filename_list to put every frame through Image Save under its own name. |
| filename_list | STRING | One name per frame, in the same order as image_list, with the extension dropped so it can be wired straight into Image Save's filename_prefix. Image Save adds the extension it writes. |