Load Image Batch
Load one image at a time from a folder — without reconnecting wires
- image_batch
- count
The name slightly lies to you. Load Image Batch does not dump a whole folder of images into your graph as a batch. It loads one image from a directory, but it gives you three ways to decide which one - fixed index, incremental (advances every run), or seeded random. If you've ever wanted to feed a folder of reference shots into img2img or an image-to-text analysis pass without manually re-plugging the Load Image node every time, this is the node for it.
It sits in the ComfyUI Text Processor pack, which is otherwise mostly text plumbing. This node is the pack's answer to "I have 200 test images and I want to grind through them." ComfyUI's built-in Load Image only handles one file; this one points at a directory and a pattern.
How it works
You give it path (a directory) and pattern (a glob like *.png or frame_*.jpg). It lists matching image files, sorts them, and picks one based on mode:
single_image- uses theindexinput directly. Zero-based, so index 0 is the first file.incremental_image- remembers which file it last gave you and hands you the next one on each run, wrapping around at the end. Crucially, thelabelfield is a state key: two loaders with different labels keep independent positions, so you can walk two folders in sync.random- deterministic random selection fromseed. Same seed, same file, which keeps your runs reproducible.
The incremental counter lives in memory, so it resets when ComfyUI restarts. That's by design - it's a "continue where I left off" pointer, not persistent state.
One nice safety touch: the glob can't escape the folder you named. Traversal (..) and absolute patterns are rejected, and when ComfyUI's validation hooks are available the node checks that the folder exists, the pattern matches something, and the index is in range - before execution - instead of blowing up mid-run.
Inputs and outputs that matter
You'll actually touch four inputs: mode, path, pattern, and label (only in incremental mode). seed only matters in random mode. allow_RGBA_output keeps an alpha channel when the source has one; leave it false unless you genuinely need transparency. filename_text_extension decides whether the extension appears in the filename output.
Outputs are the useful part:
image(IMAGE) - wire straight into your sampler, img2img, or image analysis node.filename_text(STRING) - the selected file's name, handy for naming saves or feeding a text node. This is the sneaky-good feature: it lets you capture which image you processed into a filename or prompt.
Install
Install the pack once - all its nodes come with it:
cd ComfyUI/custom_nodes
git clone https://github.com/rookiestar28/ComfyUI_Text_Processor.git
pip install -r requirements.txt
Then restart ComfyUI. Or just search "ComfyUI Text Processor" in ComfyUI Manager and hit Install. The pack needs nothing heavy - simpleeval, requests, beautifulsoup4 - and no model downloads.
Gotchas
The common trap is expecting it to act like a real batch loader. It won't feed ten images into a batch-capable node at once; for that you want an actual folder-loader or Image Concat Advanced from the same pack. Also remember incremental state is per-label, and it dies with the process - if your files change on disk, it re-derives the list and may pick a different "next."
Where people get burned: empty folder = hard error on validation (good, but read the message), and a pattern like * will happily match every image type at once. Be specific with *.png if that matters.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| append | BOOLEAN | false | — |
| batch | COMBO | 1 options: None |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image_batch | image_batch | — |
| count | INT | — |