Video Crop Upload (Purz)
Crop or reframe a whole video without ever opening a video editor
- video
Video diffusion models are picky about aspect ratio and resolution - feed Wan or LTX a 1920×1080 clip when the model wants 1024×1024 and you'll fight the pipeline the whole way down. PurzVideoCropUpload is the "fit this video to those dimensions" node: upload a clip, pick a target size and a fit mode, and it hands you back a VIDEO at exactly that resolution, audio intact. No ffmpeg, no leaving ComfyUI.
It's one of the two crop flavors in purzbeats' ComfyUI-Purz pack. The Upload suffix means your source file goes into ComfyUI's input/ directory and persists across browser reloads - reload the page and the video, the crop settings, everything is still there. (The plain Video Crop node does the same job client-side, source never touching the server, but loses state on refresh.)
How it works
On queue, the backend reads the source from input/ and resizes it frame by frame with OpenCV - INTER_AREA when scaling down, INTER_LANCZOS4 when scaling up, roughly 10× faster than the old per-frame PIL path. The fit modes are the classic four:
- stretch - squish the source to fill the target, aspect ratio be damned.
- cover - scale to fill, then crop the overflow using the
anchor(center, top, bottom, left, right, corners). - contain - scale to fit inside, letterboxing the leftover with
background_color. - crop - like cover, plus manual
zoomandoffset_x/offset_yso you can punch in and reposition by hand.
Audio passes through. The output is a ComfyUI VIDEO, so it plugs straight into a video preview node or anything downstream that eats the VIDEO type.
The inputs that matter
- video - a dropdown of video files in
input/; upload one via the node's button. It'll read(no video)until you do. - width / height - 16–16384, default 1024. The target canvas.
- fit_mode - stretch / cover / contain / crop.
coveris the sane default. - anchor - where the crop window sits when you're cropping;
centeris right most of the time. - background_color - the letterbox color for
contain. - zoom / offset_x / offset_y - only active in
cropmode; offsets are normalized −1…1.
Output is a single video (VIDEO).
Install
Standard for this pack:
cd ComfyUI/custom_nodes
git clone https://github.com/purzbeats/ComfyUI-Purz.git
cd ComfyUI-Purz
pip install -r requirements.txt
then restart ComfyUI (or install "ComfyUI-Purz" from ComfyUI Manager). Requirements are OpenCV, Pillow, NumPy, and torch - no models to download.
Where people get burned
- It needs a modern ComfyUI. The node outputs the
VIDEOtype, which depends on the newercomfy_apivideo support. On an old install the node still loads but hands back a tiny 64×64 black fallback frame and prints diagnostic lines in the console. Update ComfyUI first. - This is a re-encode, not a passthrough. It's fast, but the clip is resized frame-by-frame and muxed back; don't expect a byte-identical stream.
- Big targets get slow and hungry. The max is 16384 on a side - nobody actually wants that. 1024–2048 is where this node stays comfortable.
- Pick the right flavor for the job. If you need persistence across reloads and don't mind the source sitting in
input/, use this one. If you'd rather the source never leave your browser, use the client-side Video Crop node instead.
If you're normalizing source footage before a video pass, cover + center at the model's native size is the setup you'll use 90% of the time.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| video | COMBO | (no video) | 1 options: (no video) |
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
| fit_mode | COMBO | cover | 4 options: stretch, cover, contain, crop |
| anchor | COMBO | center | 9 options: center, top, bottom, left, right, top-left, +3 |
| background_color | STRING | #000000 | — |
| zoom | FLOAT | 1.000.1–10 | — |
| offset_x | FLOAT | 0.00-1–1 | — |
| offset_y | FLOAT | 0.00-1–1 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| video | VIDEO | — |