Nodes/AUN ComfyUI Nodes/Load Image Single/Batch
ComfyUI Node

Load Image Single/Batch

One node for a single upload or a whole folder on rotation

By loz2754·Created 8 months ago·Updated a day ago· 5
Load Image Single/Batch
    • image
    • filename
    • cleaned filename
    source_modeBatch from Folder
    path_modePre-defined
    predefined_path
    manual_pathC:/path/to/your/images
    batch_modeincrement
    range_or_pattern1
    image_upload
    max_num_words0
    output_is_listfalse

    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.

    CategoryAUN Nodes/Image

    Inputs (9)

    NameTypeDefaultDescription
    source_modeCOMBOBatch from FolderChoose to load a single uploaded image or one image from a folder.
    path_modeCOMBOPre-definedSelect path source: Pre-defined list or manual input.
    predefined_pathCOMBOSelect a folder from the pre-defined list. Customize via predefined_paths.local.json (recommended) or copy predefined_paths.example.json.
    manual_pathSTRINGC:/path/to/your/imagesEnter the absolute path to the image folder.
    batch_modeCOMBOincrementHow to select the next image from the folder. Use 'search' mode to filter files by pattern using the range_or_pattern field.
    range_or_patternSTRING1Multi-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_uploadCOMBOWhen source_mode is 'Single Image Upload', choose the file from the ComfyUI input directory.
    max_num_wordsINT00–32Maximum number of words to keep for both filename outputs. Set to 0 for no limit.
    output_is_listBOOLEANfalseWhen 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)

    NameTypeDescription
    imageIMAGE
    filenameSTRING
    cleaned filenameSTRING