从路径加载🐠meeeyo.com
List every file in a folder by extension — full paths, count, and a list, all at once
- any
- STRING
- INT
- LIST
Batch workflows have a recurring need that ComfyUI's built-in loaders don't give you: "give me all the PNGs in this folder, as data I can feed into a loop." FileListAndSuffix (从路径加载 - "load from path") is that node. Point it at a folder, pick an extension filter, and it returns three things at once: the full paths as one newline-joined STRING, the count as an INT, and the same paths as an actual LIST. It's the plumbing node that lets a single workflow chew through a whole directory of inputs without hand-loading each one.
How it works
Two inputs: folder_path (a plain STRING, type or wire the absolute path) and file_extension, a dropdown with six options: jpg, png, jpg&png, txt, csv, and all. The filter is on the file extension, matched case-insensitively (.JPG counts as jpg).
Outputs:
STRING- all matching full paths, one per line. Feed this into a text-splitting node (ExtractLinesByIndex,TextToList, etc.) to iterate.INT- the count of matching files. Wire it anywhere you need to know "how many," e.g. to set a batch size or loop count.LIST- the same paths as a native Python list, for nodes that want list-typed input.
If the folder doesn't exist (or is empty), you get empty string, 0, and an empty list - graceful, no crash. A couple of honest limitations: it's non-recursive - subfolders are ignored, only files directly in folder_path are listed - and there's no sorting guarantee, so order follows os.listdir, which isn't alphabetical on every OS.
Why you'd reach for it
It's the front door for folder-driven batch automation: list a directory of reference images, count them to size your batch, and walk them into the graph. It pairs with GenericImageLoader (which can load any absolute path this returns) and FileDeleteNode (clean up what you processed). The string output also dumps a human-readable manifest you can log via WriteToTxtFile.
Install
Part of ComfyUI_StringOps:
cd ComfyUI/custom_nodes
git clone https://github.com/MeeeyoAI/ComfyUI_StringOps.git
Restart. Or ComfyUI Manager → "ComfyUI_StringOps". No models, no special deps. Chinese UI (从路径加载) with the 🐠meeeyo.com branding and the author's contact ad in the description.
Common issues
The extension filter is exact-per-choice - jpg&png is a specific option, not a free-form expression, so "all my webp files" means choosing all and filtering downstream. And the non-recursive behavior catches people: you list ./images/, get a count, and wonder why the images/sub/ files never appear - they won't. One more: paths are absolute as built (os.path.join(folder, f)), so they're machine-specific - a workflow shared with a friend will point at your folder; keep folder_path as a typed input rather than hardcoding when you share.
It's a simple node with three well-chosen outputs, and for anyone doing folder-driven batches it's quietly essential.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | — | |
| file_extension | COMBO | jpg | 6 options: jpg, png, jpg&png, txt, csv, all |
| anyopt | * | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| STRING | STRING | — |
| INT | INT | — |
| LIST | LIST | — |