Load Files With Pattern (Soze)
Regex-filtered file listing from a folder
- File_Paths
- Load_Count
- status
Where Load Files From Folder filters by a simple file extension, Load Files With Pattern filters by a full regular expression - useful when "give me everything with this extension" isn't specific enough, and you need something like "only files starting with render_ followed by digits" or "anything except the ones with _backup in the name."
Unlike the pack's index-driven loaders, this one doesn't step through files one at a time across separate runs - it returns everything that matches, in one shot, as a single output.
How it works
You give it a folder and a filename_pattern regex (the default, .*, matches everything - a no-op filter). It scans the folder, tests every filename against the pattern, and returns the matching paths together with a count. Because it returns all matches in a single string rather than stepping through them by index, you'll likely want to follow it with a string-splitting node - the pack itself includes a String Splitter node in its Strings group, per the README - if you need to process each matched file individually rather than as one combined blob.
The inputs and outputs that matter
input_folder- required. The directory to scan.filename_pattern- required, default.*. A regex, not a glob - sorender_\d+\.pngmatchesrender_1.png,render_042.png, etc., but plain wildcard syntax likerender_*.pngwon't work as you'd expect here.- Output:
File_Paths- the matched paths. Since the exact delimiter isn't documented, check the raw output first (a Show Text node) before assuming a format - most likely one path per line - and pair it with a splitter node from the same pack if you need to iterate the results individually. - Output:
Load_Count- how many files matched. - Output:
status- a status string for the scan.
How to install it
Through ComfyUI Manager (search "Quality of Life Nodes for ComfyUI" or "Soze") or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt
then restart. No models, no GPU dependency - it's a filesystem scan.
Common issues & troubleshooting
Pattern matches nothing, or matches everything. This is regex, not glob syntax - a habit carried over from shell wildcards (*.png) will misbehave here, since * in regex means "zero or more of the preceding character," not "any characters." Use .*\.png$ for what a shell would call *.png.
You need to process each matched file separately. File_Paths comes back as one combined output, not as a list you can fan out automatically - pair this node with a string-splitting node (the pack's own String Splitter, per the README's Strings group) if your workflow needs to loop over the individual matches rather than treat them as one blob.
Pattern is case-sensitive when you didn't expect it to be. Standard regex is case-sensitive by default; if your folder has inconsistent capitalization in filenames, either write the pattern to account for both cases explicitly or normalize filenames ahead of time.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| input_folder | STRING | — | |
| filename_pattern | STRING | .* | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| File_Paths | STRING | — |
| Load_Count | INT | — |
| status | STRING | — |