ComfyUI  >  Nodes  >  ComfyUI-Text_Image-Composite [WIP] >  AlphaChanelAddByMask

ComfyUI Node: AlphaChanelAddByMask

Class Name


ZHO-ZHO-ZHO (Account age: 340 days)
ComfyUI-Text_Image-Composite [WIP]
Latest Updated
Github Stars

How to Install ComfyUI-Text_Image-Composite [WIP]

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

Run ComfyUI Online

AlphaChanelAddByMask Description

Add alpha channel to images using specified mask, choose invert or default method for transparency in compositions.


The AlphaChanelAddByMask node is designed to add an alpha channel to a set of images using a specified mask. This node is particularly useful for AI artists who want to create transparent regions in their images based on a mask. The node offers flexibility by allowing you to choose between two methods: the default method, which inverts the mask values, and the invert method, which uses the mask values directly. This functionality is essential for creating complex compositions and effects where transparency plays a crucial role.

AlphaChanelAddByMask Input Parameters:


This parameter expects a set of images to which the alpha channel will be added. The images should be in a compatible format and have the same dimensions as the mask. The images parameter is crucial as it forms the base upon which the alpha channel will be applied.


The mask parameter is used to define the transparency regions in the images. The mask should have the same height and width as the images. The values in the mask determine the transparency levels, with different methods interpreting these values differently.


The method parameter allows you to choose how the mask values are applied to the alpha channel. It accepts two options: "default" and "invert". The "default" method inverts the mask values, making areas with higher mask values more transparent. The "invert" method uses the mask values directly, making areas with higher mask values less transparent. This parameter provides flexibility in how transparency is applied to the images.

AlphaChanelAddByMask Output Parameters:


The output is a set of images with an added alpha channel based on the specified mask and method. The alpha channel defines the transparency of each pixel, allowing for complex compositions and effects. This output is essential for creating images with varying levels of transparency, which can be used in various artistic and design applications.

AlphaChanelAddByMask Usage Tips:

  • Ensure that the dimensions of the images and the mask match exactly to avoid errors.
  • Use the "default" method if you want the mask to define transparent areas directly.
  • Use the "invert" method if you want the mask to define opaque areas directly.
  • Experiment with different masks to achieve various transparency effects and enhance your compositions.

AlphaChanelAddByMask Common Errors and Solutions:

[AlphaChanelByMask]: Size of images not equals size of mask. Images: [width, height] - Mask: [width, height].

  • Explanation: This error occurs when the dimensions of the images and the mask do not match.
  • Solution: Ensure that the height and width of the images and the mask are identical before using the node.

TypeError: 'NoneType' object is not subscriptable

  • Explanation: This error may occur if the images or mask parameters are not properly initialized or passed to the node.
  • Solution: Verify that the images and mask parameters are correctly provided and are in the expected format.

AlphaChanelAddByMask Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-Text_Image-Composite [WIP]

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.