ComfyUI  >  Nodes  >  ComfyUI Layer Style >  LayerMask: BlendIf Mask

ComfyUI Node: LayerMask: BlendIf Mask

Class Name

LayerMask: BlendIf Mask

Category
😺dzNodes/LayerMask
Author
chflame163 (Account age: 445 days)
Extension
ComfyUI Layer Style
Latest Updated
6/24/2024
Github Stars
0.6K

How to Install ComfyUI Layer Style

Install this extension via the ComfyUI Manager by searching for  ComfyUI Layer Style
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI Layer Style 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

LayerMask: BlendIf Mask Description

Advanced masking for layer blending based on color channels and intensity ranges, offering precise control for detailed layer manipulation.

LayerMask: BlendIf Mask:

The LayerMask: BlendIf Mask node is designed to provide advanced masking capabilities by allowing you to blend layers based on specific color channels and intensity ranges. This node is particularly useful for creating complex masks that depend on the grayscale, red, green, or blue channels of an image. By adjusting the black and white points and their respective ranges, you can fine-tune the mask to include or exclude specific intensity values, giving you precise control over the blending process. This functionality is essential for tasks that require detailed layer manipulation, such as compositing, image correction, and artistic effects.

LayerMask: BlendIf Mask Input Parameters:

image

This parameter accepts the input image that you want to apply the BlendIf mask to. The image serves as the base layer for the masking operation.

invert_mask

This boolean parameter determines whether the mask should be inverted. When set to True (default), the mask will be inverted, meaning areas that would normally be masked out will be included, and vice versa. This is useful for reversing the effect of the mask without needing to create a new one.

blend_if

This parameter allows you to select the color channel to base the mask on. The available options are "gray", "red", "green", and "blue". Choosing a specific channel will create a mask based on the intensity values of that channel in the input image.

black_point

This integer parameter sets the starting point of the black range. Pixels with intensity values below this point will be fully masked out. The default value is 0, with a minimum of 0 and a maximum of 254. Adjusting this value helps in excluding darker areas from the mask.

black_range

This integer parameter defines the range of intensity values that will transition from fully masked out to fully included. The default value is 0, with a minimum of 0 and a maximum of 255. This range helps in creating a smooth transition for the mask.

white_point

This integer parameter sets the starting point of the white range. Pixels with intensity values above this point will be fully included in the mask. The default value is 255, with a minimum of 1 and a maximum of 255. Adjusting this value helps in including brighter areas in the mask.

white_range

This integer parameter defines the range of intensity values that will transition from fully included to fully masked out. The default value is 0, with a minimum of 0 and a maximum of 255. This range helps in creating a smooth transition for the mask.

mask

This optional parameter allows you to provide an additional mask to be combined with the BlendIf mask. This can be useful for further refining the mask by combining multiple masking criteria.

LayerMask: BlendIf Mask Output Parameters:

mask

The output parameter is a mask that represents the areas of the input image that meet the specified BlendIf criteria. This mask can be used for various purposes, such as blending layers, creating selections, or applying effects. The mask is returned as a binary image where white areas represent included regions and black areas represent excluded regions.

LayerMask: BlendIf Mask Usage Tips:

  • Experiment with different blend_if channels to see how they affect the mask. Each channel can highlight different aspects of the image.
  • Use the black_point and white_point sliders to quickly adjust the mask's inclusion and exclusion thresholds.
  • Combine the BlendIf mask with an additional mask for more complex masking scenarios, allowing for greater control and precision.
  • Inverting the mask can be a quick way to switch the focus of the mask without needing to create a new one from scratch.

LayerMask: BlendIf Mask Common Errors and Solutions:

"Invalid image input"

  • Explanation: The input provided for the image parameter is not valid.
  • Solution: Ensure that the input is a valid image file and is correctly loaded into the node.

"Invalid mask input"

  • Explanation: The optional mask parameter is not a valid mask.
  • Solution: Verify that the mask provided is a valid binary image and correctly formatted.

"Parameter out of range"

  • Explanation: One of the integer parameters (black_point, black_range, white_point, white_range) is set outside its allowed range.
  • Solution: Check the parameter values and ensure they fall within the specified minimum and maximum limits. Adjust the values accordingly.

LayerMask: BlendIf Mask Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI Layer Style
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.