Nodes/Comfyui_PDuse/PD_Load Images Advance
ComfyUI Node

PD_Load Images Advance

The folder loader that tells you everything about each file

By 7BEII·Created 2 years ago·Updated 15 days ago· 53
PD_Load Images Advance
    • images
    • masks
    • file_paths
    • image_names
    • image_numbers
    directory
    image_load_cap0
    start_index0
    load_alwaysfalse
    sort_methodnumeric

    PD_Load Images Advance (Load_Images_Advance) is the richer sibling of the pack's plain PD_Load Images. Same folder-walking, same caching, same recursive scan of subdirectories - but it gives you five outputs instead of three, including per-file names and numbering. If you're building a workflow that needs to know things about the images it's processing, this is the one.

    What it adds over V1

    The three extra outputs are the whole story:

    • file_paths - full paths, so you can feed them into save nodes or pair them with caption files.
    • image_names - the bare filenames, which are what you actually want when you're matching image.png to image.txt for dataset work.
    • image_numbers - the index/count of loaded images as an INT, handy for progress reporting or loop bounds.

    Plus the same core trio you'd expect: images (the batch) and masks (alpha masks per image). The inputs mirror V1 too - directory, image_load_cap, start_index, load_always, and sort_method (numeric/alphabetic/natural). The natural sort is genuinely worth setting if your filenames mix numbers and words; numeric ordering is the default and it's what most people want for img_01-style sequences.

    How it works

    Recursive os.walk from the given directory, collect supported image files, sort, cache, and emit. The load_always flag is the one behavioral quirk to remember: caching is on by default, so if the folder changes under a running workflow, flip load_always to force a fresh scan. image_load_cap of 0 means unlimited; start_index lets you skip the first N files.

    Installing

    Part of the 7BEII/Comfyui_PDuse pack. ComfyUI Manager → search "Comfyui_PDuse" → install, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/7BEII/Comfyui_PDuse
    cd Comfyui_PDuse
    pip install -r requirements.txt
    

    Restart after. No models; dependencies are the pack's standard Pillow/numpy/opencv-python set with torch from ComfyUI.

    Gotchas

    Same folder-of-strings friction as V1 - you type an absolute path, there's no browser. And don't get caught by the caching: your workflow will happily keep showing a folder's old contents until load_always is on. Pick V1 vs Advance by whether you need names/numbers out. If you just want pixels, V1 is simpler; the moment you're matching files by name or tracking progress by count, Advance earns its keep.

    CategoryPD_Image/Loading

    Inputs (5)

    NameTypeDefaultDescription
    directorySTRING
    image_load_capoptINT0
    start_indexoptINT00–18446744073709550000
    load_alwaysoptCOMBOfalse2 options: false, true
    sort_methodoptCOMBOnumeric3 options: numeric, alphabetic, natural

    Outputs (5)

    NameTypeDescription
    imagesIMAGE
    masksMASK
    file_pathsSTRING
    image_namesSTRING
    image_numbersINT