ComfyUI > Nodes > ComfyUI-LogicUtils > String to Base64 Encode

ComfyUI Node: String to Base64 Encode

Class Name

StringToBase64Node

Category
image
Author
aria1th (Account age: 3016days)
Extension
ComfyUI-LogicUtils
Latest Updated
2026-01-21
Github Stars
0.1K

How to Install ComfyUI-LogicUtils

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

String to Base64 Encode Description

Converts strings to Base64, optionally compressing with gzip, for secure and compact data handling.

String to Base64 Encode:

The StringToBase64Node is designed to convert a given string into its Base64 encoded form. This node is particularly useful when you need to encode text data for storage or transmission in a format that is both compact and compatible with systems that may not handle binary data well. By encoding strings into Base64, you ensure that the data remains intact without modification during transport. This node also offers the option to compress the string using gzip before encoding, which can be beneficial for reducing the size of the data when dealing with large text inputs. The primary goal of this node is to provide a straightforward and efficient method for encoding strings, making it an essential tool for tasks involving data serialization and secure data handling.

String to Base64 Encode Input Parameters:

string

The string parameter is the primary input for this node, representing the text data you wish to encode into Base64. This parameter is crucial as it contains the actual content that will be transformed. There are no specific minimum or maximum values for this parameter, but it should be a valid string. The node processes this input to produce a Base64 encoded output, ensuring that the original text is preserved in a format suitable for various applications.

gzip_compress

The gzip_compress parameter is an optional boolean setting that determines whether the input string should be compressed using gzip before being encoded into Base64. When set to True, the node compresses the string, which can significantly reduce the size of the data, especially for larger inputs. This can be advantageous when bandwidth or storage space is a concern. The default value for this parameter is False, meaning that compression is not applied unless explicitly specified. This parameter allows you to balance between data size and processing time, as compression adds an additional step to the encoding process.

String to Base64 Encode Output Parameters:

STRING

The output of the StringToBase64Node is a STRING type, representing the Base64 encoded version of the input string. This output is crucial for applications that require data to be in a text-based format, such as embedding in JSON or XML, or for transmission over protocols that do not support binary data. The encoded string ensures that the original data is preserved and can be decoded back to its original form when needed. This output is particularly useful for developers and AI artists who need to handle text data securely and efficiently.

String to Base64 Encode Usage Tips:

  • To optimize performance, use the gzip_compress option when dealing with large strings to reduce the size of the encoded output, which can be beneficial for storage and transmission.
  • Ensure that the input string is correctly formatted and free of any unintended characters to avoid encoding errors and ensure accurate Base64 conversion.

String to Base64 Encode Common Errors and Solutions:

Invalid input string

  • Explanation: This error occurs when the input provided is not a valid string or contains unsupported characters.
  • Solution: Verify that the input is a properly formatted string and does not contain any invalid characters or data types.

Compression error

  • Explanation: This error may arise if there is an issue with the gzip compression process, possibly due to incompatible input data.
  • Solution: Ensure that the input string is suitable for compression and try disabling the gzip_compress option to see if the issue persists.

String to Base64 Encode Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-LogicUtils
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.

String to Base64 Encode