🖼️ AGSoft Load Images From Dir
Load a whole folder of images into one node, sizes and alpha intact
- image
- filename
- folder_path
- number_of_files
Stock ComfyUI loads one image at a time from a dropdown. When you need to batch-process a folder of images - a hundred frames from a video, a dataset you're captioning, a pile of reference shots - the standard workflow is drag a bunch of Load Image nodes and wire them all in. That's miserable. AGSoft Load Images From Dir loads every matching file from a folder in one shot, without resizing and without touching the alpha channel.
The node's own description spells out the guarantees: original size preserved, alpha preserved, and it supports natural sorting, ranges, and extension filters. If nothing matches your filter, it raises a clear error instead of crashing ComfyUI - a small thing that saves a lot of "why is my graph red" staring.
How it works
folder_path- the directory to scan. Absolute or relative; the node doesn't care where it lives.filter_type-*.*for everything, or a specific pattern:*.png,*.jpg,*.jpeg,*.webp,*.bmp,*.gif.customswitches to thecustom_filterfield, where you can give it multiple patterns like*.png, *.jpg(a barepnggets normalized to*.png).start_index/end_index- a range into the sorted file list. Both default to 0, which means "from the start" / "to the end" respectively. Want files 5 through 10? Set 5 and 10. (0 at the end position = through the end of the list.)
Outputs: image as a list of IMAGE (one per file), a parallel filename list, the resolved folder_path, and number_of_files so downstream logic knows how many it's dealing with. Note the list outputs - this is what makes it work with list-driven batch nodes rather than expecting a single batched tensor.
Installation
From comfyui-AGSoft:
cd ComfyUI/custom_nodes
git clone https://github.com/Art-xmaster/comfyui-AGSoft.git
# restart ComfyUI
Or ComfyUI Manager → search "comfyui-AGSoft". numpy + opencv-python; no model downloads.
Where people get burned
The filename-vs-content mismatch: files are loaded in sorted order, so if you set a range assuming your own manual order, you may get different images than you expected. Sort your files or check number_of_files first. Also remember you're getting a list - if the node you're feeding wants a single batched IMAGE, you'll need a list-to-batch step. And this is a raw loader: no auto-cropping, no resize, no EXIF rotation. Feed it what you want to process. For one folder at a time it's genuinely the fastest way to get a pile of images into a graph.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | Path to the folder with images. --- Путь к папке с изображениями. | |
| filter_type | COMBO | custom | File extension filter. *.* = all files. custom = use custom_filter. --- Фильтр по расширению. *.* = все файлы. custom = использовать custom_filter. |
| custom_filter | STRING | *.png, *.jpg | Used when filter_type='custom'. One or more patterns separated by comma/semicolon/space. Examples: '*.png, *.jpg' or 'png jpg' or '*.webp'. A bare extension (png) becomes *.png. --- Используется при filter_type='custom'. Один или несколько паттернов через запятую/точку с запятой/пробел. Примеры: '*.png, *.jpg' или 'png jpg' или '*.webp'. Расширение без точки (png) превращается в *.png. |
| recursive | COMBO | off | on = search images recursively in all nested subfolders (**). off = only the selected folder. --- on = искать изображения рекурсивно во всех вложенных подпапках (**). off = только в выбранной папке. |
| sort_order | COMBO | natural | File ordering before the range is applied. natural = natural sort by name (img_2 before img_10). reversed = reverse of natural. date_newest = by file modification date, newest first. date_oldest = by file modification date, oldest first. --- Порядок файлов перед применением диапазона. natural = естественная сортировка по имени (img_2 перед img_10). reversed = обратный порядок. date_newest = по дате изменения файла, сначала новые. date_oldest = по дате изменения файла, сначала старые. |
| start_index | INT | 00–999999 | First file index (0-based, inclusive) in the sorted list. --- Индекс первого файла (с 0, включительно) в отсортированном списке. |
| end_index | INT | 00–999999 | Last file index (inclusive). 0 = to the end of the list. --- Индекс последнего файла (включительно). 0 = до конца списка. |
| max_images | INT | 00–999999 | Maximum number of images to load (from the selected range). 0 = all. --- Максимум изображений для загрузки (из выбранного диапазона). 0 = все. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| filename | STRING | — |
| folder_path | STRING | — |
| number_of_files | INT | — |