glob
Grab every *.png in a folder with one node
- matching paths
Basic data handling: PathGlob ("glob") is the workhorse of this pack's Path section. Give it a pattern and it hands back every path that matches - *.png in a folder, frame_00*.jpg, whatever shell-style wildcard you want. It's the node that turns "batch process everything in this directory" from a manual chore into a graph you can run and rerun.
This is where Basic data handling starts to feel like a small scripting language inside ComfyUI. You point PathGlob at E:\renders\*.png, it outputs a list of matching paths, and that list feeds the pack's list nodes - iterate, filter, load each one with PathLoadImageRGB, process, save. It's the same trick the author (a r/StableDiffusion regular who mass-generates images for datasets) clearly uses to process hundreds of files without dragging each one in by hand.
How it works
Under the hood it's Python's glob.glob(pattern, recursive). The pattern rules are the familiar shell ones:
*matches any number of characters?matches a single character[seq]matches any character in the set[!seq]matches any character not in the set
The recursive toggle (default off) enables **, so **/*.png walks subdirectories. The output is a list - the node's single matching paths output is marked as a list, so it plugs straight into list-handling nodes in this pack or ComfyUI's own iteration.
One thing worth knowing: the node overrides IS_CHANGED to compare the previous glob results against the current ones and re-run only when the set of matching files actually changes. Translation: if you add a file to the folder, the node knows and recomputes; it won't serve you a stale list from cache the way some nodes would. That's a thoughtful touch for exactly the "I re-ran a batch and expected new files" scenario.
Inputs and outputs
- pattern (STRING, default
*.txt) - the glob pattern. Relative patterns resolve against ComfyUI's cwd (checkPathGetCwdif unsure), so absolute paths are the safer bet. - recursive (BOOLEAN, default off) - enables
**for subdirectory matching. - matching paths (STRING list) - every path that matched.
Installing it
Part of the Basic data handling pack, zero dependencies. ComfyUI Manager → search "Basic data handling" → install → restart. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/StableLlama/ComfyUI-basic_data_handling
Restart, done. No models, no pip.
Where people get burned
Two things. First, the default pattern is *.txt - if you forget to change it you'll glob nothing or the wrong thing. Second, an empty result is a valid result: the node doesn't error when nothing matches, it just returns an empty list, so downstream nodes silently get nothing. Pair it with a length check (the pack's DataListLength) if a silent empty batch would be bad news. Otherwise it's the most useful node in the section - batch pipelines start here.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| pattern | STRING | *.txt | — |
| recursiveopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| matching paths | STRING | — |