Nodes/Quality of Life Nodes for ComfyUI/Load Files From Folder (Soze)
ComfyUI Node

Load Files From Folder (Soze)

Step through any file type, not just images

By SozeInc·Created 2 years ago·Updated 5 days ago· 10
Load Files From Folder (Soze)
    • File_Path
    • Load_Count
    • Input_Folder
    • Filename
    • Filename_No_Ext
    • status
    input_folder
    input_file_extensions.psb
    file_load_count1
    index0

    ComfyUI's built-in loaders are all about images. If what you're actually walking through is a folder of source files that aren't images at all - layered .psb/.psd files, raw audio, arbitrary data files a downstream custom node knows how to open - you need a loader that just hands back a path, and lets something else decide what to do with it. Load Files From Folder is that node: it doesn't try to interpret the file, it just tells you where it is.

    The default extension filter is .psb - a strong hint the author built this originally for stepping through layered Photoshop source files, probably feeding them into a separate PSB-reading node elsewhere in a pipeline. But the extension field is yours to set to anything.

    How it works

    Point it at a folder and an extension filter; it walks the matching files and, driven by index, returns the path to one file per run - the same index-and-queue-count pattern the pack's image folder loaders use. file_load_count caps how many files it considers loading in total, separate from which single one index currently points at.

    The inputs and outputs that matter

    • input_folder - required. The directory to scan.
    • input_file_extensions - required, default .psb. Change this to match whatever file type you're actually loading - .wav, .txt, .zip, anything.
    • file_load_count - optional, default 1, min 0. How many files from the folder are in scope for loading.
    • index - optional, default 0, range 0–1,000,000. Which file (by position) to return this run.
    • Output: File_Path - the full path to the selected file. This is the payload - wire it into whatever custom node knows how to open your specific file type.
    • Output: Load_Count, Input_Folder, Filename, Filename_No_Ext - bookkeeping outputs: how many files matched, the folder you scanned, and the filename in a couple of forms.
    • Output: status - a status string for the load operation.

    How to install it

    ComfyUI Manager: search "Quality of Life Nodes for ComfyUI" or "Soze." Manual:

    cd ComfyUI/custom_nodes
    git clone https://github.com/SozeInc/ComfyUI_Soze.git
    pip install -r ComfyUI_Soze/requirements.txt
    

    Restart. This node just walks a filesystem - no models, no image-processing dependency.

    Common issues & troubleshooting

    Nothing loads. Almost always the extension filter - it's an exact string match on input_file_extensions, so .PSB vs .psb (case) or a missing leading dot will silently return zero matches. Double-check the filter matches your actual filenames byte-for-byte.

    This node doesn't decode your file - and that's expected. It only ever hands back a path (File_Path); it never opens or interprets the file's contents, because it's built for arbitrary file types the pack can't know how to parse in advance. You need a separate node downstream (a PSB reader, an audio loader, whatever matches your file type) that accepts a file path.

    Index runs past the folder's contents. Check Load_Count against your index - if index exceeds the number of matching files, you'll get an error or an empty result rather than wrapping around.

    Categoryfile

    Inputs (4)

    NameTypeDefaultDescription
    input_folderSTRING
    input_file_extensionsSTRING.psb
    file_load_countoptINT1
    indexoptINT00–1000000

    Outputs (6)

    NameTypeDescription
    File_PathSTRING
    Load_CountINT
    Input_FolderSTRING
    FilenameSTRING
    Filename_No_ExtSTRING
    statusSTRING