Nodes/ComfyUI S4Motion/đź’€Video Crop
ComfyUI Node

đź’€Video Crop

Crop a whole clip, not just one frame

By S4MUEL-404·Created about a year ago·Updated 11 months ago· 4
đź’€Video Crop
  • video
  • image
  • Frame sequence
â—„crop_x0â–ş
â—„crop_y0â–ş
â—„crop_width512â–ş
â—„crop_height512â–ş
â—„background_typetransparentâ–ş
â—„background_color#000000â–ş

Most ComfyUI crop nodes assume you're cropping one image. đź’€Video Crop does the same thing to every frame of a clip, which is exactly what you want when a video model needs a specific aspect ratio and your footage has letterbox bars or a subject sitting off-center. It's from the S4Motion pack, and it's the "reframe the whole thing" tool.

It accepts either a video (VIDEO object) or an image (IMAGE sequence) and outputs Frame sequence - every frame cropped the same way, as a batch.

The inputs are few and self-explanatory:

  • crop_x / crop_y - the top-left corner of the crop box.
  • crop_width / crop_height - the size of the box. Default 512x512, range 1–8192.
  • background_type - transparent (default) or solid_color. This is for what happens where the crop box pokes past the edge of the frame, which you'll do constantly when reframing to an unusual ratio.
  • background_color - the hex fill for solid_color, #000000 default.

So the workflow is: work out the box (maybe use đź’€Video Info to check your source dimensions first), set the crop, and if your box extends off the edge, pick transparent to keep alpha or solid_color to fill it. Transparent is nice if you're stacking the result on a background later in the graph.

Under the hood it's the same pattern as the rest of the video nodes: VIDEO input is decoded through OpenCV frame by frame, IMAGE input is handled with Pillow, and each frame gets the identical crop. The background_type/background_color logic is shared with đź’€Video Frames, so behavior is consistent across both.

Install

ComfyUI Manager → search "S4Motion" → install → restart, or:

cd ComfyUI/custom_nodes/
git clone https://github.com/S4MUEL-404/ComfyUI-S4Motion.git
pip install -r ComfyUI-S4Motion/requirements.txt

Gotchas

  • OpenCV requirement again - connecting a VIDEO input without opencv-python installed throws "OpenCV is required for video processing but not available". Image sequences don't need it.
  • The crop is static across the whole clip. If you need the crop box to move over time, this isn't the node - the motion effectors (đź’€Motion Position etc.) handle movement, and the crop nodes don't animate. Keep them separate.
  • Coordinates are top-left origin, and out-of-bounds regions are handled by your background_type, not by clamping. Expect the edge fill to appear if your box overhangs.

There's essentially no discussion of this node anywhere - the whole pack is quiet on reddit - so treat the examples in the pack's examples/ folder (there's a Crop_Video.png and Crop_Webp.png there) as your best documentation. It's a small, boring utility node, and it does its one job without surprises once you remember the background fill setting.

Categoryđź’€S4Motion

Inputs (8)

NameTypeDefaultDescription
crop_xINT00–8192—
crop_yINT00–8192—
crop_widthINT5121–8192—
crop_heightINT5121–8192—
background_typeCOMBOtransparent2 options: transparent, solid_color
background_colorSTRING#000000—
videooptVIDEO—
imageoptIMAGE—

Outputs (1)

NameTypeDescription
Frame sequenceIMAGE—