IF tools Load Images S🖼️
Load a whole folder of images at once — the batch feeder for captioning and prompt reversal
- images
- masks
- image_paths
- filenames
- count_str
- count_int
- images_batch
- masks_batch
IF tools Load Images S is the batch-feeder node for the IF_AI pack. The LLM nodes in this pack - IF Image to Prompt, IF Prompt Maker, IF Chat Prompt - all accept image lists, and this is the node that makes those lists worth having. Point it at a folder of reference images and it hands you the whole set as a list, ready to feed into captioning or prompt-reversal loops. It's the difference between processing one image at a time and running your whole reference library through the LLM in one go.
Unlike ComfyUI's built-in Load Image, which is a pick-one-and-forget widget, this node is built for range and repetition: start/stop indices, sorting, subfolder recursion, and per-channel mask extraction for when you're pulling alpha or color-channel data along with the pixels.
How it works
Under the hood it uses the pack's ImageManager to enumerate files in a directory - by default your ComfyUI input folder, with input_path letting you point elsewhere (relative paths resolve against input; absolute paths work too). It collects matching files, sorts them by sort_method (alphabetical, numerical, date_created, date_modified), filters by extension via filter_type, then slices out the start_index to stop_index range you asked for.
The channel input (alpha, red, green, blue) drives mask generation - pick alpha and you get transparency masks for every loaded image. The node even marks itself as always-changed (IS_CHANGED returns NaN), so the list refreshes every execution rather than caching a stale folder listing - which is exactly what you want when files are being added between runs.
The inputs that matter
input_path- the folder to scan (relative to ComfyUI's input dir).start_index/stop_index- the slice of the sorted list to actually load.include_subfolders- recurse or not.sort_method- matters more than you'd think; it determines the order the LLM sees your images in.channel- the color channel used for the mask outputs.
The output list is generous. images and masks come as lists (one per file), plus image_paths, filenames, count_str and count_int so downstream logic knows what it's working with. There are also two batch outputs - images_batch and masks_batch - that stack everything into a single batched tensor for nodes that want one blob instead of a list.
Installation
Standard for this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI-IF_AI_tools.git
pip install -r requirements.txt
Or "IF_AI_tools" via ComfyUI Manager, then restart. No model downloads.
Gotchas
The one thing that trips people: load_limit caps how many files get enumerated, and the available_image_count field is read-only - it shows what the node sees in the folder. If your library is bigger than the limit, raise it. And because the node forces a refresh every run, don't be surprised that the listing updates constantly; that's a feature when you're dumping new images into the folder mid-session. It's a chunky node in an archived pack, but folder loading is one of those tools that keeps working long after the pack stops evolving.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| image | COMBO | 0 options: | |
| input_path | STRING | — | |
| start_index | INT | 00–9999 | — |
| stop_index | INT | 101–9999 | — |
| load_limit | COMBO | 1000 | 5 options: 10, 100, 1000, 10000, 100000 |
| image_selected | BOOLEAN | false | — |
| available_image_count | INT | 10–99999 | — |
| include_subfolders | BOOLEAN | true | — |
| sort_method | COMBO | 4 options: alphabetical, numerical, date_created, date_modified | |
| filter_type | COMBO | 7 options: none, png, jpg, jpeg, webp, gif, +1 | |
| channel | COMBO | alpha | 4 options: alpha, red, green, blue |
Outputs (8)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| masks | MASK | — |
| image_paths | STRING | — |
| filenames | STRING | — |
| count_str | STRING | — |
| count_int | INT | — |
| images_batch | IMAGE | — |
| masks_batch | MASK | — |