IF Load Images S 🖼️
Load a whole folder of images in ComfyUI without touching your input dir
- images
- masks
- image_paths
- filenames
- count_str
- count_int
- images_batch
- masks_batch
ComfyUI's built-in Load Image node only ever shows you what's already sitting in your ComfyUI/input folder. Fine for one image. A real chore when you have a folder of 200 renders you want to upscale, or a dataset you want to img2img through on a loop. IF Load Images S is the node that fixes that one annoyance: point it at any folder on your disk, preview what's inside, and get the whole batch out as tensors you can wire straight into the rest of the graph.
It comes from the Impact Frames family - same author (ImpactFrames on YouTube, if-ai on GitHub) behind the IF_AI_tools LLM/chat nodes. This one is much humbler: no API, no model downloads, no Ollama in sight. Just pillow, which ComfyUI already ships.
How it works (and why it feels a bit hacky)
The README is upfront about it: "This is a workaround solution, so it may feel a bit clunky but functions effectively." Knowing the actual mechanism explains most of the quirks:
- The Select Folder 📂 button opens a browser directory picker and drops the absolute path into the
input_pathfield. - Refresh Previews 🔄 POSTs that path to a custom server endpoint (
/IF_img/refresh_previews). The backend scans the folder, sorts the files, and writes small 300px JPEG thumbnails into your ComfyUI input folder, prefixedthb_, with the subfolder structure encoded in the filename. - The
imagedropdown lists those thumbnails, so you get a visual preview without loading anything at full resolution. - When the queue runs, the node re-reads the real folder, applies your slicing, sorting and filtering, and loads only the selected range for real.
That thumbnail-in-input-dir trick is why this works at all - and also why it pollutes your input folder.
The inputs that matter
- input_path - the folder. Absolute paths work; relative ones resolve against the input dir.
- start_index / stop_index - the slice of the folder you want. The 0 → 10 default loads the first ten; combined with
load_limitthat's how you chew through a huge folder in chunks. - load_limit - a hard cap (10 to 100,000) on how many images load in one pass.
- image_selected - single-image mode. Caveat: the README's TODO still lists "Fix single image upload" as unfinished, so treat this as the fiddly corner.
- sort_method - alphabetical, numerical (natural sort, so
frame_2sorts beforeframe_10), or by created/modified date. - filter_type - restrict to png/jpg/webp/gif/bmp, or
nonefor everything. - channel - which color channel becomes the mask; defaults to
alpha. - include_subfolders - recurse or don't.
Outputs: images (list of IMAGE) and masks (list of MASK built from your channel), image_paths and filenames (strings, handy for naming your Save nodes), count_str/count_int (like "3/120" and its index), plus the two you'll most often grab - images_batch and masks_batch, single batched tensors instead of lists.
Two behaviors are baked in. Every image in a pass is resized to the largest dimensions in the batch, so mixed-resolution folders get squashed to a common size. And masks come from a color channel, not a model: for a PNG with transparency, alpha gives you a proper matte (the code inverts it to follow ComfyUI's mask convention). For opaque JPGs you get zeros. It's not a segmentation tool and doesn't pretend to be.
Installing it
ComfyUI Manager → search IF_AI_LoadImages → install, then restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/if-ai/ComfyUI_IF_AI_LoadImages
Restart ComfyUI after. Dependencies are just pillow and numpy, which you already have - no model downloads, no keys.
Where people get burned
- The
thb_files show up in your normal Load Image browser. Thumbnails live in the input folder, so other image nodes list them. Harmless, but confusing the first time you see a folder full of 300px JPEGs you never created. - Backup Input / Restore Input are sharper than they sound. They move your input folder's contents to an
input_backupdir and clear the folder. Don't click them out of curiosity while real files sit in input. - Folder picking needs a browser that supports directory selection. The JS uses
webkitdirectory, so Chrome/Edge are fine, Safari is a coin flip.
If you only need "load the next single image per queue run from a folder," WAS Node Suite's Load Image Batch is the more battle-tested pick. IF Load Images S wins when you want the whole batch at once, with previews, straight out of an arbitrary folder.
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 | — |