FilterZeroMasksAndCorrespondingImages
KJNodes/masking
FilterZeroMasksAndCorrespondingImagesFilter out all the empty (i.e. all zero) mask in masks Also filter out all the corresponding images in original_images by indexes if provide original_images (optional): If provided, need have same length as masks.
Example
JSON Example
{
"class_type": "FilterZeroMasksAndCorrespondingImages",
"inputs": {
"masks": [
"node_id",
0
]
}
}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 |
|---|---|---|---|---|
masks | MASK | required | - | - |
original_images | IMAGE | optional | - | - |
Outputs
| Index | Name | Type | Is List | Connection Reference |
|---|---|---|---|---|
0 | non_zero_masks_out | MASK | No | ["{node_id}", 0] |
1 | non_zero_mask_images_out | IMAGE | No | ["{node_id}", 1] |
2 | zero_mask_images_out | IMAGE | No | ["{node_id}", 2] |
3 | zero_mask_images_out_indexes | INDEXES | No | ["{node_id}", 3] |
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 FilterZeroMasksAndCorrespondingImages node in your workflow, and output_index is the index from the table above.
Example
If this node has ID "5" in your workflow:
non_zero_masks_out (MASK):["5", 0]non_zero_mask_images_out (IMAGE):["5", 1]zero_mask_images_out (IMAGE):["5", 2]
Was this page helpful?