Nodes/ComfyUI Batch Blend/Image Batch Blend
ComfyUI Node

Image Batch Blend

Blend whole image batches in one node — no more frame-by-frame for-loops

By starfieldscreensaver·Created 5 months ago·Updated 5 months ago· 2
Image Batch Blend
  • image_a
  • image_b
  • image
blend_modenormal
blend_percentage0.50

If you've ever tried to crossfade two videos in ComfyUI, you know the pain. Blend nodes like WAS Node Suite's Image Blend take a single image, so a video becomes a horror show of ImageFromBatch → per-frame blend → batch reassembly, sometimes with sleep nodes thrown in to keep the graph from executing out of order. This node collapses that entire subgraph into one box. It takes two IMAGE batches - a video is just a batch of frames - and blends them frame-by-frame with vectorized tensor math. No loops, no reassembly, no edge cases you have to babysit.

The author's own use case tells you exactly where it shines: run one video through two different upscalers, then blend their outputs frame-by-frame. Or blend an upscaled pass back against the original. That's a genuinely common move - a lot of "hires fix" and video-sharpening workflows want a partial blend rather than a full replacement - and until this pack you had to hand-roll it.

How it works

ComfyUI hands every node images as [B, H, W, C] tensors, where B is the batch (frame) count. ImageBatchBlend just runs the blend math across the whole tensor at once - that's the "no loops" promise, and it's why a 100-frame video blends instantly instead of grinding through one frame at a time.

Two behaviors matter if your inputs don't line up:

  • Different frame counts. The shorter batch is cycled - repeated/tiled - to match the longer one. Give it 100 frames against 30 and those 30 repeat about 3.3×.
  • Different resolutions. image_b is silently bilinearly resized to match image_a. So the resolution you get out is always image_a's.

blend_percentage is applied as a lerp (torch.lerp in the source): 0.0 gives you pure image_a, 1.0 gives the full blend result. In normal mode that's a classic crossfade - 0.5 is a straight 50/50 mix of the two batches. For modes like multiply or screen, the percentage fades between the original image_a and the blended result, which is a slightly different mental model. Handy either way.

The inputs that matter

Only four inputs, and a beginner sets two of them:

  • image_a / image_b - the two IMAGE batches. Either can be a single image or a full frame sequence; just feed them in.
  • blend_mode - 15 choices: normal, add, subtract, multiply, divide, screen, overlay, soft_light, hard_light, difference, exclusion, darken, lighten, color_dodge, color_burn. If you know Photoshop blend modes, you know these - they're the same formulas, clamped to [0, 1].
  • blend_percentage - FLOAT, 0 to 1, default 0.5.

The single output is image, the blended batch. Wire it straight into VHS_VideoCombine or the core Save Animated WEBP/Save Video and you're done.

Installing

Two ways, same result:

# Via ComfyUI Manager: search for "ComfyUI Batch Blend"
cd ComfyUI/custom_nodes
git clone https://github.com/starfieldscreensaver/comfyui-batch-blend

Restart ComfyUI. That's it - the pack declares zero dependencies and downloads no model files; it only needs the PyTorch ComfyUI already ships. As installs go, this is the pleasant kind.

Gotchas worth knowing

  • Resolution mismatch is silent. image_b gets resized to image_a's dims with no warning. Put the resolution you actually want on the output into image_a - feed a 2048×2048 into image_b against a 1024×1024 image_a and it gets downsampled before it ever blends.
  • Cycling ≠ padding. If your batches differ in length, the short one loops rather than holding its last frame. That's usually not what you want mid-crossfade - trim or slice both inputs to matching frame counts first.
  • Alpha isn't handled. IMAGE here is RGB; these modes do per-channel math and clamp. Don't expect proper compositing over transparency.

This is a small, MIT-licensed utility from a one-commit pack by a solo dev - announced once on r/comfyui with essentially zero discussion, so don't expect a roadmap. But it's ~200 lines of clean torch. If it doesn't do what you need, it's trivial to fork. For its one job - blending two frame batches without a for-loop graph - it just works.

Categoryimage/batch

Inputs (4)

NameTypeDefaultDescription
image_aIMAGE
image_bIMAGE
blend_modeCOMBOnormal15 options: normal, add, subtract, multiply, divide, screen, +9
blend_percentageFLOAT0.500–1

Outputs (1)

NameTypeDescription
imageIMAGE