📂 Folder Image Loader
Point it at a folder of images and let ComfyUI process them one at a time
- image
- mask
- filename
- txt
Batch processing in ComfyUI has always been slightly awkward. Core's Load Image takes one file at a time, so running a folder of 200 images through a pipeline means either a "Load Image Batch" node that stacks everything into one giant tensor - or manual labor. The batch-stack approach has a gotcha: if your images have different resolutions, everything gets padded to the biggest and your pipeline suddenly has black bars everywhere.
📂 Folder Image Loader takes a different route. It outputs its images as a list (OUTPUT_IS_LIST is on), and ComfyUI's execution engine then feeds each image into the downstream graph individually, at its own native resolution. No padding, no manual loop, no resolution mismatch. It's the "just process this folder" node.
What comes out
Four outputs, all lists, in lockstep:
image- each image in the folder, in filename order, one per execution.mask- the image's own alpha as a mask (or a full-white mask if there's no alpha). Handy for composition pipelines.filename- the base filename. This is the wire that makes this pack's Batch Image Saver shine: connectfilenameto the saver's原文件名and every result comes out under its source name.txt- the content of a same-named.txtor.jsonfile sitting next to the image (JSON wins if both exist). So if your folder hascar_01.pngandcar_01.json, this output hands you the JSON content alongside the image. That's the load-half of the pack's save-half: the Batch Image Saver writes those sidecars, this node reads them back.
There's also a frontend nicety: the node draws a thumbnail grid of the folder's contents on the canvas, and there's a native folder-picker button (via the pack's api.py, it pops a real system dialog on Windows/macOS) instead of hand-typing a path. It only takes folder_path as input - that's it.
How it decides what's changed
The node hashes filenames plus modification times on every run, so adding a file to the folder, deleting one, or editing one marks the batch dirty and it re-executes. That's the right behavior for a loader - you want it to pick up new files without restarting ComfyUI.
Installing it
Comes with the Louis Use pack:
cd ComfyUI/custom_nodes
git clone https://github.com/LouisLU1997/ComfyUI-louis-use Louis_use
Or "Louis Use" in ComfyUI Manager, then restart. Core-only dependencies - no model downloads, nothing to configure.
Where people get burned
- Empty folder = hard error. The node raises a ValueError ("文件夹中没有找到支持格式的图片") if nothing matches, and a RuntimeError if every file fails to decode. Corrupted files are logged and skipped, but a totally unreadable folder stops the run.
- The folder path is not relative to ComfyUI's input folder. It's whatever absolute or relative path you type, or pick with the dialog. Relative paths resolve against where ComfyUI runs, so if your batch keeps coming up empty, check where the process actually lives.
- List outputs change how downstream nodes behave. Some nodes don't accept list inputs. If a node downstream errors with a type mismatch, that's usually why - you're in list-land now, and not every custom node was built for it.
For a folder of images at mixed resolutions with matching sidecar prompts, this is genuinely the smoothest path in ComfyUI. Load, process, save with original names - no scripts needed.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| folder_path | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |
| filename | STRING | — |
| txt | STRING | — |