Loader for Batch Image Processing
Batch Load Images
- input_images
- image
This one is exactly what it sounds like: you point it at a folder of images, it loads every one, and hands them out as a list of IMAGE tensors. There are fancier batch loaders out there with thumbnails and file browsers and regex filtering - this isn't that. It's the no-frills companion node to the OcclusionMask pack, and its real job is feeding frames into the face-swap pipeline so you can run ReActor over a whole photo shoot or a stack of extracted video frames without queuing each one by hand.
It ships in the same pack as Occlusion Mask and fills the obvious hole: the mask node accepts batches, but ComfyUI's built-in Load Image only reads one file at a time.
How it works
Dead simple under the hood. It lists the directory, opens anything ending in .png, .jpg, .jpeg, .webp, .bmp, or .gif with PIL, converts to RGB, and returns each image as a [1, H, W, 3] float tensor. The output is flagged OUTPUT_IS_LIST, so the node hands you a list rather than a stacked batch - which is exactly the format OcclusionMask's input_image input knows how to consume, one frame at a time with the models cached between them.
The inputs
Just two required:
- image_directory - the absolute path to your folder. That's the whole job.
- subdirectories ("true"/"false", default "false") - here's the thing: it's declared, but the shipped code never actually reads it. Set it to "true" and it will not recurse into subfolders. Don't lose an afternoon to that one.
There's also an optional use_input_images toggle with an input_images IMAGE socket. Flip it on and the node skips the folder entirely, splitting whatever batch you feed it into a list - handy if the frames are coming from a video-processing node instead of disk.
Wiring it
BatchLoadImages → image → OcclusionMask → IMAGE → ReActor
MASK → ReActor (face_mask)
That's the intended flow: folder of stills → protection mask → face swap, all in one queue. OcclusionMask returns its outputs matching the batch dimension, so you still get one mask and preview per frame, ready to feed a Save node or a video assembler.
Installing it
Same pack, same story: this node has moved into the ComfyUI-ialhabbal suite, and the old repo's README just points you there.
cd ComfyUI/custom_nodes
git clone https://github.com/ialhabbal/ComfyUI-ialhabbal.git
Restart ComfyUI and the "Loader for Batch Image Processing" node appears. In ComfyUI Manager you can also search the suite by its title and install from the registry. If you're only ever loading one image at a time, this node buys you nothing - but the moment you're swapping faces across 200 photos, it's the difference between one queue and 200.
Gotchas
Two, both grounded in the actual code. The subdirectories switch does nothing, as covered. And the file order isn't sorted - os.listdir order is filesystem-arbitrary, so if your output needs a stable sequence (say, frames that are supposed to become a video), prepend a zero-padded naming scheme and sort expectations accordingly. It loads RGB and normalizes to 0–1 floats, which is what every ComfyUI image node wants, so you won't fight color space surprises. Keep the folder flat and the names tidy and it just works.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| image_directory | STRING | — | |
| subdirectories | COMBO | false | 2 options: true, false |
| use_input_imagesopt | BOOLEAN | false | — |
| input_imagesopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |