ComfyUI  >  Nodes  >  😸 YFG Comical Nodes >  🐯 YFG Image To Contrast Mask

ComfyUI Node: 🐯 YFG Image To Contrast Mask

Class Name

image2contrastMask_node

Category
🐯 YFG
Author
YFG (Account age: 2491 days)
Extension
😸 YFG Comical Nodes
Latest Updated
7/2/2024
Github Stars
0.0K

How to Install 😸 YFG Comical Nodes

Install this extension via the ComfyUI Manager by searching for  😸 YFG Comical Nodes
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter 😸 YFG Comical Nodes in the search bar
After installation, click the  Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

🐯 YFG Image To Contrast Mask Description

Generate contrast mask from image for precise AI image manipulation with depth mask support and background replacement ease.

🐯 YFG Image To Contrast Mask:

The image2contrastMask_node is designed to create a contrast mask from a given image, making it a single-step process to generate a mask that can be used for various purposes such as background replacement. This node is particularly useful when working with images that have a good depth mask applied, such as those generated by MiDaS, or images with a high contrast background. By converting the image to grayscale, applying optional Gaussian blur, and filtering based on specified threshold values, this node produces a contrast mask that highlights areas of interest while suppressing less relevant regions. This functionality is essential for AI artists looking to manipulate images with precision and ease.

🐯 YFG Image To Contrast Mask Input Parameters:

image

The image parameter is the input image that you want to process. This image should be in a format compatible with the node, typically a tensor representing the image data. The image is converted to grayscale and processed to generate the contrast mask.

low_threshold

The low_threshold parameter sets the lower bound for pixel intensity. Pixels with intensity values below this threshold will be set to 0 (black) in the resulting mask. This helps in suppressing the less relevant regions of the image. The value should be between 0 and 255, with a default value that can be adjusted based on the specific needs of the image.

high_threshold

The high_threshold parameter sets the upper bound for pixel intensity. Pixels with intensity values above this threshold will be set to 255 (white) in the resulting mask. This helps in highlighting the areas of interest in the image. The value should be between 0 and 255, with a default value that can be adjusted based on the specific needs of the image.

blur_radius

The blur_radius parameter determines the radius of the Gaussian blur applied to the image before thresholding. A higher blur radius can help in smoothing out noise and creating a more uniform mask. The value should be greater than 1 to apply the blur, with a default value that can be adjusted based on the specific needs of the image.

🐯 YFG Image To Contrast Mask Output Parameters:

image

The image output is the processed grayscale image after applying the thresholds and optional blur. This image is a tensor that represents the intensity values of the original image, adjusted based on the specified thresholds.

mask

The mask output is the contrast mask generated from the input image. This mask is a tensor where the pixel values are either 0 or 1, representing the suppressed and highlighted regions of the image, respectively. This mask can be used for further image manipulation tasks such as background replacement.

🐯 YFG Image To Contrast Mask Usage Tips:

  • Adjust the low_threshold and high_threshold values to fine-tune the areas of the image that you want to highlight or suppress. Experiment with different values to achieve the desired effect.
  • Use the blur_radius parameter to smooth out noise in the image. A higher blur radius can help in creating a more uniform mask, especially for images with a lot of fine details or noise.
  • Combine this node with other image processing nodes to create complex effects. For example, use the generated mask to composite different images or apply additional filters.

🐯 YFG Image To Contrast Mask Common Errors and Solutions:

Image format not supported

  • Explanation: The input image is not in a compatible format.
  • Solution: Ensure that the input image is a tensor representing the image data. Convert the image to the appropriate format before passing it to the node.

Threshold values out of range

  • Explanation: The low_threshold or high_threshold values are outside the acceptable range of 0 to 255. - Solution: Adjust the threshold values to be within the range of 0 to 255.

Blur radius too low

  • Explanation: The blur_radius value is less than or equal to 1, which may not apply the desired blur effect.
  • Solution: Set the blur_radius to a value greater than 1 to apply the Gaussian blur effectively.

🐯 YFG Image To Contrast Mask Related Nodes

Go back to the extension to check out more related nodes.
😸 YFG Comical Nodes
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.