Skip to main content

Batch Crop From Mask

KJNodes/masking
BatchCropFromMask

Example

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

NameTypeStatusConstraintsDefault
original_imagesIMAGErequired--
masksMASKrequired--
crop_size_multFLOATrequiredmin: 0, max: 10, step: 0.0011
bbox_smooth_alphaFLOATrequiredmin: 0, max: 1, step: 0.010.5

Outputs

IndexNameTypeIs ListConnection Reference
0original_imagesIMAGENo["{node_id}", 0]
1cropped_imagesIMAGENo["{node_id}", 1]
2bboxesBBOXNo["{node_id}", 2]
3widthINTNo["{node_id}", 3]
4heightINTNo["{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?