Load Images π¦
Batch-load a folder's worth of images at once
- images
- images names
- count
Where Load Random Image grabs one file from a folder, this node grabs several at once, in order, starting from wherever you tell it. Point it at a directory with a limit, and it returns that many images plus their filenames - the setup node for anything that needs a real set of pictures to work on, not just one: feeding Grid Filler a contact sheet, running a batch upscale, or comparing a folder full of outputs against each other.
How it works
images_directory is the folder to read from. start_index says where in that folder's listing to begin (0 for the first file), and load_limit says how many to grab from there - so start_index=10, load_limit=4 gets you files 10 through 13, useful for paging through a large folder in chunks rather than loading everything at once. output_mode decides the shape of what comes back: list returns the images as a Python list, which makes downstream nodes execute once per image (handy if you're processing each one independently); batch stacks them into a single IMAGE tensor, which is what a node like Grid Filler actually expects as input.
The inputs and outputs that matter
images_directory- full path to the source folder. Defaults to/tmp/ComfyUI/output, a Linux-container-style path - change this to a real folder on your system before expecting results.start_index- 0 to 200, default 0.load_limit- 2 to 200, default 4.output_mode-listorbatch, defaultlist.
Outputs: images (a list of IMAGE), images names (a matching list of STRING filenames), and count (how many were actually loaded - useful if the folder had fewer files than your load_limit asked for).
Installing it
Via ComfyUI Manager: search "iTools" or "ComfyUI-iTools," install, restart. Manually:
cd ComfyUI/custom_nodes
git clone https://github.com/MohammadAboulEla/ComfyUI-iTools
then restart.
Troubleshooting
Node errors on load, or returns nothing. Same issue as this pack's other directory-reading nodes: the default /tmp/ComfyUI/output doesn't exist on most machines, especially Windows installs. Set images_directory to a real, absolute path first.
Downstream node (like Grid Filler) rejects the output. Check output_mode. It defaults to list, but a lot of image-arranging nodes expect a single batched tensor, not a Python list of separate images - switch this to batch if the next node in your graph is complaining or behaving strangely.
Getting fewer images than load_limit asked for. That's expected if the folder simply doesn't have that many files starting from start_index - check the count output to see how many actually loaded, rather than assuming load_limit guarantees that exact number.
Images come back in an order you didn't expect. The node reads the directory listing and walks it from start_index, so the order follows however your operating system or filesystem returns directory contents - typically alphabetical, but not guaranteed across every OS and filesystem. If you need a specific order, name your files with a sortable prefix (001_, 002_, and so on) rather than relying on load order matching creation order.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| images_directory | STRING | /tmp/ComfyUI/output | β |
| start_index | INT | 00β200 | β |
| load_limit | INT | 42β200 | β |
| output_mode | COMBO | list | 2 options: list, batch |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | β |
| images names | STRING | β |
| count | INT | β |