ComfyUI > Nodes > D2 Nodes ComfyUI > D2 Paste By Mask

ComfyUI Node: D2 Paste By Mask

Class Name

D2 Paste By Mask

Category
D2/Image
Author
da2el-ai (Account age: 713days)
Extension
D2 Nodes ComfyUI
Latest Updated
2025-05-04
Github Stars
0.03K

How to Install D2 Nodes ComfyUI

Install this extension via the ComfyUI Manager by searching for D2 Nodes ComfyUI
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter D2 Nodes 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
  • 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

D2 Paste By Mask Description

Seamlessly merge images with precise masking and positioning control for complex compositions and localized effects.

D2 Paste By Mask:

The D2 Paste By Mask node is designed to seamlessly combine two images by specifying a mask and a region, allowing for precise control over how and where the images are merged. This node is particularly useful for tasks that require overlaying one image onto another with specific masking or positioning requirements. It offers various modes to determine how the pasted image is trimmed and positioned, providing flexibility in image composition. By utilizing this node, you can achieve complex image manipulations with ease, such as creating collages or applying localized effects, all while maintaining control over the blending and positioning of the images.

D2 Paste By Mask Input Parameters:

img_base

This parameter represents the base image onto which another image will be pasted. It supports batch processing, allowing multiple images to be processed simultaneously. The base image serves as the canvas for the composition, and its dimensions and properties influence the final output.

img_paste

This parameter is the image that will be pasted onto the base image. Like the base image, it supports batch processing. The img_paste parameter is crucial as it determines the content that will be overlaid onto the base image, and its properties can be adjusted based on the selected paste mode.

paste_mode

The paste_mode parameter defines how the img_paste is trimmed and positioned on the base image. It offers four options: mask, rect_full, rect_position, and rect_pos_mask. Each mode provides a different method of pasting, such as using a mask for shape control or specifying exact coordinates for placement, allowing for tailored image compositions.

multi_mode

This parameter dictates how multiple images are handled when either the base or paste image, or both, consist of multiple items. Options include pair_last, pair_only, and cross, each offering a different approach to pairing images for processing. This flexibility ensures that the node can handle various batch processing scenarios efficiently.

mask_opt

An optional parameter that provides a mask for the img_paste. This mask can be used to control the shape and area of the pasted image, allowing for more complex and precise compositions. It is particularly useful in modes that require masking, such as mask and rect_pos_mask.

rect_opt

This optional parameter specifies the rectangle dimensions and position for the img_paste. It is used in modes that require precise positioning, such as rect_full and rect_position, enabling you to define exact areas for pasting.

feather

The feather parameter controls the amount of edge blurring applied to the pasted image, with a range from 0 to 100 pixels. This feature helps in creating smooth transitions between the base and pasted images, enhancing the visual quality of the composition.

feather_type

This optional parameter determines the method of feathering applied to the pasted image. Options include simple and distance, each offering a different approach to edge blurring. This allows for customization of the blending effect to suit specific artistic needs.

D2 Paste By Mask Output Parameters:

image

The output parameter is the final composite image resulting from the merging of the base and pasted images. This image reflects the specified paste mode, mask, and feathering settings, providing a seamless and visually appealing result that integrates the two input images according to the defined parameters.

D2 Paste By Mask Usage Tips:

  • Use the mask paste mode when you need to apply a specific shape to the pasted image, allowing for creative compositions like cutouts or overlays.
  • Experiment with the feather parameter to achieve smoother transitions between images, especially when blending images with different backgrounds or textures.
  • Utilize the multi_mode options to efficiently handle batch processing, ensuring that your workflow remains streamlined when working with multiple images.

D2 Paste By Mask Common Errors and Solutions:

Mask is required for 'rect_pos_mask' paste mode

  • Explanation: This error occurs when the rect_pos_mask mode is selected without providing a mask.
  • Solution: Ensure that a valid mask is supplied in the mask_opt parameter when using the rect_pos_mask mode.

Mask is required for 'mask' paste mode

  • Explanation: This error indicates that the mask mode was selected without a corresponding mask.
  • Solution: Provide a mask in the mask_opt parameter to use the mask paste mode effectively.

D2 Paste By Mask Related Nodes

Go back to the extension to check out more related nodes.
D2 Nodes ComfyUI
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.