ComfyUI  >  Nodes  >  ComfyUI >  InvertMask

ComfyUI Node: InvertMask

Class Name

InvertMask

Category
mask
Author
ComfyAnonymous (Account age: 598 days)
Extension
ComfyUI
Latest Updated
8/12/2024
Github Stars
45.9K

How to Install ComfyUI

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

InvertMask Description

InvertMask node reverses mask values to switch highlighted and suppressed regions, aiding image processing and AI art creation.

InvertMask:

The InvertMask node is designed to invert the values of a given mask, effectively transforming areas of high intensity to low intensity and vice versa. This operation is particularly useful in image processing and AI art creation, where you might need to reverse the areas of interest or focus within a mask. By inverting the mask, you can easily switch the regions that are highlighted or suppressed, providing greater flexibility and control over your artistic and computational processes. This node simplifies the task of mask inversion, making it accessible even to those without a deep technical background.

InvertMask Input Parameters:

mask

The mask parameter is the primary input for the InvertMask node. It represents the mask that you want to invert. The mask is typically a grayscale image where different intensity values indicate different levels of importance or focus. The inversion process will transform each pixel value v in the mask to `1.0

  • v`, effectively reversing the areas of high and low intensity. This parameter does not have a default value as it requires an input mask to function.

InvertMask Output Parameters:

MASK

The output parameter MASK is the result of the inversion process. It is a new mask where each pixel value has been inverted from the original mask. This means that areas that were previously highlighted (with higher values) will now be suppressed (with lower values), and vice versa. The output mask can then be used in subsequent image processing or AI art creation steps to achieve the desired effects.

InvertMask Usage Tips:

  • Use the InvertMask node when you need to reverse the areas of interest in a mask, such as switching the focus from foreground to background.
  • Combine the InvertMask node with other mask manipulation nodes like ThresholdMask or FeatherMask to create complex masking effects and enhance your artistic workflow.

InvertMask Common Errors and Solutions:

"Input mask is not provided"

  • Explanation: This error occurs when the mask parameter is not supplied to the InvertMask node.
  • Solution: Ensure that you provide a valid mask input to the node. Check that the mask is correctly connected and that it contains the expected data.

"Invalid mask format"

  • Explanation: This error indicates that the provided mask is not in the correct format or data type expected by the node.
  • Solution: Verify that the mask is a valid grayscale image or tensor with appropriate dimensions and data type. Ensure that the mask conforms to the expected input specifications of the node.

InvertMask Related Nodes

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