Nodes/ComfyUI_Eclipse/Load Image From Folder
ComfyUI Node

Load Image From Folder

Step through a folder one image at a time β€” with random, shuffle, and seed-freeze

By r-vageΒ·Created 10 months agoΒ·Updated a day agoΒ· 31
Load Image From Folder
    • image
    • mask
    β—„folder_pathβ–Ί
    β—„include_subfolderstrueβ–Ί
    β—„index0β–Ί
    β—„sort_bynameβ–Ί
    β—„sort_orderascendingβ–Ί
    β—„stop_at_endtrueβ–Ί
    β—„refresh_listfalseβ–Ί
    β—„seed_inputβ€”β–Ί

    If you're doing img2img, style transfer, or face swaps over a folder of source images, you don't want to pick each file by hand and you don't want them all dumped into one batch either. Load Image From Folder is the one-at-a-time workhorse: it reads a folder, sorts it, and serves you one image at a time - with index modes for random, shuffle, increment, and decrement, plus a seed input that freezes the selection while you tweak everything else. It's the node that turns a folder into a queue you can iterate through across runs.

    The index modes are the headline

    index is an integer with four special negative values, and they're the reason this node beats a plain "load file N" approach:

    • -1 - Random. Picks a random image each run.
    • -2 - Increment. Advance to the next image every run. The batch-workflow default.
    • -3 - Decrement. Previous image every run.
    • -4 - Shuffle, with no repeats until the folder is exhausted.

    Positive indices pick a specific file. The twist that makes it usable in real workflows is the optional seed_input: when connected, the special modes only advance when the seed value changes. Keep the same seed and the selection freezes; bump the seed and it moves. That's the difference between "every tweak I make also randomly picks a new image" and "stable reference while I tune the pipeline." This is the seed-interop feature the README specifically calls out as surviving the pack's redesign - it matters.

    stop_at_end (default on) stops the whole workflow when the index runs past the end of the list; turn it off to wrap around. refresh_list force-rescans the folder once (the file list is cached, so a new file won't appear until you enable it), and sort_by/sort_order decide the ordering that increment/decrement walk. include_subfolders defaults to on here, unlike the batch loader - worth knowing if you expect flat.

    Inputs and outputs

    • folder_path - one folder per line, absolute or relative to ComfyUI's input folder. Index spans across all listed folders.
    • index (+ seed_input, sort_by, sort_order, stop_at_end, refresh_list) - everything above.
    • Outputs: image and mask - a single image and its alpha-derived mask, not a batch. This node is deliberately one-at-a-time.

    It's marked as an output node in the schema, meaning it terminates a branch - fine for a loader that feeds a generation pipeline and stops at the end of a folder.

    Install

    Part of ComfyUI_Eclipse:

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

    Or install ComfyUI_Eclipse via ComfyUI Manager and restart. Pillow and torch, both standard. The classic setup: wire -2 increment, connect a seed node to seed_input, and a queue of runs walks your folder while keeping each image stable while you iterate on settings.

    CategoryπŸŒ’ Eclipse/ Image/Loaders

    Inputs (8)

    NameTypeDefaultDescription
    folder_pathSTRINGPath(s) to folder(s) containing images. One folder per line. Can be absolute or relative to ComfyUI input folder. Index spans across all folders.
    include_subfoldersBOOLEANtrueInclude images from subfolders recursively.
    indexINT0-4–999999Image index. Special modes: -1=Random, -2=Increment, -3=Decrement, -4=Shuffle (no repeat).
    sort_byCOMBOnameHow to sort the image list.
    sort_orderCOMBOascendingSort order for the image list.
    stop_at_endBOOLEANtrueStop workflow when index reaches end of list. Disable to wrap around.
    refresh_listBOOLEANfalseForce refresh of the cached file list. Enable once to rescan the folder, then disable. Useful after adding/removing files.
    seed_inputoptINTWhen connected, special index modes (-1/-2/-3/-4) only advance when this value changes. Keep the same seed to freeze image selection while tweaking other workflow settings.

    Outputs (2)

    NameTypeDescription
    imageIMAGEβ€”
    maskMASKβ€”