Matt Hanrahan 9b7d6cb398 Add files via upload
add example workflow
2026-04-10 21:42:09 -07:00
2026-04-10 21:42:09 -07:00

ComfyUI Batch Blend

A custom node for ComfyUI that blends two image batches frame-by-frame using fully vectorised tensor operations — no loops, no workarounds.

Existing blend nodes (including WAS Node Suite's Image Blend) operate on single images and break or produce incorrect results when given batches. This node handles batches natively.


Node: Image Batch Blend

Category: image/batch

Inputs

Name Type Description
image_a IMAGE First image or image batch
image_b IMAGE Second image or image batch
blend_mode COMBO Blend algorithm (see below)
blend_percentage FLOAT 0.0 = full image_a, 1.0 = full blend result

Output

Name Type Description
image IMAGE Blended image batch

Blend Modes

Mode Description
normal image_b replaces image_a (modulated by blend_percentage)
add Additive blend, clamped to [0, 1]
subtract Subtractive blend, clamped to [0, 1]
multiply Multiplies pixel values
divide Divides image_a by image_b
screen Inverse-multiply of inverted values
overlay Multiply for darks, screen for lights (based on image_a)
soft_light Gentle overlay using Pegtop formula
hard_light Strong overlay (based on image_b)
difference Absolute difference between pixels
exclusion Softer version of difference
darken Per-pixel minimum
lighten Per-pixel maximum
color_dodge Brightens image_a based on image_b
color_burn Darkens image_a based on image_b

Batch size mismatch

If the two batches have different frame counts, the shorter batch is cycled (tiled) to match the longer one.

Resolution mismatch

If the two batches have different spatial dimensions, image_b is bilinearly resized to match image_a automatically.


Installation

Search for ComfyUI Batch Blend in the Manager and install.

Manual

cd ComfyUI/custom_nodes
git clone https://github.com/starfieldscreensaver/comfyui-batch-blend

Restart ComfyUI. No extra dependencies required beyond what ComfyUI already ships with (PyTorch).


Why this exists

The standard approach to blending video frames in ComfyUI requires nested for-loops, ImageFromBatch nodes, sleep delays, and batch-reassembly nodes — a fragile multi-node subgraph just to apply a blend per frame. This node collapses that entire graph into a single node by operating directly on the [B, H, W, C] batch tensor.


License

MIT

S
Description
No description provided
Readme MIT
33 KiB
Languages
Python 100%