🏞️ Load Image Folder
Pull a batch of images from a directory, random or in sequence
- image
- img_path
When you're not making one picture but processing a stack of them, this is the loader you want. Point it at a folder, tell it how many images to grab and whether to grab them randomly or in order, and it hands the batch downstream as a list. Bulk upscaling, running a hundred photos through the same img2img, building a caption dataset, pulling reference frames - anything that's "do this to every image in here" starts with a node like this. Core ComfyUI's Load Image handles a single file; this handles the directory.
How it works
You give it a folder path and it reads the images inside, returning them as a list along with their file paths. Because the output is a list, whatever you wire it into runs once per image - that's ComfyUI's iteration mechanism, and it's how one graph processes a whole batch.
The number and random inputs decide which images you get, and the README spells out the logic:
- random = true - the images are pulled completely at random from the folder.
- random = false - you get a sequence of adjacent images (consecutive files), which is what you want for ordered processing like video frames or a numbered set.
- number < 1 (e.g.
-1) - load the entire folder. The default of 1 grabs a single image; set it to 10 for ten, or to -1 for everything.
The seed controls the randomization so a "random" pick is reproducible when you want it to be - lock the seed and you get the same random subset every run.
The inputs that matter
- folder_path - the directory to read from. This is a path on the machine running ComfyUI, not your local desktop if you're on a remote or cloud instance (see troubleshooting).
- number - how many images to load.
-1(or anything below 1) means the whole folder; otherwise it's a count. - random - random pick vs. adjacent sequence, as above.
- seed - makes random selection reproducible.
Outputs are image (the batch, as a list) and img_path (the matching file paths, as a list). That path output is the sleeper feature: when you're batch-processing and saving, you usually want the output named after its input, and carrying the original path through is how you do that instead of ending up with ComfyUI_00042.png.
Common issues
Empty load or "folder not found." The classic remote-instance mistake: folder_path is server-side. If ComfyUI runs on a cloud box or hosted service, the folder has to exist there, not on your laptop. Use an absolute path you know is on the server.
It only loaded one image. number defaults to 1. Set it to the count you want, or -1 for the whole folder.
My "sequence" came out shuffled. random is on. Turn it off for adjacent, in-order loading.
Big folders eat memory. Loading a whole directory of high-res images with number = -1 pulls them all into RAM/VRAM at once. For large sets, load in chunks with a real number rather than everything.
Installing SDVN_Comfy_node
ComfyUI Manager: search "SDVN_Comfy_node" → install → restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/StableDiffusionVN/SDVN_Comfy_node
Then pip install -r custom_nodes/SDVN_Comfy_node/requirements.txt from the ComfyUI root and restart. The node is under 📂 SDVN.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | Đường dẫn đến thư mục chứa ảnh. | |
| number | INT | 1 | Chuyển sang -1 để load toàn bộ ảnh |
| random | BOOLEAN | true | Bật tắt chế độ chọn ảnh ngẫu nhiên. |
| seed | INT | 00–18446744073709550000 | Seed ngẫu nhiên cho việc chọn ảnh. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| img_path | STRING | — |