FolderBatch Load Image
A Load Image that takes a path wire, not a file picker — and hands you a mask for free
- image
- mask
Every ComfyUI user knows the core Load Image node: you click, you pick, you're stuck doing it again for the next file. FolderBatch Load Image is the version that doesn't care what you clicked - it takes an image_path wire instead of a file-picker, and returns an IMAGE plus an alpha-derived MASK at no extra charge. Feed it from FolderBatch Image Queue and you've got a hands-free loop through a whole folder; feed it from any other node that emits a path string and you've got a loader you can drive programmatically.
Mechanically it's close to what core does under the hood, with one nice extra. The node opens the file with Pillow, transposes EXIF orientation so camera shots come in right-side up, converts to RGB, and normalizes to a float tensor in 0..1. Then it checks for an alpha channel: if the image has transparency it builds a mask as 1 - alpha - white where the image is transparent - which is exactly the shape inpainting and compositing nodes want. PNGs with a "transparency" entry in palette mode get the same treatment. No alpha? You get an empty 64x64 black mask rather than an error, which is the polite way to not break a graph that assumes a mask always exists.
The single input, image_path, is a STRING marked forceInput, so it's really meant to be wired rather than typed - though you can type a path if you want. Two outputs: image (the IMAGE batch) and mask (the MASK). Multi-frame images like animated PNGs come back as a batch, one entry per frame, which is more than most loaders give you.
Why reach for it: the obvious pairing is batch work. Connect the queue's image_path here, drop the image into your processing chain, and you can run 200 images through an upscaler, an inpaint, a character consistency pass, whatever, without touching the UI between runs. The same image_path can also come from FolderBatch Sync Queue, which is the setup when each image needs its own matching prompt or audio - the loader doesn't care where the path came from.
The gotcha worth knowing: this node returns raw paths, so folder inputs elsewhere and this node's path must match filesystem reality - a relative path that resolves differently on another machine is the classic "worked on my box" failure. And if you're processing a stack of files, remember the queue caches its file list; the loader itself has no such state, it just reads whatever path you hand it every run.
Install is the whole-pack story: ComfyUI Manager, search "ComfyUI-FolderBatch", restart. No extra pip packages, no model downloads - Pillow and torch are already in ComfyUI. It's a small node with a small job, and once you've batched one folder through it you'll wonder why core's loader still makes you click.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image_path | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| mask | MASK | — |