ComfyUI > Nodes > ComfyUI > ImageCompositeMasked

ComfyUI Node: ImageCompositeMasked

Class Name

ImageCompositeMasked

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

ImageCompositeMasked Description

Blend two images with precise placement and optional masking for creating complex compositions.

ImageCompositeMasked:

The ImageCompositeMasked node is designed to seamlessly blend two images together, allowing you to place a source image onto a destination image at specified coordinates. This node is particularly useful for creating complex compositions where precise placement and optional masking are required. By leveraging this node, you can control the exact position of the source image on the destination canvas, resize the source image if necessary, and apply a mask to define the blending area. This functionality is essential for tasks such as overlaying graphics, creating collages, or integrating elements from different images into a cohesive whole.

ImageCompositeMasked Input Parameters:

destination

The destination parameter specifies the base image onto which the source image will be composited. This is the canvas where the final composition will be rendered.

source

The source parameter defines the image that will be placed onto the destination image. This is the image that you want to overlay or integrate into the destination image.

x

The x parameter determines the horizontal position where the top-left corner of the source image will be placed on the destination image. It accepts integer values with a default of 0, a minimum of 0, and a maximum defined by MAX_RESOLUTION. This allows you to precisely control the horizontal placement of the source image.

y

The y parameter sets the vertical position where the top-left corner of the source image will be placed on the destination image. Similar to the x parameter, it accepts integer values with a default of 0, a minimum of 0, and a maximum defined by MAX_RESOLUTION. This allows you to precisely control the vertical placement of the source image.

resize_source

The resize_source parameter is a boolean that determines whether the source image should be resized to fit within the destination image. The default value is False. When set to True, the source image will be scaled to fit within the bounds of the destination image, ensuring that it does not exceed the canvas size.

mask

The mask parameter is optional and specifies a mask image that defines the blending area between the source and destination images. The mask controls the transparency and blending of the source image, allowing for more complex and refined compositions. If no mask is provided, the source image will be composited without any masking.

ImageCompositeMasked Output Parameters:

IMAGE

The output of the ImageCompositeMasked node is an IMAGE that represents the final composited image. This image is the result of overlaying the source image onto the destination image at the specified coordinates, with optional resizing and masking applied. The output image can be used for further processing or as a final artwork.

ImageCompositeMasked Usage Tips:

  • To achieve precise placement of the source image, carefully adjust the x and y parameters to position the image exactly where you want it on the destination canvas.
  • If the source image is larger than the destination image, consider setting resize_source to True to ensure the source image fits within the destination canvas without being cut off.
  • Use a mask to create smooth transitions and blending effects between the source and destination images. This can help integrate the source image more naturally into the composition.

ImageCompositeMasked Common Errors and Solutions:

"Invalid mask dimensions"

  • Explanation: The mask provided does not match the dimensions of the source or destination images.
  • Solution: Ensure that the mask image has the same dimensions as the source and destination images to achieve proper blending.

"Source image exceeds destination bounds"

  • Explanation: The source image, when placed at the specified x and y coordinates, exceeds the bounds of the destination image.
  • Solution: Adjust the x and y coordinates or enable resize_source to fit the source image within the destination canvas.

"Invalid parameter value"

  • Explanation: One or more input parameters have values outside the acceptable range.
  • Solution: Verify that all input parameters are within their specified ranges and correct any values that are out of bounds.

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