Nodes/TrentNodes/List Directory Files
ComfyUI Node

List Directory Files

What's Actually in That Folder? Now It's a String.

By TrentHunter82·Created 9 months ago·Updated 4 days ago· 36
List Directory Files
    • file_list
    directory_path
    show_full_pathsfalse

    List Directory Files is the node you reach for when you can't see your own disk. ComfyUI workflows live in a canvas, but the files they chew through live in folders - and sometimes the fastest way to know what's in output/runs/ or custom_nodes/something/assets/ is to ask the graph. This node lists a directory's contents and returns the list as a string.

    It's a tiny utility, and it stays a tiny utility - one input path, one string out. Its real value is in automation and debugging: verifying a folder populated correctly, checking what a file writer produced, or just confirming a batch landed where you thought it did.

    How it works

    Two inputs:

    • directory_path - the folder to inspect. Relative paths resolve against your ComfyUI working directory.
    • show_full_paths (boolean, default off) - when off you get bare filenames; when on, each entry is prefixed with the directory path so the output is directly usable as file paths.

    The single file_list output is one STRING containing the listing. It's a plain text dump (one file per line, more or less), so it's meant for eyeballing or feeding into a text/logging node - not for structured processing. If you need per-file structured output for batch work, that's not this node; the pack's Image Folder Cowboy / File List siblings with typed outputs are the ones for that.

    Since it's an output node, it always runs and you usually just look at its result in a text preview widget or the console. Pair it with the pack's Create Text File: writer on one side, lister on the other, and you've got a little logging system that confirms what the workflow actually produced.

    Honest positioning: this is a 30-second node. It doesn't sort, it doesn't filter, it doesn't recurse - the pack's File List node (in the README's utility roster) and the Cowboys do the heavy lifting elsewhere. But "list a directory" is a surprisingly common request in a debugging session, and having it one node away beats alt-tabbing to a terminal.

    Install

    Search "Trent Nodes" in ComfyUI Manager, or:

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

    No dependencies beyond the pack's base Python stack. Restart ComfyUI after installing. (ComfyUI Manager has been flaky on this pack per the author - an early repo rename left a duplicate registry entry - so if Manager refuses, clone manually.)

    Common issues

    • "The list is empty." Wrong directory path or a relative path resolving somewhere unexpected. Use an absolute path.
    • It doesn't show subfolders' contents. Correct - this is a flat listing of one directory. Recurse with a different tool.
    • The output looks like a blob of text. That's the nature of a STRING output. Pipe it into a text preview node for readability.

    For "show me what's in here," it does the job with exactly two fields. When you need more, the pack's other file nodes have you covered.

    CategoryTrent/Utilities

    Inputs (2)

    NameTypeDefaultDescription
    directory_pathSTRING
    show_full_pathsBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    file_listSTRING