⛧Load Image Folders
Load every numbered section as a dict of image batches — the read half of the loop
- dict_prefill
- DICT
Here's the node that ties this pack's loop pattern together on the read side. Save Latent And Images writes each section of a Wan video into a numbered folder; Load Image Folders reads those folders back and hands them to you as a dictionary - key 01 pointing at that section's image batch, key 02 at the next, and so on. One node, the whole project's frames, in a shape other nodes can iterate.
That dict output is the whole point. A DICT wire lets downstream nodes walk sections by key, pick one out, or hand the whole thing to Stitch Images Multi to reassemble into a single clip. Without it, you'd be wiring a dozen separate loaders and hoping their order matched your folder order.
Inputs
- base_path - the root directory holding your numbered folders.
- subfolder - a path inside each numbered folder to look in, e.g.
images. So for folder03it reads<base>/03/<subfolder>/. - folders_str - a newline-separated string of the folder names to process. This is where Get Subfolders plugs in: its output is literally this format.
- load_from_end - optional. When
0(default), every listed folder is loaded. Set it toNand only the last N sections get their images loaded; the earlier ones still appear in the dict, but asNone. The author's tooltip calls these "the last sections that will be loaded" - a convenient "only give me the newest takes" knob. - dict_prefill - optional
DICTto append to. Existing keys are skipped, so you can accumulate across multiple calls without clobbering.
Output is a single DICT, keyed by the two-digit folder prefix (the first two characters of each folder name), each value an IMAGE batch - or None for a skipped section.
How it works
Parsing is pragmatic: it splits folders_str on newlines, keeps any name whose first two characters are digits (skipping 00), and uses the first two digits as the dict key. For each folder it delegates to Load Images Conditional under the hood, so you inherit that node's behavior: files sorted by name, corrupt files skipped, every valid image stacked into one batch. If load_from_end is active, the skipped folders are still registered in the dict with None values - which matters, because a downstream node can tell "this section exists but wasn't loaded" apart from "this section is missing."
Install
Part of ComfyUI-HeresyNodes, heresyCoder's personal support pack:
cd ComfyUI/custom_nodes
git clone https://github.com/heresyCoder/ComfyUI-HeresyNodes
Restart ComfyUI, or install via Manager ("ComfyUI-HeresyNodes"). No models, no extra pip dependencies.
The honest take
This node only earns its keep inside the numbered-folder pattern - if you're not organizing renders as 01, 02, 03 sections, it's solving a problem you don't have. But if you are, it collapses what would otherwise be a wall of individual loaders into one node with a stable contract. The load_from_end + None design is the smart bit: it lets you resume a long render and only reload the newest sections, while still handing downstream code a complete dict where absence and "skipped on purpose" are distinguishable. Pair it with Save Dict Latent And Images for the write side, and you've got a read/write loop that survives restarts cleanly.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| base_path | STRING | — | |
| subfolder | STRING | — | |
| folders_str | STRING | — | |
| load_from_endopt | INT | 0 | Number of last sections that will be loaded |
| dict_prefillopt | DICT | Existing dictionary of images to append to. Existing keys are skipped. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| DICT | DICT | — |