Merge Masks π₯π ₯π π ’
VHS_MergeMasksMerge Masks π₯π ₯π π ’<div style="font-size: 0.8em"><div id=VHS_shortdesc>Combine two groups of masks into a single group of masks</div></div><div style="font-size: 0.8em"><div vhs_title="Inputs" style="display: flex; font-size: 0.8em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">Inputs: <div vhs_title="mask_A" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">mask_A: The first group of masks</div></div><div vhs_title="mask_B" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">mask_B: The first group of masks</div></div></div></div><div vhs_title="Outputs" style="display: flex; font-size: 0.8em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">Outputs: <div vhs_title="MASK" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">MASK: The combined group of masks</div></div><div vhs_title="count" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">count: The length of the combined group</div></div></div></div><div vhs_title="Widgets" style="display: flex; font-size: 0.8em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">Widgets: <div vhs_title="merge_strategy" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">merge_strategy: Determines what the output resolution will be if input resolutions don't match<div style="font-size: 1em"><div vhs_title="match A" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">match A: Always use the resolution for A</div></div><div vhs_title="match B" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">match B: Always use the resolution for B</div></div><div vhs_title="match smaller" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">match smaller: Pick the smaller resolution by area</div></div><div vhs_title="match larger" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">match larger: Pick the larger resolution by area</div></div></div></div></div><div vhs_title="scale_method" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">scale_method: Determines what method to use if scaling is required</div></div><div vhs_title="crop" style="display: flex; font-size: 1em" class="VHS_collapse"><div style="color: #AAA; height: 1.5em;">[<span style="font-family: monospace">-</span>]</div><div style="width: 100%">crop: When sizes don't match, should the resized image have it's aspect ratio changed, or be cropped to maintain aspect ratio</div></div></div></div></div>
Example
{
"class_type": "VHS_MergeMasks",
"inputs": {
"mask_A": [
"node_id",
0
],
"mask_B": [
"node_id",
0
],
"merge_strategy": "match A",
"scale_method": "nearest-exact",
"crop": "disabled"
}
}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 |
|---|---|---|---|---|
mask_A | MASK | required | - | - |
mask_B | MASK | required | - | - |
merge_strategy | ENUM4 options
| required | - | - |
scale_method | ENUM5 options
| required | - | - |
crop | ENUM2 options
| required | - | - |
Outputs
| Index | Name | Type | Is List | Connection Reference |
|---|---|---|---|---|
0 | MASK | MASK | No | ["{node_id}", 0] |
1 | count | INT | No | ["{node_id}", 1] |
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 VHS_MergeMasks node in your workflow, and output_index is the index from the table above.
Example
If this node has ID "5" in your workflow:
MASK (MASK):["5", 0]count (INT):["5", 1]