Visit ComfyUI Online for ready-to-use ComfyUI environment
Converts input mask to binary mask based on threshold for isolating image areas with precise control.
The ThresholdMask node is designed to convert an input mask into a binary mask based on a specified threshold value. This node is particularly useful for AI artists who need to isolate certain areas of an image or mask by setting a threshold that determines which parts of the mask are kept and which are discarded. By comparing each pixel value in the mask to the threshold, the node generates a new mask where pixels above the threshold are set to one (white) and those below are set to zero (black). This functionality is essential for tasks that require precise control over mask regions, such as image compositing, masking effects, and selective image processing.
The mask
parameter is the input mask that you want to threshold. This mask is typically a grayscale image where different pixel values represent different levels of intensity. The node will process this mask to create a binary mask based on the specified threshold value.
The value
parameter is a floating-point number that sets the threshold level for the mask. Pixels in the input mask with values greater than this threshold will be set to one in the output mask, while those with values less than or equal to the threshold will be set to zero. The value
parameter ranges from 0.0 to 1.0, with a default value of 0.5. This allows for fine-tuning the threshold to achieve the desired masking effect.
The output mask
is the binary mask generated by applying the threshold to the input mask. In this binary mask, pixels with values greater than the specified threshold are set to one (white), and those with values less than or equal to the threshold are set to zero (black). This output mask can be used in various image processing tasks where a clear distinction between masked and unmasked areas is required.
value
parameter closer to 1.0. This will ensure that only the brightest pixels are included in the output mask.value
parameter closer to 0.0. This will include more of the darker pixels in the output mask.mask
parameter is not supplied to the node.value
parameter is set outside the allowed range of 0.0 to 1.0.value
parameter to be within the range of 0.0 to 1.0.© Copyright 2024 RunComfy. All Rights Reserved.