Nodes/ComfyUI-SuperNodes/🐧 Get Video Crop Frames
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.

By sonnyboxΒ·Created 10 months agoΒ·Updated 26 days agoΒ· 7
🐧 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)

NameTypeDefaultDescription
framesIMAGEThe source frame batch [B,H,W,C].
squareBOOLEANtrueIf true, pad the common crop size to a square (max of width/height).
paddingINT00–4096Grow each bbox/mask by this many pixels on all sides (clamped to the frame). Useful to leave room to feather outside the detection.
multiple_ofINT161–512Round the output crop width/height up to a multiple of this value.
horizontal_offsetFLOAT0.0-5–5Anchor the bbox/mask horizontally within the crop margin. 0 = centered, -5 = flush left, +5 = flush right.
vertical_offsetFLOAT0.0-5–5Anchor the bbox/mask vertically within the crop margin. 0 = centered, +5 = flush top, -5 = flush bottom.
pad_modeCOMBOHow to fill regions outside the frame when the crop window overflows.
pad_colorSTRING0,0,0Fill color as 'R,G,B' (0-255) used when pad_mode is 'color'.
bboxesoptBBOXPer-frame bounding boxes [x1,y1,x2,y2]. If a bbox is invalid or empty, the corresponding frame will be black.
masksoptMASKPer-frame masks [B,H,W] defining regions of interest. If provided, masks are preferred over bboxes.

Outputs (3)

NameTypeDescription
restore_infoBBOX_RESTORE_INFOPer-frame crop metadata required by Restore Video Crop Frames.
cropped_framesIMAGEUniform-size cropped frame batch.
cropped_masksMASKUniform-size cropped mask batch.