Load Image Dataset from Output Folder (Sorted)
Feed your own output back in, in order — the loopback loader
- IMAGE
Load Image Dataset from Output Folder (Sorted) is the sibling of the input-folder loader, with one deliberate twist: it reads from your ComfyUI output directory instead of input. That single change makes it the loopback node - the thing you reach for when you want a workflow to save frames, then pick those exact frames back up in order and do something to them again.
The obvious use is iteration. Generate a batch, save it, load it back sorted for a second pass - img2img refinement, upscaling-then-inspect, or a per-frame detail pass. It's also handy for anything that produces a frame sequence and needs it re-imported with its order intact, which is the exact failure mode a dumb string sort causes (frame_10 before frame_2). The node's folder dropdown is special here: it walks your output directory recursively and lists every subfolder, plus "." which means the root output folder itself. So if your save node writes to output/my_runs/run_7/, that shows up in the dropdown and you can reload it without navigating anywhere.
Under the hood it's the same machinery as the input version - extension filter, natural-key sort (digits treated as numbers, so img2.png sorts before img10.png), load_and_process_images from comfy_extras, then one stacked IMAGE tensor out. Inputs worth knowing:
- folder - required dropdown, defaults to
"."for the output root. - sort_order / natural_sort / case_sensitive - same trio as the folder loader; natural sort on by default, case-insensitive by default.
- resize_method -
None,Stretch,Crop,Pad. Same trap as its sibling: mixed-size files withNonewill fail thetorch.cat, so setPadorCropif your outputs aren't uniform.
One output: IMAGE, a [B, H, W, C] batch ready for the pack's bbox detectors, a sampler, or a compare node.
Install is shared with the whole pack - ComfyUI Manager, search "Batch BBox Detector", or:
cd ComfyUI/custom_nodes && git clone https://github.com/rslosch/comfyui-nodesweet
then restart. No models, no extra deps.
The one thing to keep in mind: whatever your save node wrote to that folder is what you get, so make sure it isn't appending old runs into the same directory, or your "sorted" batch silently becomes a merge of multiple generations. Point each run at its own subfolder and this node stays predictable.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | COMBO | The output subfolder to load images from. '.' = root output folder. | |
| resize_methodopt | COMBO | None | 4 options: None, Stretch, Crop, Pad |
| sort_orderopt | COMBO | Ascending | Sort images by filename. |
| natural_sortopt | BOOLEAN | true | Use natural sort (e.g. img2.png before img10.png). |
| case_sensitiveopt | BOOLEAN | false | Case-sensitive sorting. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |