Visit ComfyUI Online for ready-to-use ComfyUI environment
Perform various mask operations: union, intersection, difference, XOR for precise image manipulation and effects.
The DM_MaskOperations
node is designed to perform various operations on masks, which are essential tools in AI art for defining regions of interest or exclusion within an image. This node allows you to manipulate masks through a variety of operations such as union, intersection, difference, and XOR, providing flexibility in how you combine and modify mask data. By leveraging these operations, you can create complex mask compositions that can be used to refine image processing tasks, enhance specific areas, or apply effects selectively. The node is particularly useful for tasks that require precise control over mask regions, enabling more sophisticated and targeted image manipulations.
mask_a
is the first mask input for the operation. This parameter represents one of the two masks that will be combined or compared using the specified operation. The mask should be of type MODEL_MASK
.
mask_b
is the second mask input for the operation. Similar to mask_a
, this mask will be used in conjunction with the first mask to perform the desired operation. The mask should be of type MODEL_MASK
.
operation
specifies the type of operation to be performed on the two masks. The available options are union
, intersect
, difference
, and xor
. The default value is union
. Each operation defines a different way of combining or comparing the masks:
union
: Combines both masks, including all areas covered by either mask.intersect
: Includes only the areas where both masks overlap.difference
: Subtracts the areas of the second mask from the first mask.xor
: Includes areas covered by either mask but not both.The output parameter mask
is the resulting mask after the specified operation has been performed on mask_a
and mask_b
. This mask is of type MODEL_MASK
and represents the combined or modified mask based on the chosen operation. The output mask can be used in subsequent image processing tasks to apply effects or modifications selectively.
union
operation.intersect
operation is ideal.difference
operation.xor
operation to create a mask that includes areas covered by either mask but not both, useful for highlighting differences.<operation>
union
, intersect
, difference
, or xor
.layers
parameter to ensure it correctly specifies the layers you intend to target.© Copyright 2024 RunComfy. All Rights Reserved.