Nodes/ComfyUI Silver Nodes/Silver Folder Image Loader
ComfyUI Node

Silver Folder Image Loader

Walk a Folder of Images in Order, or Batch Them, Without a Single Dropdown Edit

By SilverAndJade·Created about a year ago·Updated 23 days ago· 0
Silver Folder Image Loader
    • images
    • filenames
    • current_index
    folder_path
    batch_size1
    current_index0
    action
    sort_by
    sort_orderascending

    The folder-image equivalent of "next." Silver Folder Image Loader reads images out of a directory, sorts them, and feeds them into your graph one (or several) at a time, advancing a persistent index between queue runs. The classic job is batch img2img over a folder of inputs - queue up N runs, each one processes the next image, done. Or use it to flip through every image in a folder without touching the Load Image node's dropdown a hundred times.

    How it works

    It lists the folder, keeps only supported formats (.jpg, .jpeg, .png, .bmp, .gif, .webp), and sorts them by name (natural sort), creation date, modification date, or size, ascending or descending. From current_index it loads batch_size images, applies EXIF orientation, converts each to a float tensor, and stacks them into one IMAGE batch. The action input - fixed, increment, decrement, increment_wrap, or reset - decides how the index moves after each run, and a bundled JS extension writes the next index back into the widget so the state carries over without manual edits. The node marks itself as always-execute, so it re-runs even when nothing upstream changed - which is exactly what you want for a "next image" workflow.

    Inputs that matter

    • folder_path - absolute path to a directory of images.
    • batch_size - 1 to 64. For sequential stepping, leave it at 1.
    • action - increment is the batch-render workhorse.
    • sort_by / sort_order - name, created, modified, or size.
    • current_index - where to start; the JS keeps it in sync, so you mostly ignore it.

    Outputs

    • images - the IMAGE batch. Wire it to your img2img/ControlNet/Vae-encode chain.
    • filenames - the loaded filenames (a list), for display or logging.
    • current_index - the index used this run, if a downstream node wants to know.

    The gotcha that will actually stop you

    All images in one batch must be the same size. The node checks the shapes before stacking and raises "Different size images detected in the batch. Please only load one image at a time, or ensure all images are the same size." A folder of mixed-resolution images with batch_size > 1 fails hard. Batch of one always works, so the safe play is stepping one at a time, or pre-normalizing sizes. Also note: same as its sibling nodes, this one is non-recursive - only the top level of the folder is scanned, README claims to the contrary.

    Install

    ComfyUI Manager → search "ComfyUI Silver Nodes", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SilverAndJade/comfyui-silver-nodes
    

    Restart after cloning. The only real dependency is Pillow, which ComfyUI already ships.

    Categoryimage

    Inputs (6)

    NameTypeDefaultDescription
    folder_pathSTRING
    batch_sizeINT11–64
    current_indexINT00–1000000
    actionCOMBO5 options: fixed, increment, decrement, increment_wrap, reset
    sort_byCOMBO4 options: name, created, modified, size
    sort_orderCOMBOascending2 options: ascending, descending

    Outputs (3)

    NameTypeDescription
    imagesIMAGE
    filenamesSTRING
    current_indexINT