ComfyTV/Videogenerated
Video Crop(VideoCropStage)
Video Crop (class VideoCropStage, category ComfyTV/Video) is a ComfyTV video-processing stage that crops a COMFYTV_VIDEO to the rectangular region defined by x, y, w, and h.
Video Crop Stage
video
video
x
0
y
0
w
0
h
0
ComfyTV
Description
Video Crop (class VideoCropStage, category ComfyTV/Video) is a ComfyTV video-processing stage that crops a COMFYTV_VIDEO to the rectangular region defined by x, y, w, and h. Use it to remove unwanted borders or isolate part of a video before passing the result to downstream video nodes.
Inputs
Required Inputs
| Input | Type | Default | Range | Description |
|---|---|---|---|---|
x | INT | 0 | 0 to 8192 | Horizontal offset, in pixels, from the left edge of the source frame to the left edge of the crop rectangle. |
y | INT | 0 | 0 to 8192 | Vertical offset, in pixels, from the top edge of the source frame to the top edge of the crop rectangle. |
w | INT | 0 | 0 to 8192 | Width, in pixels, of the crop rectangle. |
h | INT | 0 | 0 to 8192 | Height, in pixels, of the crop rectangle. |
Optional Input
| Input | Type | Description |
|---|---|---|
video | COMFYTV_VIDEO | The source video to crop. This socket is optional in the node definition. In a typical workflow, connect an upstream ComfyTV video node or preceding video stage here. |
Outputs
| Output | Type | Description |
|---|---|---|
| video | COMFYTV_VIDEO | The cropped video, using the same ComfyTV video type so it can be connected to downstream video nodes and stages. |
Usage Notes
- The crop origin is controlled by
xandy. The default values of0place the origin at the top-left corner of the source video. - Set
wandhexplicitly to the crop dimensions you want. They also default to0, so they should not normally be left unchanged when building a crop. - Coordinates and dimensions are expressed in pixels. Although the widgets allow values up to
8192, the requested crop should still fit within the actual dimensions of the input video. - The same crop parameters are applied to the video as it passes through this stage, producing a
COMFYTV_VIDEOoutput for further processing.
Comments
Sign in with GitHub to join the discussion.