[Movie Tools] Load images from subdirs
Load a whole folder of frames as one batch tensor
- IMAGE
If you've ever tried to img2img an entire folder of frames, you know the pain: ComfyUI's LoadImage handles one image at a time, and wiring up 200 of them isn't a workflow, it's a hostage situation. LoadImagesFromSubdirsBatch, from the ComfyUI-Movie-Tools pack, is the "grab this whole directory and hand it to me as one IMAGE batch" node. You point it at a folder, it walks the whole tree, and a single IMAGE tensor comes out with every frame stacked on the batch dimension - ready to plug into a KSampler, an upscaling pass, or anything else that eats a batch.
It's the read-back half of a frame-sequence loop: generate a run of frames with the pack's save node, load them all back later for a second pass. Three inputs, and they're all simple:
- directory - the folder to scan. Give it an absolute path, and this one matters: unlike the pack's video node, this node does not resolve relative paths against
output/, so a bare folder name gets looked up relative to the ComfyUI process's working directory and you'll get "Directory cannot be found." - image_load_cap - cap how many images you pull in (0 = no limit).
- start_index - skip the first N images.
How it works, from the code: it walks the directory recursively, keeps .jpg/.jpeg/.png/.webp, sorts the paths, applies the offset and cap, then decodes on a small thread pool. Image decoding releases the GIL, so parallel reads genuinely speed up big folders. Every frame is EXIF-transposed and converted to a float tensor in 0–1, and then the first gotcha shows up: if frames have different resolutions, the later ones get silently resized to match the first frame's size (bilinear). No warning, no crop dialog. Feed it a consistent-resolution folder or sort your inputs.
Gotcha number two is the classic frame-sequence trap: it sorts lexicographically, so frame_10.png sorts before frame_2.png. Zero-pad your filenames (frame_0001.png) or your "sequence" comes back in an order you didn't intend. Not this pack's invention - just how string sorting works.
And the one that actually bites: the whole batch lives in memory. The node returns one tensor holding every frame, and the code itself logs a warning past roughly 300 images, because that's a real slab of RAM and VRAM. For sequences that big, the pack's sibling node LoadImagesAndCreateVideo streams frames straight into an mp4 without ever materializing the batch - the README and the code both steer you there, and it's the right call for hundreds+ of frames. This node is for the sizes where a batch tensor is comfortable. It's also a plain (non-output) node, so it only runs when something downstream actually asks for the batch.
The output is a single IMAGE tensor (N,H,W,C, float 0–1), which is what makes it drop so cleanly into batch-aware nodes downstream.
Install - same story as the rest of this pack, no models, no extra deps:
cd ComfyUI/custom_nodes
git clone https://github.com/Big-Idea-Technology/ComfyUI-Movie-Tools
restart, or use Manager and search "Movie Tools". It needs nothing beyond what ComfyUI already ships. It's a small one-author WIP pack with essentially no community footprint, so treat it as reliable-but-quiet tooling - and if you're loading hundreds of frames, remember the video node is sitting right there in the same pack.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| directory | STRING | — | |
| image_load_capopt | INT | 0 | — |
| start_indexopt | INT | 0 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |