π Resize Video Frames
Resize every video frame in one pass β stretch, crop, or pad to a target resolution
- images
- IMAGE
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, orpad.stretchforces every frame to exactlytarget_widthΓtarget_height, distorting the aspect ratio. Never use it on anything with people in it.cropscales to fill, then cuts the overflow - with crop_position (center,top,bottom,left,right) deciding which part survives.padscales 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
cropmode;padalways 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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | β | |
| target_width | INT | 51264β4096 | β |
| target_height | INT | 51264β4096 | β |
| mode | COMBO | 3 options: stretch, crop, pad | |
| crop_position | COMBO | 5 options: center, top, bottom, left, right |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | β |