Image Batcher
Split an image batch to disk in chunks, optionally as WebP
- images
- images
- image_count
- batch_count
- debug_info
You've generated a big pile of images - a batch of 200, a whole animation's worth of frames, an overnight run - and now you want them written to disk in an organized way, chunked into groups instead of dumped as one giant heap. That's what Image Batcher does. It takes an IMAGE batch coming through your graph, saves it out to a folder in batches of the size you pick, and passes the images through so the rest of your workflow keeps going.
The WebP support is the reason a lot of people keep it around. A folder of hundreds of PNGs is heavy; the same images as WebP are a fraction of the size, and this node writes them directly with quality and lossless controls. If you're archiving big runs or shipping frames somewhere, that size difference adds up fast.
How it works
An IMAGE input in ComfyUI is a batch - one image or a thousand, same tensor shape. Image Batcher iterates over that batch and writes the frames to output_dir, grouping them into sub-batches of batch_size. Turn on WebP and it encodes to WebP instead of the default; the quality and lossless flags control the tradeoff. Meanwhile the original images pass straight through the node unchanged, so you can drop it inline without breaking the chain, and it also reports back counts and a debug string so you can confirm what it actually did.
The inputs and outputs that matter
images- the batch to save. The whole point.batch_size(default 1) - how many images go in each group. This is the "batcher" part: at 10, a run of 100 images gets split into ten groups of ten.output_dir(defaultbatch_output) - where the files land.use_webp(default off) - switch from the default format to WebP. Flip this on and the next two knobs come alive.webp_lossless(default off) - lossless WebP (bigger files, no quality loss) versus lossy.webp_quality(1β100, default 80) - the lossy WebP quality. 80 is a sane default; push it up for archival, down to shrink further.clear_dir(default off) - wipes the output directory before writing. Convenient for repeatable runs, and a foot-gun if you point it at the wrong folder (see below).
Outputs: images (IMAGE) is the passthrough - wire it onward as if the node weren't there. image_count, batch_count, and debug_info are STRING readouts telling you how many images it handled, how many groups it made, and what happened - route debug_info into a display node when you want confirmation.
How to install it
- ComfyUI Manager - search ComfyUI-kewky_tools, install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/KewkLW/ComfyUI-kewky_tools.git, then restart.
No model downloads, no heavy dependencies - it installs and loads instantly.
Common issues & troubleshooting
clear_dir ate my files. This is the one to respect. clear_dir wipes the output directory before writing, so if you point output_dir at a folder that already holds work you care about and leave clear_dir on, it's gone. Keep it off unless you specifically want a fresh directory each run, and always sanity-check the path.
The WebP settings do nothing. webp_lossless and webp_quality only matter when use_webp is on. If you're still getting the default format, you left use_webp off.
It's not combining images into one batch tensor. Worth clearing up, because the name invites confusion: this saves an image batch to disk in chunks, it doesn't merge separate images into a single ComfyUI batch. If what you actually want is to concatenate images into one batch for a sampler or a video node, that's a different node (the various "batch images" / "make image batch" nodes) - this one is about writing to disk.
Nothing wrote out. Check output_dir resolves to a real, writable path. Relative paths land relative to ComfyUI's working directory, which isn't always where you assume - use a path you can actually go find afterward.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| batch_size | INT | 11β9001 | β |
| output_dir | STRING | batch_output | β |
| use_webp | BOOLEAN | false | β |
| webp_lossless | BOOLEAN | false | β |
| webp_quality | INT | 801β100 | β |
| clear_dir | BOOLEAN | false | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | β |
| image_count | STRING | β |
| batch_count | STRING | β |
| debug_info | STRING | β |