ComfyUI > Nodes > MTB Nodes > Image Premultiply (mtb)

ComfyUI Node: Image Premultiply (mtb)

Class Name

Image Premultiply (mtb)

Category
mtb/image
Author
melMass (Account age: 3754days)
Extension
MTB Nodes
Latest Updated
2024-07-02
Github Stars
0.35K

How to Install MTB Nodes

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

Image Premultiply (mtb) Description

Blend image with mask for transparent image creation in compositing workflows, ensuring accurate transparency application.

Image Premultiply (mtb):

The Image Premultiply (mtb) node is designed to blend an image with a mask, effectively applying the mask to the image to create a new image with transparency. This process, known as premultiplication, is particularly useful in compositing workflows where you need to combine images with varying levels of transparency. By using this node, you can ensure that the transparency information from the mask is accurately applied to the image, resulting in a seamless blend. This node is beneficial for tasks such as creating cutouts, applying alpha channels, and preparing images for further compositing.

Image Premultiply (mtb) Input Parameters:

image

The image parameter expects an input of type IMAGE. This is the primary image to which the mask will be applied. The image should be in a format that supports transparency, such as PNG. The quality and resolution of the input image will directly affect the output.

mask

The mask parameter expects an input of type MASK. This mask defines the transparency levels to be applied to the image. Areas of the mask that are white will be fully opaque in the resulting image, while black areas will be fully transparent. Intermediate shades will result in varying levels of transparency.

invert

The invert parameter is a BOOLEAN with a default value of False. When set to True, this parameter inverts the mask before applying it to the image. This means that areas that were originally transparent will become opaque and vice versa. This can be useful if you need to quickly reverse the transparency effect of the mask.

Image Premultiply (mtb) Output Parameters:

RGBA

The RGBA output is of type IMAGE. This is the resulting image after the mask has been applied. The output image will have an alpha channel that reflects the transparency levels defined by the mask. This image can be used directly in further compositing or saved for later use.

Image Premultiply (mtb) Usage Tips:

  • To achieve the best results, ensure that your mask is properly aligned with your image. Misalignment can result in unexpected transparency effects.
  • Use the invert parameter if you need to quickly switch the transparency areas of your mask without creating a new mask.
  • This node is particularly useful for preparing images for compositing in video editing or graphic design software, where precise control over transparency is required.

Image Premultiply (mtb) Common Errors and Solutions:

Expected image tensor of shape (H, W, C) or (B, H, W, C)

  • Explanation: This error occurs when the input image does not have the expected dimensions.
  • Solution: Ensure that your input image is in the correct format, either (H, W, C) for a single image or (B, H, W, C) for a batch of images.

Mask and image dimensions do not match

  • Explanation: This error occurs when the dimensions of the mask do not match the dimensions of the image.
  • Solution: Verify that your mask and image have the same width and height. Resize the mask or image if necessary to ensure they match.

Invalid mask type

  • Explanation: This error occurs when the mask is not of the expected type.
  • Solution: Ensure that your mask is provided in a format that the node can process, typically as a grayscale image where white represents opaque areas and black represents transparent areas.

Image Premultiply (mtb) Related Nodes

Go back to the extension to check out more related nodes.
MTB Nodes
RunComfy

© 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.