Folder File Scanner 📂
Folder File Scanner 📂
- file_paths
- count
This is the image/video sibling of Audio File Scanner in the same pack - point it at a folder, and it returns every matching file's absolute path as a list, plus a count. Straight from the author's own description: scan the folder, return the full list of paths.
Inputs and outputs that matter. folder_path is a plain string, and its tooltip specifically asks for an absolute path - don't hand it something relative and hope for the best. file_type is a dropdown with two options: image (the default) restricts the scan to .jpg .jpeg .png .webp .bmp .gif .tiff, and video restricts it to .mp4 .avi .mov .mkv .webm .wmv .flv - both lists come directly from the field's own tooltip. Rather than shipping two separate scanner nodes, this pack handles both media types through one enum. Two optional fields: sort_method (numerical, alphabetical, or modified_time) and recursive (off by default, crawls subfolders when enabled).
Outputs: file_paths (a STRING list) and count (an INT).
Where it fits. This is the node you drop in front of any batch pipeline that needs to walk a directory of source images or clips - feed file_paths into whatever loader or iterator handles the actual processing from there. It's structurally identical to Audio File Scanner elsewhere in this pack, right down to the shared sort_method/recursive optional pair - the author clearly built one scanning pattern and reused it for both media types rather than writing two unrelated implementations. If you've already used one of the two, the other will feel completely familiar.
Installing it. Search comfyui-huyl2-nodes in ComfyUI Manager, or clone the pack directly:
cd ComfyUI/custom_nodes
git clone https://github.com/huyl3-cpu/comfyui-sortlist
Restart ComfyUI.
Troubleshooting. Same shape of problem as its audio counterpart: a count of 0 almost always traces back to either file_type not matching what's actually sitting in that folder, or recursive being off when your files live in subfolders rather than the top level. file_type specifically deserves a second look - picking image doesn't warn you that it's silently ignoring every video file in that same folder, it just won't return them, which can look like "the scanner found nothing" when really it found nothing of the type you asked for.
Worth knowing too: sort_method's numerical option only sorts meaningfully if your filenames actually contain numbers to key off - frames named frame_001.png, frame_002.png, and so on. Point it at a folder of arbitrarily-named files and you'll effectively get whatever order alphabetical would have given you anyway, which is fine, just not the numeric-by-sequence order you might be expecting.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | Đường dẫn tuyệt đối đến thư mục cần quét | |
| file_type | COMBO | image | image: .jpg .jpeg .png .webp .bmp .gif .tiff video: .mp4 .avi .mov .mkv .webm .wmv .flv |
| sort_methodopt | COMBO | numerical | Cách sắp xếp: theo số, tên, hoặc thời gian sửa đổi |
| recursiveopt | BOOLEAN | false | True = quét cả thư mục con |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| file_paths | STRING | — |
| count | INT | — |