Load Image (Combined)
Load one image or plow through a folder, same node
- IMAGE
- filename_no_ext
- output_dir
- width
- height
The ComfyUI stock loader is a single-image tool, and batch pipelines hit the wall fast: you either reload by hand a thousand times or rig up a fragile loop. LoadImageCombined is the pack's "why not both" loader - a mode dropdown switches between Single (pick one file, like the built-in loader) and Batch (automatically advance through a folder on each run). It also hands you the filename and dimensions as outputs, which the stock loader doesn't.
In Single mode you pick from the image dropdown and get the standard IMAGE out. In Batch mode, you point input_dir at a folder, optionally filter with a glob pattern (default *), and each time the graph runs it loads the next file in sorted order. Two toggles matter here:
strip_trailing_numbers- strips(1),(2), etc. from the filename output, which matters if your files arephoto (1).jpgand you need a clean base name for downstream naming.repeat_last- when on, the batch holds on the final file instead of looping back to the start. That's the "leave the last frame on screen" behavior that batch QA workflows live on.
output_dir is an optional second directory you can pass through - the node returns it as an output so downstream savers know where to write. The outputs are IMAGE, filename_no_ext (with or without trailing numbers stripped), output_dir, width, and height. The width/height outputs are surprisingly handy: wire them into a resolution node or a debug log and your batch never silently changes canvas size under you.
Under the hood it's careful with state: the batch index is persisted so a restart doesn't reset you to file one, and the list is disambiguated by directory + pattern + strip-flag so switching inputs doesn't desync the counter. That persistence is the kind of detail that makes batch runs actually resume instead of restarting.
Install
Manager → search "PortraitUtils", or:
cd ComfyUI/custom_nodes
git clone https://github.com/heyburns/PortraitUtils
Restart. PIL + glob only; no extra deps.
Common issues
- Batch loaded the wrong file - check
pattern; a stale glob matching files you thought you removed is the classic culprit. - It reset to the first file mid-run - the index is per input-directory/pattern combination. Changing either one legitimately restarts the sequence.
filename_no_exthas ugly numbers - turn onstrip_trailing_numbers. It only affects the filename output, not which file loads.- Batch says no images found -
input_diris relative to... wherever you pointed it. Give it an absolute path; the node is literal about it.
If your workflow is "process this folder of scans," this is the loader that makes it a one-click thing rather than a babysitting job.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| mode | COMBO | Single | 2 options: Single, Batch |
| input_dir | STRING | — | |
| output_dir | STRING | — | |
| pattern | STRING | * | — |
| strip_trailing_numbers | BOOLEAN | false | — |
| repeat_last | BOOLEAN | false | — |
| image | COMBO | 1 options: example.png |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |
| filename_no_ext | STRING | — |
| output_dir | STRING | — |
| width | INT | — |
| height | INT | — |