Nodes/ComfyUI_Eclipse/Load Files From Folder
ComfyUI Node

Load Files From Folder

Dump a whole folder of images into one batch, sorted and sliced how you like

By r-vageΒ·Created 10 months agoΒ·Updated a day agoΒ· 31
Load Files From Folder
    • images
    • masks
    β—„folder_pathβ–Ί
    β—„include_subfoldersfalseβ–Ί
    β—„sort_bynameβ–Ί
    β—„sort_orderascendingβ–Ί
    β—„frame_start0β–Ί
    β—„frame_end-1β–Ί
    β—„resize_modefirstβ–Ί

    The stock Load Image node wants you to pick one file from a dropdown. That's fine for a single image, but when you have a folder of frames or reference shots and you want them as a batch, you need something else. Load Files From Folder (the display name for "Load Batch From Folder") reads an entire folder - or several folders - and hands you one combined image batch and one mask batch, ready for batch-aware processing downstream. It's the loader you reach for when the input isn't "an image" but "a set of images."

    How it works

    folder_path is a multiline field, and the plural is deliberate: you can list multiple folders, one per line, and all of them get merged into a single combined batch (the index spans across them). Absolute paths are supported anywhere on disk, not just under ComfyUI's input folder. include_subfolders (default off) walks recursively. Then come the two controls that make this genuinely useful rather than just "load everything":

    • sort_by (name, date_modified, date_created, size) and sort_order (ascending/descending) control the order - and the order is what determines which frame is "first," so it matters for anything frame-order-sensitive. The source sorts with a deterministic secondary key, so the same folder loads in the same order every time.
    • frame_start / frame_end slice the combined list before anything else happens. 0 = first frame, -1 = last frame, and negative values count from the end. So frame_start = 0, frame_end = -1 means "everything," and you can load a subset by changing either end.

    The resize_mode catch

    This is the one that bites people. Batches in ComfyUI are rectangular tensors - every image in a batch must share the same dimensions. Real folders rarely cooperate. resize_mode decides how to handle it:

    • first - resize everything to the first image's dimensions (default).
    • largest / smallest - resize to the biggest or smallest WΓ—H found.
    • none - raise an error if any sizes differ. Use this when you know the folder is uniform and you want a crash rather than a surprise resize.
    • list - skip stacking entirely and return the images as a list, allowing mixed sizes. The tooltip's honest note: useful for preview testing.

    Outputs are images and masks as lists, so a downstream "Convert to Batch"-style node can take over if you need a stacked tensor.

    Where it fits

    Frame sequences for video work, reference sets for style transfer, a folder of crops you want to process uniformly - anything where "the whole folder" is the input. It pairs naturally with Eclipse's batch utilities and the loop calculator family. If your folder has mixed sizes, decide your resize strategy up front; the default first will quietly change every image's dimensions, which may or may not be what you wanted.

    Install

    Part of ComfyUI_Eclipse:

    cd ComfyUI/custom_nodes
    git clone https://github.com/r-vage/ComfyUI_Eclipse
    

    Or install ComfyUI_Eclipse from ComfyUI Manager and restart. Uses Pillow and torch, both in the pack's requirements. If you need per-image loading with random/increment index modes instead of a whole-batch dump, the sibling Load Image From Folder in the same pack is the one to grab.

    CategoryπŸŒ’ Eclipse/ Image/Loaders

    Inputs (7)

    NameTypeDefaultDescription
    folder_pathSTRINGPath(s) to folder(s) containing images. One folder per line. Absolute paths are supported anywhere on the filesystem. All images are loaded and returned as a single batch.
    include_subfoldersBOOLEANfalseInclude images from subfolders recursively.
    sort_byCOMBOnameHow to sort images within each folder.
    sort_orderCOMBOascendingSort order for the image list.
    frame_startINT0-99999–99999First frame to include from the combined frame list. 0 = first frame. Negative values count from the end (-1 = last frame).
    frame_endINT-1-99999–99999Last frame to include, inclusive. -1 = last frame. Negative values count from the end. Range is applied before resize_mode normalization.
    resize_modeCOMBOfirstHow to handle images with different sizes. 'first': resize all to the first image's dimensions; 'largest': resize to the largest WΓ—H found; 'smallest': resize to the smallest WΓ—H found; 'none': raise an error if any sizes differ; 'list': skip stacking entirely and return images as a list β€” allows mixed sizes, useful for preview testing.

    Outputs (2)

    NameTypeDescription
    imagesIMAGEβ€”
    masksMASKβ€”