Load Images (Batch)
Load a whole folder of images — EXR included — in memory-safe batches
- image
- mask
- filename
- path
The built-in Load Image opens one file at a time, by hand. Load Images (Batch) is the node for when you have a folder full of textures and a pipeline that should chew through all of them - and its EXR support is the differentiator, because standard ComfyUI loaders don't touch EXR/HDR files at all.
It's the batch loader in this pack's image branch, the sibling of Load DDS Images (Batch) but for regular formats: PNG, JPG, WebP, TIFF, TGA, and EXR. Point it at a directory, filter with a glob pattern, and out come image/mask/filename lists.
How it works
First run does a full directory scan with pattern filtering; the pack caches the scan so repeat runs on the same folder are instant (auto-invalidated when contents change). Then files are loaded in batches defined by two inputs:
batch_size--1(default) loads everything at once. A positive value loads that many files per pass so you can process thousands of images without blowing up RAM.batch_index- which batch you're on; connect an external iterator to step automatically, or nudge it manually.
pattern is glob syntax: *_a.png grabs only albedo files, *_a.png;*_n.png grabs albedo and normal maps, ? matches a single character, and semicolons separate multiple patterns.
The optional exr_tone_map matters for HDR work: for EXR files it applies Reinhard tone mapping so values land in display range; leave it off and raw HDR values are preserved (clamped to 0–1).
Inputs and outputs
Required: directory, pattern (* default), include_subfolders, batch_index, batch_size, alpha_bleed. Optional: blur_radius, invert_mask, exr_tone_map.
Outputs (all lists): image, mask, filename, path.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/lilquail/ComfyUI-Leputen-Utils
Restart ComfyUI, find it under Leputen-Utils → Image. Unlike the DDS branch, this one has no Windows-only dependency - EXR loading included.
Troubleshooting
- Patterns are case-sensitive on Linux/macOS but case-insensitive on Windows - a
*.PNGfilter behaves differently across platforms; keep patterns lowercase. - HDR images look blown out - that's
exr_tone_mapoff (raw values). Turn it on if you just want to look at them; leave it off if you're processing HDR values in-engine. - Slow first scan - expected; the README quotes ~2s for 13,000 files, then instant cache hits.
- Memory with huge folders -
batch_size=-1loads all files at once. For a library of 2K textures, use a real batch size and an iterator instead of trusting the default.
If your job is "normalize every texture in this project folder," this is the node that makes it a workflow instead of an afternoon of clicking. And if those textures are HDR, it's the only sane loader in the pack for it.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| directory | STRING | path/to/folder | The absolute path to the directory containing files to load. |
| pattern | STRING | * | Filename filter pattern using glob syntax. Examples: • * = all files • *_a.dds = files ending in _a.dds • texture_* = files starting with texture_ Multiple patterns: Use semicolon (;) to match multiple patterns: • *_a.dds;*_n.dds = albedo and normal maps |
| include_subfolders | BOOLEAN | false | If enabled, recursively scans subdirectories for matching files. |
| batch_index | INT | 0 | Current batch index. Connect an external iterator for automatic incrementing. |
| batch_size | INT | -1 | Number of files to load per batch. Set to -1 to load ALL files at once. |
| alpha_bleed | BOOLEAN | true | Enable alpha bleeding to prevent halo artifacts around transparent areas. |
| blur_radiusopt | FLOAT | 0.00–10 | Apply blur during alpha bleeding for smoother transitions. |
| invert_maskopt | BOOLEAN | false | Invert the output mask (white becomes black and vice-versa). |
| exr_tone_mapopt | BOOLEAN | false | For EXR files: Apply Reinhard tone mapping. If disabled, raw HDR values are preserved. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| filename | STRING | — |
| path | STRING | — |