Nodes/ComfyUI-mnemic-nodes/πŸ“‚ Load Images From Path
ComfyUI Node

πŸ“‚ Load Images From Path

Iterate a folder one image at a time

By MNeMoNiCuZΒ·Created 3 years agoΒ·Updated 23 days agoΒ· 105
πŸ“‚ Load Images From Path
    • image
    • mask
    • image_path
    • current_index
    • total_count
    β—„seed0β–Ί
    β—„input_pathβ–Ί

    This is the node for "run my workflow once per image in this folder." Point input_path at a directory (or a single file), and each execution hands you one image - which one is controlled by treating seed as a plain index rather than a random-number source.

    How it works

    Set input_path to your folder, then right-click the seed widget and set its Control after generate option to Increment. Every time you queue the workflow, seed bumps up by one, so the node steps through the folder in order - image 0, then 1, then 2, and so on. total_count tells you how many images the folder actually contains, so you can tell when you've cycled all the way through and looped back to the start.

    You can also just leave seed fixed and edit it by hand if you want to jump straight to a specific image rather than stepping through sequentially - current_index in the output confirms exactly which one you landed on, which is a handy sanity check if you're not sure the index and the file lined up the way you expected.

    The inputs and outputs that matter

    • seed - the index into the folder. Pair it with the "Increment" control-after-generate setting to actually iterate; left alone, it just reloads whatever index it's currently set to.
    • input_path - a folder of images, or a single image file.

    Outputs: image, mask, image_path (so you know exactly which file you just loaded), current_index, and total_count.

    How to install it

    Via ComfyUI Manager: search ComfyUI-mnemic-nodes, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MNeMoNiCuZ/ComfyUI-mnemic-nodes
    

    Restart ComfyUI. No model downloads or extra dependencies - it's reading local image files.

    Common issues & troubleshooting

    It keeps loading the same image every time. This is almost always the seed widget's control-after-generate setting still sitting on "Fixed" instead of "Increment." Without that set, the index never advances, so you get index 0 forever no matter how many times you queue the workflow.

    Path errors, or an empty result. input_path has to be a real, readable path on the machine running ComfyUI - a mistyped folder name or a path that made sense somewhere else just comes back empty rather than finding anything to load.

    Iterating a whole folder for batch processing. This is exactly the use case it's built for - running an upscale, a caption pass, a metadata-strip, or any other single-image pipeline over an entire existing folder without wiring up a for-loop node or reselecting a file by hand between runs. Combine it with a queue-multiple-times workflow (or an API loop that just re-queues the same graph total_count times) and it does the folder-walking for you.

    Category⚑ MNeMiC Nodes

    Inputs (2)

    NameTypeDefaultDescription
    seedINT00–18446744073709550000The index of the image to load. Set 'Control After Generate' to 'Increment' in the workflow options to cycle through images sequentially.
    input_pathSTRINGPath to a folder containing images or a single image file.

    Outputs (5)

    NameTypeDescription
    imageIMAGEβ€”
    maskMASKβ€”
    image_pathSTRINGβ€”
    current_indexINTβ€”
    total_countINTβ€”