Visit ComfyUI Online for ready-to-use ComfyUI environment
Converts Base64 images to tensors and masks for AI artists, simplifying image handling and integration into workflows.
The Base64ToImage
node is designed to convert images encoded in Base64 format back into their original image tensor and mask representations. This node is particularly useful for AI artists who need to decode Base64 image strings, which are often used for embedding images in JSON or other text-based formats, back into a usable image format for further processing or analysis. By leveraging this node, you can seamlessly integrate Base64-encoded images into your workflows, ensuring that the images are correctly oriented and converted to the appropriate color space. This node simplifies the process of handling Base64 images, making it easier to work with image data in various applications.
The base64Images
parameter expects a string containing one or more Base64-encoded images. This string should be in JSON format, where each image is represented as a Base64 string. The parameter supports multiline input, allowing you to provide multiple Base64-encoded images at once. This input is crucial as it serves as the source data that will be decoded back into image tensors and masks. There are no specific minimum or maximum values, but the default value is a JSON array with an empty string: [""]
.
The IMAGE
output parameter provides the decoded image tensor(s) from the Base64-encoded input. This tensor represents the image in a format that can be further processed or analyzed in your workflow. The image tensor is converted to the RGB color space and normalized to a float32 format, ensuring compatibility with various image processing tasks.
The MASK
output parameter provides the mask tensor(s) associated with the decoded images. If the original image contains an alpha channel, this mask will represent the transparency information, with values normalized to a float32 format. If no alpha channel is present, a default mask tensor filled with zeros is provided. This mask can be used for tasks that require transparency or segmentation information.
base64Images
input is correctly formatted as a JSON array of Base64 strings to avoid decoding errors.base64Images
input is not a valid JSON array.["data:image/png;base64,..."]
.© Copyright 2024 RunComfy. All Rights Reserved.