ComfyUI  >  Nodes  >  ComfyUI >  LatentCompositeMasked

ComfyUI Node: LatentCompositeMasked

Class Name

LatentCompositeMasked

Category
latent
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

LatentCompositeMasked Description

Facilitates combining latent images with precise control using masks for overlaying and resizing.

LatentCompositeMasked:

The LatentCompositeMasked node is designed to facilitate the combination of two latent images, allowing you to overlay one image onto another at a specified position. This node is particularly useful for tasks that require precise control over image composition in the latent space, such as inpainting or creating complex image manipulations. By leveraging a mask, you can define specific areas where the source image should be applied to the destination image, providing a high degree of flexibility and control. The node also offers an option to resize the source image to fit the destination, ensuring seamless integration.

LatentCompositeMasked Input Parameters:

destination

The destination parameter represents the latent image that will serve as the base or background for the composition. This is where the source image will be overlaid. It is of type LATENT.

source

The source parameter is the latent image that you want to overlay onto the destination image. This image will be placed at the specified coordinates on the destination image. It is of type LATENT.

x

The x parameter specifies the horizontal position where the top-left corner of the source image will be placed on the destination image. It is an integer value with a default of 0, a minimum of 0, and a maximum defined by MAX_RESOLUTION, with steps of 8.

y

The y parameter specifies the vertical position where the top-left corner of the source image will be placed on the destination image. It is an integer value with a default of 0, a minimum of 0, and a maximum defined by MAX_RESOLUTION, with steps of 8.

resize_source

The resize_source parameter is a boolean that determines whether the source image should be resized to fit the destination image. If set to True, the source image will be resized; if False, it will retain its original dimensions. The default value is False.

mask

The mask parameter is optional and allows you to specify a mask that defines the areas where the source image should be applied to the destination image. It is of type MASK. If no mask is provided, the source image will be applied uniformly.

LatentCompositeMasked Output Parameters:

LATENT

The output is a single LATENT type parameter, which is the resulting composite image. This image is the combination of the destination and source images, overlaid according to the specified parameters and mask.

LatentCompositeMasked Usage Tips:

  • To achieve precise control over where the source image is placed, carefully adjust the x and y parameters.
  • Use the mask parameter to apply the source image selectively, which is useful for tasks like inpainting or adding specific details to certain areas of the destination image.
  • If the source image dimensions do not match the destination, consider setting resize_source to True to ensure a seamless overlay.

LatentCompositeMasked Common Errors and Solutions:

"Invalid mask shape"

  • Explanation: The provided mask does not match the dimensions of the source or destination images.
  • Solution: Ensure that the mask dimensions align with the source and destination images.

"Source image out of bounds"

  • Explanation: The specified x and y coordinates place the source image outside the bounds of the destination image.
  • Solution: Adjust the x and y coordinates to ensure the source image fits within the destination image boundaries.

"Resize source failed"

  • Explanation: The source image could not be resized to match the destination image dimensions.
  • Solution: Verify that the source image can be resized and that the resize_source parameter is set correctly.

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