Visit ComfyUI Online for ready-to-use ComfyUI environment
Combine two mask tensors into a unified mask with intelligent dimension handling for video processing and AI art creation.
The VHS_MergeMasks
node is designed to combine two mask tensors into a single unified mask. This is particularly useful in video processing and AI art creation where multiple masks need to be merged for further processing or analysis. The node intelligently handles masks of different dimensions by scaling them according to a specified strategy, ensuring that the final merged mask maintains the desired properties and dimensions. This functionality is essential for creating complex mask compositions and ensuring consistency across different frames or images in a video sequence.
mask_A
is the first mask tensor to be merged. It serves as one of the primary inputs and its dimensions may influence the scaling of the second mask depending on the chosen merge strategy. This parameter is crucial as it forms one half of the final merged mask.
mask_B
is the second mask tensor to be merged. Similar to mask_A
, its dimensions and properties are considered during the merging process. The interaction between mask_A
and mask_B
determines the final output mask.
merge_strategy
defines how the node should handle masks of different dimensions. Options include MATCH_A
, MATCH_B
, MATCH_SMALLER
, and MATCH_LARGER
. This parameter is essential for ensuring that the masks are scaled appropriately before merging, based on the desired outcome.
scale_method
specifies the method used for scaling the masks when their dimensions do not match. This parameter ensures that the scaling process maintains the quality and integrity of the masks, which is critical for accurate merging.
crop
determines how the masks should be cropped during the scaling process. This parameter helps in managing the spatial alignment of the masks, ensuring that the final merged mask is correctly aligned and free from unwanted artifacts.
MASK
is the resulting tensor after merging mask_A
and mask_B
. This output represents the combined mask, which can be used for further processing or analysis in your video or image workflow.
count
indicates the number of masks that were merged. This output provides a simple verification of the merging process, ensuring that the expected number of masks have been combined.
mask_A
and mask_B
are properly pre-processed and free from noise to achieve the best merging results.merge_strategy
based on the relative sizes of your masks to maintain the desired aspect ratio and resolution.scale_method
options to find the one that best preserves the quality of your masks during scaling.mask_A
and mask_B
are incompatible and cannot be scaled according to the chosen strategy.merge_strategy
or pre-process the masks to have compatible dimensions.merge_strategy
parameter is set to one of the supported options: MATCH_A
, MATCH_B
, MATCH_SMALLER
, or MATCH_LARGER
.scale_method
parameter and ensure it is set to a valid scaling method supported by the node.© Copyright 2024 RunComfy. All Rights Reserved.