Nodes/comfyui-superside-nodes/Superside Load Images From Folder
ComfyUI Node

Superside Load Images From Folder

Batch-load a whole folder into one IMAGE tensor — and don't forget it normalizes sizes

By Superside·Created about a month ago·Updated 3 days ago· 1
Superside Load Images From Folder
    • image
    • count
    • image_path
    folder
    width1024
    height1024
    keep_aspect_ratio
    image_load_cap0
    start_index0
    include_subfoldersfalse

    Load every image in a folder as one batched IMAGE tensor. That's the job, and it's the Superside in-house version of comfyui-kjnodes' Load Images From Folder (KJ) - the node you reach for when "one at a time" isn't a workflow, a folder is. It's the batch half of the pipeline: load a hundred frames, run them through whatever processing you've built, and process them all in one graph execution.

    This is pure local file I/O - no API, no key, no fal credits, and your images never leave the machine. If you're doing retouch passes, normalization, or any per-image transform across a product shoot or a frame sequence, this is the loader that feeds the loop.

    The inputs that matter

    • folder - path to the directory. The node reads it straight from disk, so point it at a real filesystem path rather than ComfyUI's input folder.
    • width (default 1024) and height (default 1024) - the target size every image gets normalized to. This is the gotcha to internalize: images in the batch must share one tensor shape, so this node resizes everything. It doesn't preserve each file's native dimensions; it fits them to your width/height.
    • keep_aspect_ratio - how that fit happens: crop (cut to the target ratio, no distortion), pad (letterbox, no cropping, adds background), or stretch (distort to fit exactly). If your images are all the same aspect ratio, crop is the usual choice; mixed source images want pad.
    • image_load_cap (default 0 = no cap) - stop after N images. The safety valve for a folder that's bigger than you meant.
    • start_index (default 0) - skip the first N files.
    • include_subfolders (default off) - recursively pull from subdirectories. Nice for organized shoots; surprising if you forgot a nested folder is in there.

    Three outputs: image (the batched tensor), count (INT, how many images loaded - handy for downstream logic), and image_path (STRING) - useful if you need to map results back to source filenames.

    How it works

    It scans the folder, reads each image, and resizes it to your target using the chosen aspect-ratio policy, then stacks the batch into one tensor. All on your CPU, all local. Because it must produce a uniform batch, the resizing isn't optional - that's the one design constraint that changes your output compared to loading files individually.

    Installing it

    cd ComfyUI/custom_nodes
    git clone https://github.com/Superside/comfyui-superside-nodes
    pip install -r requirements.txt
    

    Restart ComfyUI and look under Superside. Nothing else to configure - no key, no models.

    Where people get burned

    Two things. First, the resize: if your folder is mixed orientation - some landscape, some portrait - crop to a square 1024×1024 will chop heads and edges off every non-square source, and pad will letterbox them. Decide deliberately which you want; there is no "keep originals in the batch" option because a tensor batch can't hold mixed sizes. Second, image_load_cap = 0 means unlimited, not "zero images" - a folder with 10,000 frames will happily load all of them into memory. Set a cap while you're testing, and use the count output to sanity-check what actually loaded.

    CategorySuperside

    Inputs (7)

    NameTypeDefaultDescription
    folderSTRING
    widthINT1024
    heightINT1024
    keep_aspect_ratioCOMBO3 options: crop, pad, stretch
    image_load_capoptINT0
    start_indexoptINT0
    include_subfoldersoptBOOLEANfalse

    Outputs (3)

    NameTypeDescription
    imageIMAGE
    countINT
    image_pathSTRING