Batch Loader from folder
Stop dragging images in one at a time
- images
- filename
- format
- width
- height
ComfyUI's built-in image loader is a one-at-a-time affair, and the moment you want to run a folder of images through the same workflow - testing prompts, comparing models, processing a dataset - you're either scripting uploads or losing your mind. Batch Loader from folder points at a directory and hands you the whole thing as a proper ComfyUI IMAGE batch. It's from AntiMatter Nodes, and it's the kind of node you install for one specific day and then can't imagine being without.
How it works
You give it a folder and it scans for PNG, JPG/JPEG, WEBP, BMP, and TIFF/TIF files (nested folders if you flip recursive on). Relative paths resolve from ComfyUI's working directory, so .uploading works. Each image gets EXIF orientation fixed, gets flattened to RGB (RGBA becomes RGB), and the batch is assembled into one tensor.
The selection logic is where it earns its keep:
mode: random- seeded and deterministic, so the sameseedgives the same picks. Turn onno_repeat_random(it's on by default) and it draws without replacement, refilling the pool once every eligible file has been used - no accidental repeats during a long run.mode: sequential- walks the folder in sorted order.mode: batch_freeze- this one's the hidden gem. It picks one image and repeats it across the whole batch forfreeze_countqueue runs. That's your A/B testing tool: freeze one image, then vary the seed, prompt, model, LoRA, or sampler and compare apples to apples.
There's more, all grounded in the source rather than marketing: skip_exact_mode filters out images by exact width/height (handy for skipping already-resized files), move_processed_to_subfolder shunts selected files into a _processed folder after loading so long runs don't reprocess, and resize_to_first (on by default) rescales later images to match the first - a mixed-size folder is not a valid ComfyUI batch otherwise. reload rescans the folder, reset clears the sequence/random state, and show_preview pops thumbnails in the UI.
Inputs that actually matter
For most people it's just four knobs: folder, mode, batch_size, and seed. freeze_count joins them the day you start doing comparison runs. The rest is situational.
Outputs
images- the batch, straight into your VAE encode or sampler.filename- basename without extension (or a comma-separated list for mixed batches). Wire it into output filenames or captions.format- the source extension, useful for branching logic.width/height- dimensions, for routing by size.
Installing it
Clone the pack once:
cd ComfyUI/custom_nodes
git clone https://github.com/AntiMatterComfy/antimatter-nodes.git
Restart ComfyUI. It has no extra Python dependencies beyond what ComfyUI itself already ships (torch, numpy, Pillow), and no model files to download.
Where people get burned
The node deliberately raises errors instead of guessing, and the messages tell you exactly what to fix: no images in the folder, everything filtered out by skip rules, batch_size larger than the remaining pool while moving files, or a size mismatch when resize_to_first is off. If you turn resize_to_first off with mixed-size images, expect a hard stop - that's the one I'd keep on unless you have a reason. And remember it forces re-execution on every queue run (its IS_CHANGED returns infinity), so it won't quietly skip a step when your values look unchanged.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | .uploading | — |
| mode | COMBO | random | 3 options: random, sequential, batch_freeze |
| batch_size | INT | 11–64 | — |
| freeze_count | INT | 11–999 | — |
| seed | INT | 00–2147483647 | — |
| no_repeat_random | BOOLEAN | true | — |
| recursive | BOOLEAN | false | — |
| reload | BOOLEAN | false | — |
| reset | BOOLEAN | false | — |
| skip_exact_mode | COMBO | disabled | 5 options: disabled, width or height, width and height, width only, height only |
| skip_exact_width | INT | 00–65535 | — |
| skip_exact_height | INT | 00–65535 | — |
| move_processed_to_subfolder | BOOLEAN | false | — |
| processed_subfolder_name | STRING | _processed | — |
| resize_to_first | BOOLEAN | true | — |
| show_preview | BOOLEAN | true | — |
| preview_max | INT | 41–12 | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| filename | STRING | — |
| format | STRING | — |
| width | INT | — |
| height | INT | — |