ComfyUI Node

ZEGR_WD

A Directory Walk With Sizes, for When You Just Want to Know

By Positliver·Created 2 years ago·Updated 2 years ago· 1
ZEGR_WD
    • files_and_sizes
    root_dir./models
    depth0
    folders_onlyfalse

    Every so often you need to know what's actually in a model folder. How big is that checkpoint, did that download actually land, what's quietly eating the disk? ZEGR_WD walks a directory and returns a text report: one line per entry, relative path plus a human-readable size in MB or GB. No loading, no VRAM, no network - just a recursive os.scandir walk and some string formatting, dumped out as a single string.

    It's a snapshot tool, not a viewer. You'd reach for it to sanity-check a directory before uploading (it pairs naturally with this pack's uploader), or to confirm a model tree looks the way you expect without leaving the graph.

    The inputs

    • root_dir - the folder to walk. Default is ./models, which is relative to ComfyUI's working directory - normally its install dir, but how you launched ComfyUI decides it, so relative paths can point somewhere surprising. Absolute paths are the safe move.
    • depth - how deep to go. The tooltip says it plainly: 0 for unlimited depth, 1 for one level, and so on. Great for a quick peek at a top-level folder without the full tree.
    • folders_only - when true, only directories are listed; files (and their sizes) are skipped.

    Output is files_and_sizes, a STRING. It starts with the item count, a blank line, then the listing itself. Files show as path - 3.45 GB (MB below a gigabyte, GB above); folders show as path - dir. Display it with a text preview node or read it off the console.

    Gotchas worth knowing

    Three real ones. First, that relative ./models default - it only works if ComfyUI's current working directory is the install dir, which isn't guaranteed depending on how you launch it. If you get Invalid folder path, that's why; put in an absolute path. Second, the walk is capped at 10,000 entries, and the truncation is silent - the count in the first line is how you tell you hit it. Third, in folders_only mode you get no sizes at all, because it never stats the files.

    One more: it's a one-shot snapshot, not a watcher. Run it, read the string, move on.

    Install

    Same as the rest of the pack: ComfyUI Manager → search comfyui-zegr → Install → restart, or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Positliver/comfyui-zegr
    

    Restart and it lands under File Operations. Zero model downloads, no heavy dependencies. It won't change how your images come out - but when you need to know what's sitting in a folder, it answers faster than hunting through a file manager.

    CategoryFile Operations

    Inputs (3)

    NameTypeDefaultDescription
    root_dirSTRING./models
    depthINT00 for unlimited depth, 1 for one level, etc.
    folders_onlyBOOLEANfalseIf true, only folders will be listed.

    Outputs (1)

    NameTypeDescription
    files_and_sizesSTRING