ComfyUI > Nodes > ComfyUI > MaskComposite

ComfyUI Node: MaskComposite

Class Name

MaskComposite

Category
mask
Author
ComfyAnonymous (Account age: 598days)
Extension
ComfyUI
Latest Updated
2024-08-12
Github Stars
45.85K

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

MaskComposite Description

Facilitates blending images or data sources using masks for precise composition control in AI art and image processing.

MaskComposite:

The MaskComposite node is designed to facilitate the combination of different image or latent data sources using a mask. This node allows you to overlay one image or latent data onto another, with the option to use a mask to control the blending of the two sources. This is particularly useful in AI art and image processing tasks where precise control over the composition of different elements is required. By leveraging the mask, you can define specific areas where the source data should be applied, creating complex and nuanced visual effects. The node's functionality is essential for tasks that involve layering, blending, and compositing images or latent data, providing a high degree of flexibility and control.

MaskComposite Input Parameters:

destination

The destination parameter specifies the target image or latent data onto which the source will be composited. This is the base layer that will receive the overlay from the source. The type of this parameter is LATENT or IMAGE, depending on the specific implementation of the node.

source

The source parameter defines the image or latent data that will be overlaid onto the destination. This is the layer that will be composited onto the base layer defined by the destination parameter. The type of this parameter is LATENT or IMAGE.

x

The x parameter determines the horizontal position where the source will be placed on the destination. It is an integer value with a default of 0, a minimum of 0, and a maximum defined by MAX_RESOLUTION. The step value is 8 for latent data and 1 for images, allowing precise placement of the source.

y

The y parameter specifies the vertical position where the source will be placed on the destination. Similar to the x parameter, it is an integer value with a default of 0, a minimum of 0, and a maximum defined by MAX_RESOLUTION. The step value is 8 for latent data and 1 for images.

resize_source

The resize_source parameter is a boolean that determines whether the source should be resized to fit the destination. The default value is False. When set to True, the source will be scaled to match the dimensions of the destination, ensuring a seamless composite.

mask

The mask parameter is optional and specifies a mask to control the blending of the source and destination. The type of this parameter is MASK. The mask defines the areas where the source should be applied, allowing for complex and precise compositing effects.

MaskComposite Output Parameters:

LATENT or IMAGE

The output of the MaskComposite node is either LATENT or IMAGE, depending on the specific implementation. This output represents the composited result of the destination and source, with the optional mask applied. The output retains the dimensions and type of the destination, with the source blended according to the specified parameters.

MaskComposite Usage Tips:

  • To achieve precise placement of the source on the destination, adjust the x and y parameters carefully. Use smaller step values for fine-tuning.
  • Utilize the resize_source parameter when the source and destination have different dimensions to ensure a seamless composite.
  • Apply a mask to control the blending of the source and destination, allowing for complex and nuanced visual effects. Experiment with different mask shapes and values to achieve the desired result.

MaskComposite Common Errors and Solutions:

"Invalid mask dimensions"

  • Explanation: The mask provided does not match the dimensions of the source or destination.
  • Solution: Ensure that the mask dimensions are compatible with the source and destination. Resize the mask if necessary to match the dimensions.

"Source and destination type mismatch"

  • Explanation: The source and destination parameters are of different types (e.g., one is LATENT and the other is IMAGE).
  • Solution: Ensure that both the source and destination are of the same type. Convert one of them if necessary to match the other.

"Out of bounds placement"

  • Explanation: The x or y parameter values place the source outside the bounds of the destination.
  • Solution: Adjust the x and y parameters to ensure that the source is placed within the bounds of the destination. Check the dimensions of both the source and destination to determine appropriate values.

MaskComposite 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.