๐ฆ RS Load Images From Dir
Batch-load a whole folder of images โ and keep the alpha
- image
- filename
- folder_path
- number_of_files
You know the grind: a folder of 40 images that all need the same upscale, the same img2img pass, or the same mask edit - and ComfyUI's Load Image only does one at a time. RS Load Images From Dir is the batch loader that fixes it. Point it at an absolute folder path, optionally filter by extension, and it hands you the whole batch as a list, with the filenames and folder alongside. Two details make it nicer than most directory loaders: it keeps the alpha channel when the source has one, and it preserves original resolution - no silent downscaling or dropped transparency.
How it works
You give it a directory and it globs the files. The workflow-friendly inputs:
folder_path- an absolute path to any folder on your machine (not just ComfyUI'sinput/). The๐ Select folderbutton fills it, and there's aPastebutton for the clipboard.filter_type- pick a built-in filter (*.png,*.jpg,*.jpeg,*.webp,*.bmp,*.gif,*.*) orcustomto use your own glob.start_index/end_index- 1-based inclusive range, so you can process "just files 5 through 12" without touching the folder.custom_filter- the optional glob used whenfilter_typeiscustom. This is the one that lets you do*_mask.pngor*_upscaled.pngand pull only a specific subset out of a mixed folder.
Outputs: image (a list of IMAGE tensors), filename (the matching filenames), folder_path, and number_of_files (an INT with the count, handy for loop logic). node_data is the JSON the custom UI maintains internally - you never touch it.
Where it earns its keep
The killer use cases are the ones where "load one image, run, load next, run" would drive you insane:
- Batch upscaling. Folder in โ RS Load Images From Dir โ RSUpscaler โ save. Every image at once.
- Batch img2img or batch mask editing, feeding the list into any node that accepts a batch and saving with
%batch_num%in the prefix. - Feeding RaykoStudio's own batch machinery - RS Image Adjustments batch mode and RS Outpaint's multi-image batch mode both expect a loader like this. Arm batch once, and one queue press walks the whole folder.
- RGBA preservation. If your pipeline needs transparency (compositing, overlays, stickers on top of generated scenes), this loader is the one that doesn't flatten it.
Common issues
- The
Pastebutton is browser-dependent. In Chrome and Edge it works immediately after a one-time clipboard permission; in Firefox it pops up an extra dialog. That's a browser security rule, not a bug - andCtrl+Vinto the field always works. - Long paths get truncated from the front so you can always see the actual folder name - that's the UI, not an error.
- Empty result - check the
filter_typeactually matches your files. If you have.jpgfiles and a*.pngfilter, you get zero, andnumber_of_fileswill tell you so.
Installing it
It ships with the RaykoStudio pack. ComfyUI Manager โ search ComfyUI_RaykoStudio โ install, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Raykosan/ComfyUI_RaykoStudio
Restart ComfyUI afterward. Dependencies (pycairo, opencv-python, scipy, Pillow>=10) install via Manager; a manual clone wants pip install -r requirements.txt in the node folder. Apache 2.0, tested on ComfyUI 0.15+, Python 3.10+, Torch 2.8+.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| node_data | STRING | {} | โ |
| folder_path | STRING | โ | |
| filter_type | COMBO | *.png | 8 options: *.*, *.png, *.jpg, *.jpeg, *.webp, *.bmp, +2 |
| start_index | INT | 11โ999999 | โ |
| end_index | INT | 11โ999999 | โ |
| custom_filteropt | STRING | *.png | โ |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | โ |
| filename | STRING | โ |
| folder_path | STRING | โ |
| number_of_files | INT | โ |