Nodes/NH-Nodes/Load Images Folder (NH)
ComfyUI Node

Load Images Folder (NH)

Load a folder of images by index, step, and seed mode

By jetthuangai·Created 5 months ago·Updated 21 days ago· 6
Load Images Folder (NH)
    • images
    • filename
    • path
    folder_path
    index0
    step1
    seed_mode
    recursivefalse
    filename_extensiontrue
    path_outputfile_path

    Point at a folder and pull images out of it by index - that's Load Images Folder (NH) (class NH_LoadImagesFromFolder). It's the bulk-loader in the NH pack: a folder_path plus an index and step, and it hands you the image(s), the filename, and the path. If you've been dragging files into ComfyUI one at a time because "there's no folder loader," this is that missing node.

    How it works

    You give it a folder_path and it lists the image files (recursively if you flip recursive on, useful for nested sets). Then index and step select what you get: index is where in the sorted list to start, step skips entries, so step 2 with index 0 loads the 1st, 3rd, 5th… images. seed_mode controls how the effective index advances after each run:

    • fixed - same selection every run.
    • increment / decrement - step through the folder on each run.
    • random - pick somewhere in the folder each run.

    filename_extension toggles whether the filename output keeps its extension, and path_output chooses whether path returns the full file path or just the folder path. Outputs are images (an IMAGE batch), filename, and path.

    Where you'd actually use it

    Batch pipelines, mostly: process every image in a folder with the same graph, or sweep a set of source images for img2img/VTON work. seed_mode is the underrated part - set it to increment and each queue run moves to the next image, which beats hand-editing an index. Pair it with the pack's Load images matching when you need folder-plus-name selection logic rather than raw index math.

    Installing

    ComfyUI Manager → search NH-Nodes → install → restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/jetthuangai/NH-Nodes.git
    cd NH-Nodes
    pip install -r requirements.txt
    

    Restart and refresh the browser page. Pillow/numpy is all this needs from the requirements.

    Gotchas

    Sorting is natural order (filename-aware), not byte order - so img10 sorts after img9 the way humans expect. But the index range goes to 999999, so if you ask for an index past the end of the folder, you'll want to see what actually comes back rather than assume an error; check the filename output. Also, ComfyUI caches aggressively - the folder listing is read when the node runs, so if you add files to the folder, you may need to touch the workflow (or rely on the fact that this node's loader class re-reads) to pick up the new set.

    CategoryNH-Nodes/Image

    Inputs (7)

    NameTypeDefaultDescription
    folder_pathSTRING
    indexINT00–999999
    stepINT11–9999
    seed_modeCOMBO4 options: fixed, increment, decrement, random
    recursiveBOOLEANfalse
    filename_extensionBOOLEANtrue
    path_outputCOMBOfile_path2 options: file_path, folder_path

    Outputs (3)

    NameTypeDescription
    imagesIMAGE
    filenameSTRING
    pathSTRING