ComfyUI > Nodes > antrobots ComfyUI Nodepack > Paste with Masks

ComfyUI Node: Paste with Masks

Class Name

paste

Category
antrobots-ComfyUI-nodepack/image-handling
Author
antrobot (Account age: 3193days)
Extension
antrobots ComfyUI Nodepack
Latest Updated
2025-04-02
Github Stars
0.02K

How to Install antrobots ComfyUI Nodepack

Install this extension via the ComfyUI Manager by searching for antrobots ComfyUI Nodepack
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter antrobots ComfyUI Nodepack 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Paste with Masks Description

Facilitates image integration with masks for precise blending control and overlaying in ComfyUI Node.

Paste with Masks:

The PasteWithMasks node is designed to facilitate the seamless integration of images by utilizing masks to control the blending process. This node is particularly useful when you want to overlay one image onto another while maintaining precise control over which parts of the source image are visible in the final composition. By leveraging masks, you can ensure that only specific areas of the source image are pasted onto the destination image, allowing for creative and complex image manipulations. The node supports different scaling modes to ensure that the pasted content fits perfectly within the destination image, providing flexibility and precision in image editing tasks.

Paste with Masks Input Parameters:

image_source

The image_source parameter is a tensor representing the image that you want to paste onto the destination image. This parameter is crucial as it defines the visual content that will be integrated into the destination image. The quality and resolution of the source image can significantly impact the final result, so it is important to choose an appropriate image for your needs.

mask_source

The mask_source parameter is a tensor that acts as a stencil for the image_source. It determines which parts of the source image are visible when pasted onto the destination image. A mask is typically a grayscale image where white areas represent fully visible parts, black areas represent fully transparent parts, and gray areas represent varying levels of transparency. This parameter allows for precise control over the blending process.

image_dest

The image_dest parameter is a tensor representing the destination image onto which the source image will be pasted. This image serves as the canvas for the final composition, and its dimensions and resolution will affect how the source image is integrated. It is important to ensure that the destination image is prepared to receive the pasted content.

mask_dest

The mask_dest parameter is a tensor that defines the areas of the destination image that can be affected by the paste operation. Similar to the mask_source, this mask controls the visibility of the pasted content on the destination image. It allows for additional control over the blending process, ensuring that only desired areas of the destination image are altered.

scale_mode

The scale_mode parameter determines how the source image is scaled to fit the destination image. The default value is "bilinear", which provides a smooth scaling effect. This parameter is important for ensuring that the source image is appropriately resized to match the dimensions of the destination image, maintaining the quality and integrity of the visual content.

Paste with Masks Output Parameters:

tuple[torch.Tensor]

The output of the PasteWithMasks node is a tuple containing tensors that represent the final composition after the paste operation. This output includes the modified destination image with the source image integrated according to the specified masks and scaling mode. The result is a seamless blend of the source and destination images, ready for further processing or final output.

Paste with Masks Usage Tips:

  • Ensure that the mask_source and mask_dest are properly aligned with their respective images to achieve the desired blending effect.
  • Experiment with different scale_mode settings to find the best fit for your specific image dimensions and desired quality.

Paste with Masks Common Errors and Solutions:

Mismatched Tensor Dimensions

  • Explanation: This error occurs when the dimensions of the source and destination images or their masks do not match, leading to an inability to perform the paste operation.
  • Solution: Verify that the dimensions of the image_source, mask_source, image_dest, and mask_dest are compatible. Adjust the size of the images or masks as necessary to ensure they align correctly.

Invalid Scale Mode

  • Explanation: This error arises when an unsupported value is provided for the scale_mode parameter.
  • Solution: Ensure that the scale_mode is set to a valid option, such as "bilinear". Check the documentation for other supported scaling modes if needed.

Paste with Masks Related Nodes

Go back to the extension to check out more related nodes.
antrobots ComfyUI Nodepack
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.