Image & Video

New ComfyUI node avoids hidden CPU resizing that freezes large blends

Safe Chunked Image Blend moves tensors to CUDA and processes them in chunks.

Deep Dive

A new open-source custom node for ComfyUI, called Safe Chunked Image Blend, tackles a common pain point in large-scale image and video processing: the silent, full-batch CPU resize that happens inside standard blend nodes when two inputs have different resolutions. That hidden operation can degrade tensors to CPU float32, bog down large batches (e.g., 5464×3800 frames), and even freeze WSL-based ComfyUI setups entirely. The node, created by Reddit user marres, makes the resize and blend behavior explicit, allowing users to control exactly where and how the computation occurs.

The node operates chunk by chunk: it moves one frame or batch to the chosen CUDA device, resizes mismatched inputs using a specified method (bilinear or bicubic), then blends and copies the result back to CPU float32. Key settings include compute_device (cuda, cpu, image1, or image2), resize_policy (error on mismatch, resize image2 to image1, or vice versa), and chunk_size for controlling memory usage. It also offers optional CUDA sync per chunk, detailed logging of shapes and devices, and an accompanying Image Pair Shape Probe helper node. Recommended starting settings for upscale or video workflows are resize_image2_to_image1 with bilinear interpolation and chunk_size=1.

Key Points
  • Prevents freezing by processing large tensors (e.g., 5464×3800) in chunks on CUDA instead of a single CPU resize.
  • Offers three resize policies: error on mismatch, or resize image2 to image1 (or vice versa) with bilinear/bicubic methods.
  • Includes detailed logging per chunk: shape, dtype, device, resize step, blend step, and output copy for debugging.

Why It Matters

Eliminates a hidden bottleneck that stalls large upscale and video workflows, enabling stable batch processing in ComfyUI.