IF LLM Load Images S 🖼️
Point It at a Folder, Get a Whole Batch of Images and Masks Back
- images
- masks
- image_paths
- filenames
- count_str
- count_int
Stock ComfyUI's LoadImage wants one file at a time, and you drag it in like a caveman. This node is the pack's answer for anyone who wants to feed a whole folder to a vision model or a batch job: give it a directory, and it loads a range of images from disk as a list, alongside their masks, paths, filenames, and counts. It was one of the features the author (Impact Frames) called out directly in the launch post - "lets you import and display images within any folder on your computer."
In practice the classic setup is: IF_LLM_LoadImagesS → images into the main IF_LLM node → LLM writes a prompt for each image, either one at a time or via the main node's auto batch mode.
How it works
The clever bit is the thumbnail system. ComfyUI's image picker widget only lists files that are actually in its input directory, so this node writes 300px thb_-prefixed thumbnails there - that's why the image dropdown suddenly shows you folder previews. Pick a representative thumbnail to drive the widget, and the node loads the real, full-resolution files from input_path between start_index and stop_index. It even encodes subfolder structure into the thumbnail filenames so nested directories don't collide.
sort_method (alphabetical, numerical, date_created, date_modified) controls order, filter_type whitelists extensions (png, jpg, webp, gif, bmp), and include_subfolders decides whether recursion happens. The channel dropdown - alpha, red, green, blue - picks which color channel gets extracted as a mask, alpha by default.
Inputs that matter
input_path- the folder to read from.start_index/stop_index- the range of files to load.stop_indexdefaults to 10, so it loads the first ten unless you widen it.include_subfolders,sort_method,filter_type- order and scope.channel- which channel becomes your mask.load_limit- a hard cap (10 to 100,000), safety valve for huge folders.
The other inputs are worth a mention but rarely touched: image is the preview thumbnail selector, image_selected toggles single-image mode, and available_image_count is read-only - it reflects how many thumbnails are present.
Outputs
Six list outputs: images (the IMAGE batch), masks, image_paths, filenames, and the count as both count_str and count_int. Wire images into the LLM node or a batch sampler; the path/filename lists are handy if you later want to save results alongside their sources.
Installing it
Part of the same pack, so install once via ComfyUI Manager (search "IF_LLM") or:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI-IF_LLM
then restart. Heads-up from the README: this pack conflicts with IF_AI_tools - uninstall that first. The dependency list is chunky (transformers, torch, triton, decord, moviepy), so budget for a slow first install.
Troubleshooting
- Thumbnails piling up in your input folder - yes, that's by design, and they're tiny. If your
imagedropdown gets cluttered, delete thethb_files; they regenerate. - Wrong images loading - double-check
sort_method. Numerical sorting with alphabetical filenames that lack zero-padding is a classic source of1, 10, 100chaos. - Mask looks wrong - switch
channelfrom the default alpha if your source images don't actually carry alpha. - Nothing appears in the dropdown - the node scans for
thb_files at startup; if the thumbnails were cleared, refresh and re-run once to regenerate.
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 (6)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| masks | MASK | — |
| image_paths | STRING | — |
| filenames | STRING | — |
| count_str | STRING | — |
| count_int | INT | — |