Nodes/comfyui-huyl2-nodes/File List Loader (MP3)
ComfyUI Node

File List Loader (MP3)

Point it at a folder, get a sorted file list back

By huyl3-cpu·Created 9 months ago·Updated 4 months ago· 1
File List Loader (MP3)
    • file_paths
    • count
    folder_path
    sort_methodnumerical

    Point this at a folder and it hands back every file inside as a sorted list, plus a count - the natural feed for one of this pack's loop nodes if you want to process a whole directory one file at a time.

    What it's for

    Scanning a folder by hand and wiring each file individually doesn't scale. This node does the scanning for you, and the sort order matters more than it might sound: pick numerical and it'll sort frame_2.png before frame_10.png, where a plain alphabetical sort would put frame_10 first. Pair the output with SimpleForLoopStart (using count as your total) to walk the whole folder automatically.

    Inputs and outputs

    • folder_path (STRING, required) - the directory to scan.
    • sort_method (enum, default numerical; choices: numerical, alphabetical, modified_time) - how the results are ordered.
    • Outputs: file_paths (STRING, list) and count (INT).

    About the "(MP3)" in the name

    Worth flagging directly: the schema exposes no file-extension filter anywhere in its inputs. Nothing here restricts the scan to .mp3 files despite the display name. The most plausible read is that this lists everything in the folder regardless of type, and "(MP3)" is a holdover from whatever the author originally built it for - likely a Colab audio-processing pipeline - rather than an enforced behavior. Don't assume it'll silently skip non-audio files sitting in the same directory; test it on a folder with mixed file types before trusting that assumption in an automated run.

    Installing it

    No models or extra dependencies mentioned in the README - plain filesystem scanning. Search ComfyUI Manager for the repo name first, but a small personal pack like this may not be indexed there. The manual route from the README:

    cd ComfyUI/custom_nodes
    git clone https://github.com/huyl3-cpu/comfyui-sortlist.git
    

    Restart ComfyUI afterward.

    Common issues and troubleshooting

    Verify what actually comes back before trusting the name. Given the missing extension filter, run this once on a test folder and check file_paths directly rather than assuming it's audio-only. If you specifically need only one file type, you'll likely need to filter the list yourself downstream.

    numerical sort needs digits to work with. If your filenames don't contain numbers in a consistent, comparable position, this sort mode won't behave the way you expect - fall back to alphabetical or modified_time instead.

    Pair it with the pack's loop nodes for the real payoff. On its own this just returns a list; the count output exists specifically to drive SimpleForLoopStart's total input if you want to actually iterate over what it found.

    Categorycomfyui-sortlist

    Inputs (2)

    NameTypeDefaultDescription
    folder_pathSTRING
    sort_methodCOMBOnumerical3 options: numerical, alphabetical, modified_time

    Outputs (2)

    NameTypeDescription
    file_pathsSTRING
    countINT