ComfyUI > Nodes > ComfyUI 1hewNodes > Image Mask Blend

ComfyUI Node: Image Mask Blend

Class Name

1hew_ImageMaskBlend

Category
1hewNodes/image/blend
Author
1hew (Account age: 1113days)
Extension
ComfyUI 1hewNodes
Latest Updated
2026-04-17
Github Stars
0.03K

How to Install ComfyUI 1hewNodes

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

Image Mask Blend Description

Blends images using a mask for controlled compositing, enabling smooth transitions and effects.

Image Mask Blend:

The 1hew_ImageMaskBlend node is designed to seamlessly blend images using a mask, allowing for sophisticated image compositing. This node is particularly useful for AI artists who want to merge different images while maintaining control over which parts of each image are visible. By utilizing a mask, you can specify areas of transparency and opacity, enabling creative effects such as smooth transitions and layered compositions. The node processes images by applying a mask that can be adjusted for feathering, inversion, and expansion, providing flexibility in how the blend is achieved. This capability is essential for creating complex visual effects and enhancing the aesthetic quality of digital artwork.

Image Mask Blend Input Parameters:

mask_np

The mask_np parameter represents the mask used to blend the images. It is a NumPy array that determines the transparency levels across the image. The mask can be adjusted to control which parts of the image are visible and which are hidden. This parameter is crucial for defining the blending effect, as it directly influences the final appearance of the composite image. The mask can be processed to fill holes, expand or contract, and apply feathering for smoother transitions.

fill_hole

The fill_hole parameter is a boolean option that, when enabled, fills any holes in the mask. This is useful for ensuring that the mask is solid and does not have unintended transparent areas, which could affect the blending result. By filling holes, you can achieve a more uniform and predictable blend.

expansion

The expansion parameter controls the morphological adjustment of the mask, allowing you to expand or contract the mask's area. This is particularly useful for fine-tuning the blending effect, as it can increase or decrease the visible area of the image. The parameter accepts both positive and negative values, where positive values expand the mask and negative values contract it.

feather

The feather parameter determines the amount of Gaussian blur applied to the mask edges. Feathering creates a soft transition between the blended images, reducing harsh lines and making the composite appear more natural. The parameter accepts a range of values, with higher values resulting in a more pronounced blur effect.

invert

The invert parameter is a boolean option that, when enabled, inverts the mask. This means that areas that were previously transparent become opaque and vice versa. Inverting the mask can be useful for reversing the blending effect or creating unique visual styles.

background_color

The background_color parameter specifies the color used for the background when blending images. It can be set to a specific color or calculated based on the average color of the image or mask. This parameter is important for ensuring that the background complements the blended images and enhances the overall composition.

opacity

The opacity parameter controls the transparency level of the mask, affecting how much of the background or underlying image is visible. It accepts values between 0.0 (completely transparent) and 1.0 (completely opaque), allowing for precise control over the blending intensity.

Image Mask Blend Output Parameters:

blended_image

The blended_image output parameter is the final composite image resulting from the blending process. It combines the input images according to the specified mask and parameters, producing a seamless and visually appealing result. This output is essential for artists looking to create complex compositions and layered effects in their digital artwork.

Image Mask Blend Usage Tips:

  • Experiment with the feather parameter to achieve smooth transitions between images, which can enhance the realism of the composite.
  • Use the invert option to quickly switch the focus of the blend, allowing for creative variations without altering the original mask.
  • Adjust the opacity parameter to control the visibility of the background, which can help in achieving the desired balance between the blended images and the background.

Image Mask Blend Common Errors and Solutions:

Mask and Image Size Mismatch

  • Explanation: This error occurs when the dimensions of the mask do not match the dimensions of the image, leading to incorrect blending.
  • Solution: Ensure that the mask is resized to match the image dimensions using the appropriate resizing method, such as Image.Resampling.LANCZOS.

Invalid Mask Format

  • Explanation: This error arises when the mask is not in the correct format or data type, which can prevent proper blending.
  • Solution: Convert the mask to a compatible format, such as a grayscale image, and ensure it is a NumPy array with the correct data type.

Background Color Parsing Error

  • Explanation: This error can occur if the background_color parameter is not specified correctly, leading to unexpected background colors.
  • Solution: Verify that the background_color is specified in a valid format, such as a tuple of RGB values or a recognized color string.

Image Mask Blend Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI 1hewNodes
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 Models, enabling artists to harness the latest AI tools to create incredible art.

Image Mask Blend