pyio - detect filename list
See what's in a folder without leaving the graph
- STRING
- count
ComfyUI doesn't ship with a "list files in this directory" node, which is absurd once you want one. Pyio - detect filename list is the fix: you give it a folder and a glob pattern, and it returns a newline-separated list of the matching filenames plus a count. It's the reconnaissance node - the thing you wire up first when you're about to loop over a folder of images, prompts, or configs.
The pyio prefix just means "Python I/O" - these are thin wrappers around os and glob. No magic, no network, nothing to download. What you get is ComfyUI-shaped access to stuff Python could already do, which is most of what this pack is about.
How it works
It globs path with pattern, gets absolute paths, and then applies your chosen mode to reshape them:
- filename - strips to just the basename (
config.txt→config.txt) - abspath - leaves full absolute paths, useful when the result is fed to another I/O node
- filename-no-ext - strips the extension too (
config.txt→config)
Every result is newline-joined into one string, and the parallel count output gives you len() of the list as an INT - handy for loop bounds or sanity-checking that you found the files you expected.
Inputs and outputs
- path - directory to scan (absolute is safer)
- pattern - glob, default
*.txt - mode -
filename|abspath|filename-no-ext - Outputs: STRING (the newline-joined list) and count (INT)
Installing it
# ComfyUI Manager: search "ymc suite" and install ymc-node-suite-comfyui
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/YMC-GitHub/ymc-node-suite-comfyui
Restart after installing. Four tiny pure-Python PyPI helpers self-install; no models, no GPU cost.
Gotchas
- The output is a single string with newlines, not an actual Python list. If a downstream node expects a list, you'll need to split it or use a node that handles multiline strings.
- No recursion - the glob only matches inside the one directory you give it.
- Empty or missing directory returns an empty string and
count = 0, no error. That silent zero is the classic "why is nothing happening" culprit. - If you also run WAS Node Suite, Manager may flag conflicting node names between the packs; disable one if save nodes misbehave. The sibling pyio - detect filename list (outm) is the same node but with three list outputs at once - check that one too if you need names and paths together.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| path | STRING | — | |
| pattern | STRING | *.txt | — |
| mode | COMBO | 3 options: filename, abspath, filename-no-ext |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |
| count | INT | — |