Batch Crop From Mask
KJNodes/masking
BatchCropFromMaskExample
JSON Example
{
"class_type": "BatchCropFromMask",
"inputs": {
"original_images": [
"node_id",
0
],
"masks": [
"node_id",
0
],
"crop_size_mult": 1,
"bbox_smooth_alpha": 0.5
}
}This example shows required inputs only. Connection values like ["node_id", 0] should reference actual node IDs from your workflow.
Inputs
| Name | Type | Status | Constraints | Default |
|---|---|---|---|---|
original_images | IMAGE | required | - | - |
masks | MASK | required | - | - |
crop_size_mult | FLOAT | required | min: 0, max: 10, step: 0.001 | 1 |
bbox_smooth_alpha | FLOAT | required | min: 0, max: 1, step: 0.01 | 0.5 |
Outputs
| Index | Name | Type | Is List | Connection Reference |
|---|---|---|---|---|
0 | original_images | IMAGE | No | ["{node_id}", 0] |
1 | cropped_images | IMAGE | No | ["{node_id}", 1] |
2 | bboxes | BBOX | No | ["{node_id}", 2] |
3 | width | INT | No | ["{node_id}", 3] |
4 | height | INT | No | ["{node_id}", 4] |
How to connect to these outputs
To connect another node's input to an output from this node, use the connection reference format:
["node_id", output_index]Where node_id is the ID of this BatchCropFromMask node in your workflow, and output_index is the index from the table above.
Example
If this node has ID "5" in your workflow:
original_images (IMAGE):["5", 0]cropped_images (IMAGE):["5", 1]bboxes (BBOX):["5", 2]
Was this page helpful?