Load Image Single/Batch
One node for a single upload or a whole folder on rotation
- image
- filename
- cleaned filename
ComfyUI's stock image loader will happily load one uploaded file, but "cycle through a folder of 200 reference images" is a different job entirely. AUNImageSingleBatch3 ("Load Image Single/Batch") does both in one node: load a single uploaded image, or treat a whole folder as a batch and walk through it in a half-dozen selection modes - including pattern-based search so you can rotate through matching images instead of everything in the directory.
The top switch, source_mode, picks the personality. Single Image Upload shows the image_upload file widget and behaves like a normal loader. Batch from Folder turns on the batch machinery. Then path_mode chooses where the folder comes from: Pre-defined uses a dropdown populated from predefined_paths.json in the pack folder (copy predefined_paths.example.json and edit - the README recommends a predefined_paths.local.json so updates don't clobber your list), or Manual and you type the absolute path into manual_path.
The heart of the node is batch_mode, with six options: increment and decrement step forward/backward through the folder; random picks a file each run; fixed uses a specific index; range cycles through a comma-separated list or ranges like 2,3,4-7,10; and search filters the folder by pattern first, then increments through the matches. The range_or_pattern field doubles as the index/range source and the search pattern, and search supports wildcards (portrait*, *face*, img_???), regex (img_[0-9]+, .*face.*), or plain text. The pack's README for this node is unusually good on search examples - worth a read when you first hit the search modes.
Outputs are image, plus filename and cleaned filename (with max_num_words optionally trimming both to the first N words). The cleaned version is the one to feed into prompts or other nodes that want a tidy name. The node is marked as an output node, so you get a preview on the canvas, and the frontend also hides the preview toggle for cleaner layouts.
Where this shines: batch img2img, face-swap runs over a folder, or a prompt-cycling setup where every queue run pulls the next reference. A couple of practical notes from the source: the node remembers its last position per folder/pattern combination, and search only re-scans the folder when the folder, pattern, or mode actually changes - so long queues over big folders don't re-list the directory every step.
Install with the pack: ComfyUI Manager (search "AUN") or cd ComfyUI/custom_nodes && git clone https://github.com/loz2754/AUN-ComfyUI-Nodes, then restart. Dependency-light, no models. If batch-mode file loading is a recurring want in your workflows, this node is the pack's answer and it's a good one.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| source_mode | COMBO | Batch from Folder | Choose to load a single uploaded image or one image from a folder. |
| path_mode | COMBO | Pre-defined | Select path source: Pre-defined list or manual input. |
| predefined_path | COMBO | Select a folder from the pre-defined list. Customize via predefined_paths.local.json (recommended) or copy predefined_paths.example.json. | |
| manual_path | STRING | C:/path/to/your/images | Enter the absolute path to the image folder. |
| batch_mode | COMBO | increment | How to select the next image from the folder. Use 'search' mode to filter files by pattern using the range_or_pattern field. |
| range_or_pattern | STRING | 1 | Multi-purpose field: • For fixed/range modes: Comma-separated 1-based indices or ranges (e.g., 2,3,4-7,10) • For search mode: Search pattern supporting wildcards (*,?,[]), regex, or simple text (e.g., 'portrait*', 'img_[0-9]+', '.*face.*') |
| image_upload | COMBO | When source_mode is 'Single Image Upload', choose the file from the ComfyUI input directory. | |
| max_num_words | INT | 00–32 | Maximum number of words to keep for both filename outputs. Set to 0 for no limit. |
| output_is_list | BOOLEAN | false | When enabled with 'range', 'fixed', or 'search' batch modes, output ALL matching images as a list (one per downstream execution) with corresponding filename lists. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| filename | STRING | — |
| cleaned filename | STRING | — |