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

📦 Load Image Batch Size (OreX)

Grab N images at once, in the right order

By orex2121·Created about a year ago·Updated 3 days ago· 34
📦 Load Image Batch Size (OreX)
    • image
    • filename
    • folder_path
    • number_of_files
    folder_path
    file_pattern*
    batch_size1
    start_index0
    labelBatchSize 001
    file_name_without_extensiontrue
    seed0

    The sibling to Load Image Batch, with a different job: instead of handing you one image per queue step, Load Image Batch Size loads a whole slice of the folder at once - batch_size images in a single output. That makes it the node you reach for when the downstream operation wants a batch: feeding a folder of crops into a VAE encode, an upscaler, or a training-style pipeline that processes many images in one pass. It also does the one thing everybody forgets to do with folders: natural sort, so frame_10.png doesn't load before frame_2.png.

    How it works

    Point it at folder_path (must exist - it returns a safe empty result if not), give it file_pattern (a glob, e.g. *upscale*.png), and set batch_size. It lists matching image files, sorts them naturally (numbers ordered numerically, not lexically - that's the frame_10 fix), and returns the slice starting at start_index. The file list is cached per label, same anti-snowball design as Load Image Batch, so mid-run additions don't shift the batch under you.

    The file_name_without_extension toggle controls whether the filename outputs keep their extension. Outputs are lists: image (a list of IMAGE tensors), filename (a list of names), folder_path, and number_of_files. Because OUTPUT_IS_LIST is set, the image list fans out to downstream nodes that expect one image per execution - which is exactly how you feed a per-image processor from a folder in a single step.

    Inputs that matter

    • folder_path + file_pattern - the source folder and filter.
    • batch_size - how many images per run (1–1000).
    • start_index - where in the sorted list to begin.
    • label - the session anchor for the frozen file list.

    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

    Unlike Load Image Batch, this node requires an existing folder path - it won't fall back to the input directory, and a missing folder yields a silent empty result rather than an error, so check the console if you get nothing. And start_index past the end clamps to the last valid slice instead of wrapping, so your batch simply ends - that's correct, just surprising the first time. One more: it returns lists, so if your downstream node doesn't accept lists, wire a list-to-batch conversion in between rather than cursing the node.

    Category🤫OreX/Image

    Inputs (7)

    NameTypeDefaultDescription
    folder_pathSTRING
    file_patternSTRING*
    batch_sizeINT11–1000
    start_indexINT0
    labelSTRINGBatchSize 001
    file_name_without_extensionBOOLEANtrue
    seedINT00–18446744073709550000

    Outputs (4)

    NameTypeDescription
    imageIMAGE
    filenameSTRING
    folder_pathSTRING
    number_of_filesINT