ComfyUI Node
TS Crop To Mask
Crop a batch around its mask with padding, a resolution clamp, fixed aspect and inter-frame smoothing for video.
TS Crop To Mask
- images
- mask
- cropped_images
- cropped_masks
- crop_data
- width
- height
◄padding64►
◄divide_by32►
◄max_resolution720►
◄fixed_mask_frame_index0►
◄interpolation_window_size0►
◄force_gputrue►
◄fixed_crop_sizefalse►
◄fixed_width1024►
◄fixed_height1024►
CategoryTS/Image/Tiles
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Batch of images to crop around the mask region. | |
| mask | MASK | Mask that defines the region to crop. The bounding box of its non-zero area sets the crop. | |
| padding | INT | 640–320 | Extra pixels added around the mask bounding box before cropping. |
| divide_by | INT | 321–64 | Rounds the crop dimensions up to a multiple of this value (e.g. 32 for VAE-friendly sizes). |
| max_resolution | INT | 720320–2048 | Caps the shorter side of the crop. Larger crops are downscaled to this limit. |
| fixed_mask_frame_index | INT | 00–9999 | 1-based frame whose mask defines one fixed crop for the whole batch. 0 = per-frame crop. |
| interpolation_window_size | INT | 00–100 | Smooths crop motion across frames by averaging over this many neighbouring frames. 0 = off. |
| force_gpu | BOOLEAN | true | Run the crop on GPU when CUDA is available; otherwise falls back to CPU. |
| fixed_crop_size | BOOLEAN | false | Force every crop to the fixed_width x fixed_height aspect ratio instead of following the mask. |
| fixed_width | INT | 102464–4096 | Target crop width when fixed_crop_size is enabled. |
| fixed_height | INT | 102464–4096 | Target crop height when fixed_crop_size is enabled. |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| cropped_images | IMAGE | — |
| cropped_masks | MASK | — |
| crop_data | CROP_DATA | Crop geometry passed to TS Restore From Crop to paste the result back. |
| width | INT | Width of the cropped output. |
| height | INT | Height of the cropped output. |