Nodes/ComfyUI Multimedia Utilities/πŸ“ Resize Video Frames
ComfyUI Node

πŸ“ Resize Video Frames

Resize every video frame in one pass β€” stretch, crop, or pad to a target resolution

By thimpatΒ·Created about a year agoΒ·Updated about a year agoΒ· 0
πŸ“ Resize Video Frames
  • images
  • IMAGE
β—„target_width512β–Ί
β—„target_height512β–Ί
β—„modeβ–Ύβ–Ί
β—„crop_positionβ–Ύβ–Ί

A video in ComfyUI is just a big batch of IMAGE tensors - one frame each, shape (B, H, W, C). And when a model or a VAE downstream demands a specific resolution, or when your clips are mismatched and need to line up, you need every one of those frames resized identically. That's the whole job of ResizeVideoFrames, and it's the reason this pack exists: a boring, deterministic resize loop that won't surprise you.

It does the work in OpenCV. The node takes your float [0, 1] tensor, flips it to uint8, swaps RGB to BGR for OpenCV, resizes every frame in the batch, and hands the result back as a normal IMAGE - float32, values 0–1, same batch order you fed in. That last bit matters more than it sounds: a lot of video workflows break because a resize node silently reorders or drops frames. This one iterates in order and returns the same count it got.

The inputs that actually matter

  • mode - the one you'll think about: stretch, crop, or pad.
    • stretch forces every frame to exactly target_width Γ— target_height, distorting the aspect ratio. Never use it on anything with people in it.
    • crop scales to fill, then cuts the overflow - with crop_position (center, top, bottom, left, right) deciding which part survives.
    • pad scales to fit and letterboxes the rest with black. The choice when you can't lose pixels but the target must be exact.
  • target_width / target_height - the resolution gate. Clamped 64–4096, defaults to 512.
  • crop_position only does anything in crop mode; pad always centers.

There's a single IMAGE output, ready to feed a VAE, a model, a save node, or whatever needs uniform frames next.

Where people get burned

The README lies a little, and the install step will fail. It tells you to pip install -r requirements.txt, but this repo ships no requirements.txt. The real non-core dependencies are opencv-python and soundfile, and because the pack imports every module at startup, a missing cv2 takes down all six of its nodes at once, not just this one. The fix is boring:

cd ComfyUI/custom_nodes
git clone https://github.com/thimpat/ThimPatUtils.git
# or install via ComfyUI Manager, searching "Multimedia Utilities"
cd ComfyUI/custom_nodes/ThimPatUtils
python -m pip install opencv-python soundfile

Then restart ComfyUI.

Also worth knowing: this is a resize, not an upscaler. It always uses OpenCV's INTER_AREA interpolation, which is the right call for shrinking but visibly soft when you go bigger. If you're actually upscaling, this gets you to a working resolution and then you let a real upscaler or a second-pass img2img add the detail back - the community splits interpolation and generative upscaling into separate tools for exactly that reason.

And one quirk: stretch with a wild aspect mismatch looks immediately broken, and pad's black bars will show up in whatever you render next. If you need a specific model resolution (say a VAE that wants exact multiples), crop or pad to a compatible size rather than forcing stretch.

One honest caveat about the pack itself: it's a small single-author utility repo - near-zero community footprint, thin docs. The code is short and readable, so when something behaves oddly, open resize_video_frames.py in the pack folder and read what it does. That's the real documentation.

Category🎨 ThimPatUtils

Inputs (5)

NameTypeDefaultDescription
imagesIMAGEβ€”
target_widthINT51264–4096β€”
target_heightINT51264–4096β€”
modeCOMBO3 options: stretch, crop, pad
crop_positionCOMBO5 options: center, top, bottom, left, right

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”