Visit ComfyUI Online for ready-to-use ComfyUI environment
Blend two images with precise placement and optional masking for creating complex compositions.
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.
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.
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.
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.
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.
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.
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.
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.
x
and y
parameters to position the image exactly where you want it on the destination canvas.resize_source
to True
to ensure the source image fits within the destination canvas without being cut off.x
and y
coordinates, exceeds the bounds of the destination image.x
and y
coordinates or enable resize_source
to fit the source image within the destination canvas.© Copyright 2024 RunComfy. All Rights Reserved.