Nodes/comfyui-rtx4090-nodes/Batch Image Processor πŸš€
ComfyUI Node

Batch Image Processor πŸš€

Batch Image Processor Is a Convenience Wrapper, Not a Speed Miracle

By JosephOIbrahimΒ·Created 7 months agoΒ·Updated 7 months agoΒ· 4
Batch Image Processor πŸš€
  • images
  • images
  • count
β—„batch_size4β–Ί
β—„operationβ–Ύβ–Ί
β—„parallel_workers4β–Ί
β—„width1024β–Ί
β—„height1024β–Ί
β—„angle0.00β–Ί

Batch Image Processor takes an IMAGE tensor (which in ComfyUI is usually a stack of multiple frames - a latent batch decoded, a video, a grid of inputs) and runs one operation across all of them, then hands you the batch back with a count. If you've ever wanted to resize, center-crop or flip a whole batch of frames in one go without building a per-frame loop, this is the node that does it in a single step.

The honest framing up front: this is a convenience wrapper, not a performance unlock. Everything here is stuff core ComfyUI can already do - ImageResize, ImageCrop, ImageFlip, ImageRotate all exist in the default node set. What this adds is doing it to the whole batch in one pass, plus a count output and the pretense of parallelism.

How it works

The source moves your images to CUDA, slices them into batches of batch_size, and submits each batch to a ThreadPoolExecutor with parallel_workers threads, then concatenates the results. That threading is the one part I'd call theatrical: CUDA tensor ops are already serialized on the GPU, so four Python threads don't give you four parallel GPU jobs. It's harmless, but don't expect the "parallel processing using RTX 4090" the README promises. Where it does help is the CPU fallback path.

The operations themselves:

  • resize - bicubic interpolation to width x height (defaults 1024x1024)
  • crop - center crop to width x height
  • rotate - rotate by angle degrees (default 0), via torchvision
  • flip - horizontal flip
  • enhance - a contrast/saturation boost, (x - mean) * 1.2 + mean

That last one deserves a flag: despite the "AI-based enhancement using RTX 4090" comment in the code, enhance is a couple of lines of arithmetic. No neural network, no upscaling model. If you want real AI enhancement, that's what a hires-fix pass or an upscaler model is for.

The inputs that actually matter

  • images - the batch to process (required).
  • operation - the dropdown that picks resize / crop / rotate / flip / enhance. This is the thing you'll change most.
  • width / height - only used by resize and crop (64–8192, default 1024).
  • angle - only used by rotate (-360 to 360).
  • batch_size and parallel_workers - chunking and threading knobs. Defaults of 4 and 4 are fine; these are tuning knobs, not set-and-forget.

Two outputs: images (the processed batch, same IMAGE type, so it wires straight into a VAE decode or a preview node) and count (an INT - how many images came out, which is handy if you're doing conditional logic downstream).

Where people get burned

The crop is a center crop to whatever width/height you set, and there's no clamping. Ask for a 2048x2048 crop out of a 1024x1024 image and you're slicing with negative indices - the node errors or returns garbage. Rule of thumb: keep crop dimensions at or below your source resolution. That's the one real trap in an otherwise uncomplicated node.

Installing it

Part of the comfyui-rtx4090-nodes pack, so it's the standard two-step:

cd ComfyUI/custom_nodes
git clone https://github.com/joe002/comfyui-rtx4090-nodes.git

Restart ComfyUI, or use Manager and search "comfyui-rtx4090-nodes." The rotate path needs torchvision, which ships with ComfyUI anyway, so there's nothing extra to install - just torch and psutil in the pack's own dependencies, no models.

Worth reaching for when you're processing batches of frames and don't want five separate per-image nodes cluttering the graph. Just know it's a convenience, not a speedup - and skip enhance if you were expecting magic.

CategoryRTX4090/batch

Inputs (7)

NameTypeDefaultDescription
imagesIMAGEβ€”
batch_sizeINT41–16β€”
operationCOMBO5 options: resize, crop, rotate, flip, enhance
parallel_workersINT41–8β€”
widthoptINT102464–8192β€”
heightoptINT102464–8192β€”
angleoptFLOAT0.00-360–360β€”

Outputs (2)

NameTypeDescription
imagesIMAGEβ€”
countINTβ€”