Load DDS Images (Batch)
Load every DDS in a folder, in batches, without melting your VRAM
- image
- mask
- filename
- path
- format
- color_space
Load DDS Images (Batch) is the node that turns a texture pipeline from "open each file by hand" into "point ComfyUI at a folder and walk away." It's the batch sibling of the single Load DDS Image node: it scans a directory, filters by filename pattern, and hands you the DDS files as image lists - with the format and color_space combo outputs that make round-tripping into the DDS Saver painless.
If you're re-compressing a folder of game textures, or running a normalization pass across an entire material library, this is the loader you want.
How it works
On the first run it does a full directory scan (the pack caches the results, so subsequent runs on the same folder are instant - auto-invalidated when the contents change). Files are then decoded with the bundled DirectXTex tooling, same as the single loader.
The two knobs that define the batch behavior:
batch_size- set to-1to load all files at once (the default). A positive value loads that many files per pass so you can process a 13,000-file library a chunk at a time.batch_index- which batch you're on. The tooltip says it plainly: connect an external iterator for automatic incrementing, or step it manually.
pattern is glob syntax, and it's worth learning because it's the whole point. *_a.dds grabs only albedo files; *_a.dds;*_n.dds grabs albedo and normals; ? matches a single character. Separate multiple patterns with semicolons.
Inputs and outputs
Required inputs: directory (absolute path), pattern (default *), include_subfolders, batch_index, batch_size, alpha_bleed. Optional: blur_radius (0–10, for smoother alpha bleeding) and invert_mask.
Outputs are all lists:
imageandmask- the pixels, ready for processing.filenameandpath- the source names/paths, so you can preserve naming on save.formatandcolor_space- per-file combos that wire straight into Save DDS Image'sformatandoutput_color_space. This is the feature that makes "convert a folder, keep every file's format" a two-node graph.
Install
Standard for this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/lilquail/ComfyUI-Leputen-Utils
Restart, then look under Leputen-Utils → DDS. It's Windows-first: the DDS decoding relies on the bundled texconv.dll, and on macOS/Linux you'll need to grab the matching libtexconv.* from Texconv-Custom-DLL releases and drop it in bin/.
Troubleshooting
- Patterns are case-sensitive on Linux/macOS but case-insensitive on Windows. A
*_A.DDSfilter behaves differently across platforms - keep patterns lowercase to avoid surprises. - BC5 files crash the loader. The pack's known-issues list says BC5-compressed images can be saved but not loaded, and attempting it errors out and needs a ComfyUI restart. Filter
*_n.ddscarefully if your normal maps are BC5. - Slow first scan? Normal. The README clocks a 13,000-file scan at ~2s once, then instant cache hits.
- Memory - with
batch_size=-1a big library loads all at once. If you're processing thousands of 2K textures, that's the moment to use a real batch size and an iterator.
The cache is the quiet hero here. Iterate over a folder, tweak a setting, re-run - the rescan is free, which is exactly what makes experimenting on 500 files tolerable.
Inputs (8)
| 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). |
Outputs (6)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| filename | STRING | — |
| path | STRING | — |
| format | BC1_UNORM,BC2_UNORM,BC3_UNORM,BC4_UNORM,BC5_UNORM,BC6H_UF16,BC6H_SF16,BC7_UNORM,R16G16B16A16_FLOAT,R32G32B32A32_FLOAT,R8G8B8A8_UNORM,B8G8R8A8_UNORM,B8G8R8X8_UNORM,R10G10B10A2_UNORM | — |
| color_space | sRGB,Linear | — |