Image Queue (lab)
Batch-process a whole folder of images, one at a time
- index
- image
- filename
- full_path
- relative_path
- subfolder
- index
- total
Image Queue (lab) is the node that turns "I want to run this img2img / upscale / reface workflow on every image in this folder" from a manual slog into a single queue run. It scans a folder, loads each matching image, and hands it to your pipeline one at a time - with the filename, full path, relative path, and subfolder all available alongside, so downstream nodes can name their outputs to match.
It's the image-flavored version of File Queue (lab) (it literally subclasses it) - same scanning behavior, plus it opens the image for you via PIL and converts it to a ComfyUI tensor. If the next node in your graph wants an IMAGE, you want this one over FileQueue.
How it works
Scans once at the start (not per iteration) using glob - comma-separated patterns allowed, symlinks followed, duplicates removed, current folder sorted first. Each iteration loads the next image and hands it over, auto-queuing until the batch is done. Same self-managing loop as every queue in this pack: leave ComfyUI's queue size at 1 and let the node drive.
Inputs:
- folder - where the images live.
- pattern - default
*.png, *.jpg. Comma-separate for more:*.png, *.jpg, *.webp. - recursive - default
true. - with_extension - default
true; off strips extensions from thefilenameoutput.
Outputs:
- image - the loaded image tensor, ready to feed your img2img/upscale/controlnet chain.
- filename / full_path / relative_path / subfolder - the same path quartet as FileQueue, perfect for building matching output filenames.
- index / total - 1-based progress.
Optional index (QUEUE_STATUS) input for chaining, as with the other queues.
Where it shines
- Batch img2img or re-rolls - same seed and prompt across a folder, one queue run.
- Folder-scale upscaling - feed each image into an upscale pipeline and save with a filename that mirrors the source.
- Captioning - the image goes to a vision model, the filename goes to a text saver, they stay in lockstep.
Watch the KB's upscaling material before you do a big batch of those - there are sharp edges (e.g. pre-downscaling soft sources, and running a separate face pass) that a batch run will faithfully apply to every image, mistakes included.
Install
ComfyLab Pack installs as one package (nodes carry a "(lab)" suffix). ComfyUI Manager: search ComfyLab Pack, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/bugltd/ComfyLab-Pack.git
cd ComfyLab-Pack
pip install -r requirements.txt
Restart after. No model files; requirements are light (opencv-python, pyyaml, jsonschema and a few small ones).
Gotchas
- "No file found" errors loudly - nothing matched the pattern, or the folder's empty. Check your pattern and folder path on the machine actually running ComfyUI.
- One corrupt image kills the run. PIL failing to open a truncated
.jpgstops the batch mid-way. It's the classic overnight-run failure: pre-check your folder or expect to resume after fixing the bad file. The queue resets cleanly, so the next run just starts over. - Scan is once, at index 0 - files added mid-run won't appear.
patternis a glob, not a regex.*.png, *.jpgworks; fancy character classes won't.
Set the folder, set the pattern, run it, and go do something else. That's the whole appeal - and it's why this node quietly makes it into every folder-batch workflow people build with this pack.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| folder | STRING | folder to scan | |
| pattern | STRING | *.png, *.jpg | file pattern(s) to match, e.g. '*.jpg' or 'prefix*'. multiple patterns can be defined, separated by a comma |
| recursive | BOOLEAN | true | scan recursively? |
| with_extension | BOOLEAN | true | keep or remove file extension |
| indexopt | QUEUE_STATUS | current queue status |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | image |
| filename | STRING | filename |
| full_path | STRING | full path |
| relative_path | STRING | relative path |
| subfolder | STRING | subfolder (relative) |
| index | INT | current index |
| total | INT | total files |