Visit ComfyUI Online for ready-to-use ComfyUI environment
Overlay images with precision using masks for targeted modifications and resizing control.
The Paste By Mask node allows you to seamlessly overlay one image onto another using a mask to determine the exact placement and blending of the images. This node is particularly useful for creating composite images where specific parts of an image need to be replaced or enhanced with another image. By using a mask, you can control which areas of the base image are affected, ensuring precise and targeted modifications. The node also offers various resizing behaviors to ensure that the pasted image fits perfectly within the masked area, providing flexibility and control over the final output.
This parameter represents the base image onto which another image will be pasted. It serves as the canvas for the operation, and the mask will determine which parts of this image will be replaced or blended with the image to paste.
This parameter is the image that will be overlaid onto the base image. The areas where this image will appear are determined by the mask. The image can be resized according to the specified resize behavior to fit the masked area appropriately.
The mask is an image that defines the regions of the base image that will be affected by the paste operation. The mask uses its alpha channel to determine the transparency and blending of the pasted image, allowing for smooth transitions and precise control over the composite result.
This parameter controls how the image to paste is resized to fit the masked area. The available options are:
resize
: Resizes the image to fit the mask exactly.keep_ratio_fill
: Maintains the aspect ratio of the image to paste while filling the masked area, potentially extending outside the mask.keep_ratio_fit
: Maintains the aspect ratio of the image to paste while fitting within the masked area.source_size
: Uses the original size of the image to paste without resizing.source_size_unmasked
: Uses the original size of the image to paste without resizing, but only for unmasked areas.This optional parameter, if provided, controls which image gets pasted onto which base image. It is typically obtained from a Separate Mask Components
node and allows for more complex and targeted pasting operations.
The output is a single composite image that results from pasting the image_to_paste
onto the image_base
using the specified mask
and resize_behavior
. The output image reflects the combined visual elements of both input images, blended according to the mask's transparency and the chosen resizing method.
resize_behavior
options to achieve the desired fit and aspect ratio for the pasted image.mask_mapping_optional
parameter for advanced compositing tasks where multiple images need to be pasted onto different regions of the base image.resize_behavior
parameter.resize_behavior
parameter is set to one of the supported options: resize
, keep_ratio_fill
, keep_ratio_fit
, source_size
, or source_size_unmasked
.resize_behavior
option to ensure compatibility.© Copyright 2024 RunComfy. All Rights Reserved.