Nodes/ComfyCollectorNodes/Resize To Match (CCN)
ComfyUI Node

Resize To Match (CCN)

Shoehorn any image to the exact size of a reference

By valkymaera·Created 4 months ago·Updated 10 days ago· 1
Resize To Match (CCN)
  • images
  • reference
  • images
interpolationbilinear

Sometimes you don't want a size you pick - you want a size some other image already is. Resize To Match (CCN) takes an images input and resizes it to the exact pixel dimensions of a reference image. That's the whole trick, and it's quietly one of the most useful pairing tools in the pack.

The canonical case is blending an upscaled video with its original. You upscale a video, then want to composite or blend the result back against the original frames - but they're different sizes now. Resize one to match the other and the blend becomes trivial. Same story for img2img: your source needs to be the same resolution as the latent you're working in, and a reference image is the most reliable way to express that.

How it works

  • images - what gets resized.
  • reference - the IMAGE whose height/width becomes the target.
  • interpolation - bilinear (default), bicubic, nearest, area.

It grabs the reference's H×W and resizes the input batch to exactly those dimensions. Like its sibling, it handles uint8 → float32 and single-image shapes gracefully, and area interpolation falls back to bilinear when you're upscaling. Output is a single images tensor at the reference's size.

Install

Part of ComfyCollectorNodes, one install:

cd ComfyUI/custom_nodes
git clone https://github.com/valkymaera/ComfyCollectorNodes

then restart, or install via ComfyUI Manager ("ComfyCollectorNodes"). No models, no extra dependencies.

Where people get burned

The 8-multiple gotcha is real but it's your reference's fault, not the node's: if your reference isn't a multiple of 8, the matched output won't be either, and VAE/latent workflows prefer sizes they can tile cleanly. Pick references with friendly dimensions or pair this with a pad/crop if you hit odd sizes. Also note it takes the first frame's size from the reference batch - if your reference is a batch of varying-size frames, that's on your data. And it prints its own debug line to the console each run, so don't panic at the [CCN ResizeToMatch] noise.

CategoryComfyCollectorNodes/Image

Inputs (3)

NameTypeDefaultDescription
imagesIMAGE
referenceIMAGE
interpolationCOMBObilinear4 options: bilinear, bicubic, nearest, area

Outputs (1)

NameTypeDescription
imagesIMAGE