Get Directory Files Info ๐
Inventory a folder, optionally with hashes
- directory_files_info
This one reads a directory and gives you back a text listing of what's in it - the files matching a pattern, and if you ask for it, a hash of each. Think of it as ls (or dir) that lives on your canvas and hands its output to the next node. Not glamorous, but exactly the thing you want when a downstream step needs to know what files exist, or you want to verify a batch actually landed.
It's part of ComfyUI-MieNodes (ComfyUI_MieNodes), MieMieeeee's utility pack, under ๐ Common.
Why you'd reach for it
Most useful ComfyUI graphs eventually touch the filesystem - you download a set of models, dump a batch of outputs, stage a dataset - and then you want to confirm it. Did the download actually pull the files? How many images are in this folder? Is this the model I think it is, by hash? Wiring an inventory node in beats alt-tabbing to a terminal, and it makes the check part of the workflow so it runs every time instead of only when you remember.
The optional hashing is what lifts this above a plain file list. A hash is a fingerprint of file content: two files with the same hash are the same bytes, full stop. That's how you catch a truncated download, spot that two "different" files are actually identical, or record exactly which weights a run used. This node computes those hashes across a whole folder in one shot.
How it works
You give it a directory_path and a glob pattern, and it collects every matching file and builds a text summary. Set hash_algorithm to md5, sha1, or sha256 and each file gets fingerprinted with that algorithm; leave it at None (the default) and you get a fast listing with no hashing, which is what you want when you only care about names and counts. Hashing large folders isn't free - it reads every byte of every file - so None is the right default and you opt into hashing when you specifically need it.
The single output is one STRING, so the whole inventory comes back as text you can display, log, or feed to an LLM node for summarizing.
The inputs and outputs that matter
All three inputs are required:
directory_path(STRING) - the folder to scan. Use a real path; the defaultinput/abcis a placeholder.hash_algorithm(enum:md5/sha1/sha256/None, defaultNone) - off unless you need content fingerprints. Usesha256when you want a fingerprint you can trust for verification;md5is faster and fine for casual dedup checks.pattern(STRING, default*) - a glob to filter what's listed.*.safetensors,*.png, whatever.
Output is directory_files_info (STRING). Pipe it into a Show Any node to read it, or into a text/LLM node downstream.
Installing it
ComfyUI Manager โ search ComfyUI-MieNodes โ install โ restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/MieMieeeee/ComfyUI-MieNodes
then restart. No model download. Nodes appear under ๐ MieNodes.
Common issues & troubleshooting
Empty or missing output. Usually the path or the pattern. A relative directory_path resolves against ComfyUI's launch directory, not your workflow folder - prefer absolute paths. And * matches files, so if a folder holds only subfolders you may see nothing.
Hashing a big folder is slow. sha256 over a directory of multi-gigabyte model files reads all of it from disk. That's expected, not a hang - but if you only need names and sizes, leave hash_algorithm on None and it's instant.
The output is one big string, not a list. If you need to act on individual files programmatically, remember this returns formatted text, not a structured array. For a single file's details as a dictionary, GetFileInfo is the companion node; for just a filename, see GetFileBasename.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| directory_path | STRING | input/abc | โ |
| hash_algorithm | COMBO | None | 4 options: md5, sha1, sha256, None |
| pattern | STRING | * | โ |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| directory_files_info | STRING | โ |