Visit ComfyUI Online for ready-to-use ComfyUI environment
Converts Base64-encoded image to mask tensor for AI art workflows.
The Base64ToMask
node is designed to convert a Base64-encoded image back into a mask tensor. This is particularly useful when you need to process or manipulate mask images that have been encoded in Base64 format, which is a common method for embedding image data in text formats such as JSON or HTML. By decoding the Base64 string and converting it into a mask tensor, this node allows you to seamlessly integrate mask images into your AI art workflows, enabling further image processing, analysis, or manipulation tasks.
This parameter accepts a string containing the Base64-encoded image data. The input should be a valid Base64 string that represents the image you want to convert into a mask tensor. The node will decode this string and process the image data to extract the mask. This parameter is essential for the node's operation, as it provides the raw image data that will be converted into a mask.
This optional parameter specifies which color channel of the image should be used to generate the mask. The available options are "red", "green", "blue", and "alpha". By default, the node uses the "red" channel. The choice of channel can affect the resulting mask, as different channels may contain different information. For example, the "alpha" channel is often used to represent transparency and can be useful for creating masks that highlight transparent areas of an image.
The output of this node is a tensor representing the mask extracted from the Base64-encoded image. This mask tensor can be used in subsequent image processing or analysis tasks. The mask is typically a binary or grayscale image where the pixel values indicate the presence or absence of certain features or regions in the original image. This output is crucial for workflows that require precise control over specific areas of an image.
base64Images
parameter is correctly formatted and represents a valid image. Invalid or corrupted Base64 strings can lead to errors during decoding.channel
settings to see which one best suits your needs. For example, using the "alpha" channel can be particularly useful for creating masks that highlight transparent areas in images.© Copyright 2024 RunComfy. All Rights Reserved.