Nodes/comfyui-OreX/📦 Load Image Batch (OreX)
ComfyUI Node

📦 Load Image Batch (OreX)

A folder walker that won't eat its own output

By orex2121·Created about a year ago·Updated 3 days ago· 34
📦 Load Image Batch (OreX)
    • image
    • filename
    • folder_path
    • number_of_files
    • current_index
    modeincremental_image
    folder_path
    file_pattern*
    start_index0
    seed0
    labelBatch 001
    allow_rgba_outputfalse

    Loading one image at a time is fine until you have a folder of 500 and a batch job to run on all of them. Load Image Batch (OreX) is the pack's folder-walker: point it at a directory, give it a file pattern, and it serves images one at a time (or by index), cycling through the whole folder so each queue run processes the next file. The details are where it shows its maturity - the file list is frozen per run so it never picks up its own freshly-written outputs mid-batch, which is the classic infinite loop that eats your hard drive.

    How it works

    Give it folder_path (absolute, or relative to the input folder) and file_pattern (a glob like *.png or *upscale*). It scans the folder once per run, sorts the matches, and hands back one image per execution in mode:

    • single_image - returns the file at start_index. Deterministic, good for testing.
    • incremental_image (default) - returns the next file each time the queue advances, wrapping around to the start after the last one. This is the batch-workhorse mode.

    Two safeguards matter. First, the file list is cached per label - once a batch named "Batch 001" is locked in, it keeps its original list even if files appear or vanish mid-run. That's what stops the snowball effect where every processed output gets added to the input pile. Second, the README is explicit: if batch_count / the folder is smaller than expected, files are not repeated just to fill a count - it stops rather than double-process.

    Outputs are the useful quartet: image, filename, folder_path, and the metadata pair number_of_files / current_index (so downstream nodes know where you are in the run). There's also allow_rgba_output if you genuinely need alpha through the pipeline - otherwise everything is converted to RGB, which is the safe default for most samplers.

    The inputs that matter

    • mode - single_image vs incremental_image.
    • folder_path + file_pattern - where and what to scan.
    • label - a name for the batch; this is what anchors the frozen file list.
    • seed - in incremental mode, changing the seed lets you re-run the same queue position; with a fixed seed the batch won't restart.

    Install

    ComfyUI Manager (search "comfyui-OreX") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/orex2121/comfyui-OreX
    

    Restart. No extra dependencies.

    Where people get tripped up

    The seed/rerun behavior confuses people: the README stresses that files always process low-to-high and that seed only exists so you can restart the sequence - with fixed seed, re-running won't start over. Pair it with the pack's Save Image (create_processed_folder on) and your processed outputs go to a processed/ subfolder so the batch never re-reads them - that's the intended workflow, and it's why the two nodes are designed to work together.

    Category🤫OreX/Image

    Inputs (7)

    NameTypeDefaultDescription
    modeCOMBOincremental_image2 options: single_image, incremental_image
    folder_pathSTRING
    file_patternSTRING*
    start_indexINT00–150000
    seedINT00–18446744073709550000
    labelSTRINGBatch 001
    allow_rgba_outputBOOLEANfalse

    Outputs (5)

    NameTypeDescription
    imageIMAGE
    filenameSTRING
    folder_pathSTRING
    number_of_filesINT
    current_indexINT