ComfyUI Node
π§ Get Video Crop Frames
Crops every frame to a single common size derived from the largest bbox or mask area so the result is a valid uniform image batch. Records each frame's true bbox for precise restoration.
π§ Get Video Crop Frames
- frames
- bboxes
- masks
- restore_info
- cropped_frames
- cropped_masks
βsquaretrueβΊ
βpadding0βΊ
βmultiple_of16βΊ
βhorizontal_offset0.0βΊ
βvertical_offset0.0βΊ
βpad_modeβΎβΊ
βpad_color0,0,0βΊ
CategorySuperNodes/Video
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| frames | IMAGE | The source frame batch [B,H,W,C]. | |
| square | BOOLEAN | true | If true, pad the common crop size to a square (max of width/height). |
| padding | INT | 00β4096 | Grow each bbox/mask by this many pixels on all sides (clamped to the frame). Useful to leave room to feather outside the detection. |
| multiple_of | INT | 161β512 | Round the output crop width/height up to a multiple of this value. |
| horizontal_offset | FLOAT | 0.0-5β5 | Anchor the bbox/mask horizontally within the crop margin. 0 = centered, -5 = flush left, +5 = flush right. |
| vertical_offset | FLOAT | 0.0-5β5 | Anchor the bbox/mask vertically within the crop margin. 0 = centered, +5 = flush top, -5 = flush bottom. |
| pad_mode | COMBO | How to fill regions outside the frame when the crop window overflows. | |
| pad_color | STRING | 0,0,0 | Fill color as 'R,G,B' (0-255) used when pad_mode is 'color'. |
| bboxesopt | BBOX | Per-frame bounding boxes [x1,y1,x2,y2]. If a bbox is invalid or empty, the corresponding frame will be black. | |
| masksopt | MASK | Per-frame masks [B,H,W] defining regions of interest. If provided, masks are preferred over bboxes. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| restore_info | BBOX_RESTORE_INFO | Per-frame crop metadata required by Restore Video Crop Frames. |
| cropped_frames | IMAGE | Uniform-size cropped frame batch. |
| cropped_masks | MASK | Uniform-size cropped mask batch. |