Base64 Encoder
Turning binary into boring, transportable text
- Binary Data
- base64_data
There's a moment in every file-handling workflow where the bytes need to travel somewhere that doesn't like bytes - a text field, a message, a log, a config string. Base64 is the standard way to make that happen, and this is the node that does it: Base64 Encoder takes a BINARY_DATA blob and converts it to a plain UTF-8 base64 string.
The mechanism couldn't be more straightforward - it runs Python's base64.b64encode on the input and decodes the result to text. Nothing clever, nothing surprising, no network calls, no API keys. The name is honest: binary in, text out.
- Input: Binary Data (required) - the
BINARY_DATAoutput from a Binary File Loader, DCI File node, Base64 Decoder, or any other node in the pack's binary flow. - Output: base64_data - a single
STRINGyou can pipe into any text node, Show Text, a saver, or embed in a workflow that needs a self-contained payload.
The obvious pairing is the Base64 Decoder at the other end: encode a file to text, stash the string anywhere (a note, a file, a prompt box), then decode it back into BINARY_DATA and carry on. Round-tripping a file through text is a genuinely useful pattern when you're building portable workflows or persisting a binary blob inside something that only stores strings.
Worth knowing: the encoder rejects empty input and returns an empty string rather than crashing, so a blank load won't derail the graph. The console also logs how many bytes became how many characters, which is a nice sanity check.
Installing
Part of comfyui-dci, and this pack keeps install light - Pillow and numpy, no model downloads:
cd ComfyUI/custom_nodes
git clone https://github.com/zccrs/comfyui-dci
cd comfyui-dci && pip install -r requirements.txt
Or install "DCI Image Export Extension" via ComfyUI Manager, then restart. It's under DCI / Files.
Where people get burned
- Base64 inflates size by ~33%. A 100 KB file becomes ~134 KB of text. That's physics, not a bug - and why you wouldn't use this for large payloads.
- It's not encryption. Anyone who gets the string can decode it. Use it for transport, not secrecy.
- The output is one long line. Multiline-tolerant consumers handle it fine, but don't expect formatting.
There's no setup and nothing to tune. If you've ever needed to stuff a binary file into a text-only slot, you'll recognize the exact problem this exists to solve - and it solves it in one node.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| Binary Data | BINARY_DATA | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| base64_data | STRING | — |