Nodes/ComfyUI_Eclipse/Load Files From Folder (Step)
ComfyUI Node

Load Files From Folder (Step)

Walk through a folder in fixed-size batches, resized exactly how you want

By r-vageΒ·Created 10 months agoΒ·Updated a day agoΒ· 31
Load Files From Folder (Step)
    • images
    • masks
    • files
    β—„folder_pathβ–Ί
    β—„include_subfoldersfalseβ–Ί
    β—„sort_bynameβ–Ί
    β—„sort_orderascendingβ–Ί
    β—„frame_start0β–Ί
    β—„frame_end-1β–Ί
    β—„batch_index0β–Ί
    β—„resize_modefirstβ–Ί
    β—„scale_tolongestβ–Ί
    β—„size1024β–Ί
    β—„custom_width512β–Ί
    β—„custom_height512β–Ί
    β—„aspect_ratiooriginalβ–Ί
    β—„fitresizeβ–Ί
    β—„crop_positioncenterβ–Ί
    β—„pad_color#000000β–Ί
    β—„methodlanczosβ–Ί
    β—„divisible_by8β–Ί
    β—„devicecpuβ–Ί

    This is the grown-up version of "load a folder of images." Load Files From Folder (Step) takes everything the plain folder loader does - read one or more folders into a single batch, sorted and sliced - and adds two things that make it actually usable in a batch-processing pipeline: a batch_index that slides the frame window forward so each run loads the next fixed-size chunk, and a files output that tells you the absolute path of every image loaded. It's also the official successor to the deprecated Load Batch From Folder (Advanced), inheriting that node's entire resize arsenal.

    How the stepping works

    frame_start / frame_end define the initial window into the combined, sorted frame list - negative values count from the end, so defaults of 0 and -1 mean "everything." The trick is batch_index: bump it by one and the node shifts the whole window forward by the size of the window itself, so you process the folder in fixed-size chunks across queue runs. Pair it with an incrementing integer (Eclipse's Integer Generate is built for exactly this) and a single workflow walks through an entire folder one batch at a time. resize_mode still controls size normalization, including list mode, which skips stacking and returns mixed-size images as a list for preview testing.

    The resize arsenal, briefly

    If your images need to be a specific size before they hit a batch-aware node, this is where the node earns the "Advanced" in its name:

    • scale_to + size - constrain by longest side, shortest side, width, height, or total pixels (in kilo-pixels).
    • custom_width / custom_height - exact WΓ—H when scale_to is custom (0 keeps the original dimension).
    • aspect_ratio - override the ratio; original keeps it.
    • fit - how to fit: resize (proportional), crop (fill then crop), pad (solid color), pad_edge / pad_edge_pixel (mean/edge colors), pillarbox_blur (blurred darkened background), or stretch (distort).
    • crop_position, pad_color, method (default lanczos), divisible_by (round dims to a multiple, default 8), and device (cpu/gpu for resize ops - note lanczos isn't supported on GPU and silently falls back to bicubic).

    Three outputs come back: images and masks as lists, plus files - the list of absolute file paths matching what was loaded. That third output is quietly the most useful one for anything that needs to track provenance or save results back with matching names.

    Where it fits

    Frame sequences for video, batches of reference crops, anything where you need "process the folder in chunks, in a stable order, at a guaranteed size." The files output makes it the natural front end for a pipeline that saves processed results named after their sources.

    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. Dependencies are the pack's standard set. If you've landed here from the deprecated Advanced node, this is the one - same resizing, plus stepping and file paths on top.

    CategoryπŸŒ’ Eclipse/ Image/Loaders

    Inputs (19)

    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.
    batch_indexINT00–99999Batch index. When increased, shifts the frame start/end to load the next batch of the same size.
    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; 'custom': resize using the advanced sizing and aspect ratio rules below.
    scale_toCOMBOlongestWhich dimension to constrain: longest side, shortest side, width, height, total pixels (kilo-pixels), or custom WΓ—H.
    sizeINT10241–16384Target size for the chosen scale_to mode. For total_pixels this is in kilo-pixels (e.g. 1024 = ~1M pixels).
    custom_widthINT5120–16384Target width when scale_to is 'custom'. 0 = keep original width.
    custom_heightINT5120–16384Target height when scale_to is 'custom'. 0 = keep original height.
    aspect_ratioCOMBOoriginalOverride aspect ratio. 'original' keeps the input image ratio.
    fitCOMBOresizeHow to fit the image into target dimensions: β€’ resize β€” scale proportionally (output may be smaller than target) β€’ crop β€” scale to fill then crop excess β€’ pad β€” scale to fit then pad with solid color β€’ pad_edge β€” pad with mean color of nearest edge β€’ pad_edge_pixel β€” pad by replicating edge pixels outward β€’ pillarbox_blur β€” pad with blurred, desaturated, darkened background β€’ stretch β€” distort to exact target size
    crop_positionCOMBOcenterAnchor point for crop and pad operations.
    pad_colorSTRING#000000Background color for pad mode (hex, e.g. #000000).
    methodCOMBOlanczosInterpolation method for resampling.
    divisible_byINT81–512Round output dimensions to nearest multiple of this value.
    deviceCOMBOcpuDevice for resize operations. GPU is faster for large images. Lanczos is not supported on GPU and falls back to bicubic.

    Outputs (3)

    NameTypeDescription
    imagesIMAGELoaded (and optionally resized) images batch or list.
    masksMASKCorresponding masks batch or list.
    filesSTRINGList of absolute file paths matching the loaded frames/images.