Base64 -> Any
The Wildcard Decoder That Brings Your Data Home
- *
This is the "restore anything" half of the Base64 IO pair. Where Base64ToLatent and Base64ToConditioning commit to one output type, this node takes a Base64 string and returns whatever object was serialized into it - latent, conditioning, image tensor, a mask, a custom dict, you name it. It's the escape hatch you reach for when the payload you stashed isn't one of the two blessed types, or when you genuinely don't know (or care) what a string contains because it's just data moving from point A to point B.
The workflow this slots into is the same one the whole pack is built around: AnyToBase64 on machine one flattens some internal ComfyUI object into a string, you ship that string through a database, an API response, or a JSON file, and Base64ToAny on machine two rebuilds the exact object. It's the deserializer equivalent of dragging a PNG back onto the canvas to recover a workflow - except the payload here is the actual tensor data, not the graph that made it.
How it works
The node base64-decodes the string back into raw bytes, then runs torch.load(buffer, map_location="cpu", weights_only=False). Two details are load-bearing:
map_location="cpu"is the "smart device handling" the README brags about, and it's real: no matter which machine (or GPU) produced the original, the object comes back on CPU. That's what makes cross-machine round-trips painless - you never get a "tensor is on cuda:0 but I'm on mac" crash.weights_only=Falseis the one to stop and stare at. It meanstorch.loadis allowed to unpickle arbitrary Python, which is how ComfyUI's complex structures survive the trip - but it also means a malicious Base64 string is arbitrary code execution on your machine. The README's warning isn't cover-your-ass boilerplate. Only decode strings you generated yourself or that came from a source you trust. Pasting a stranger's base64 blob into this node is the same as running their code.
Inputs and output
One input: b64_string, a multiline STRING widget that starts empty. Paste the string, or feed it from another string node instead of hand-copying. One output: a * wildcard socket - the wire carries no type label, because the node can't know what's inside until it unpickles.
That wildcard is also the trap, so be deliberate about it. ComfyUI can't type-check a * socket, so if you deserialize a conditioning and wire it into an input that expects a LATENT, you find out at execution time with a confusing error, not at connect time with a red socket. Keep track of what you put in on the encode side; this node will happily hand you a latent where you expected a conditioning.
Installation
Install once for the pack via ComfyUI Manager (search ComfyUI_Base64_IO), or:
cd ComfyUI/custom_nodes/
git clone https://github.com/lenML/ComfyUI_Base64_IO.git
Restart ComfyUI. Zero dependencies - the pack is stdlib plus torch, which you already have - and no model files to fetch. It's a small MIT utility from lenML, a solo dev who ships a lot of these little ComfyUI/LLM tools.
Failure modes
On empty, malformed, or unpickleable input this node fails loudly: it raises ValueError("Invalid Base64 string") and the node goes red. That's the good kind of failure. It means a bad copy-paste is obvious instead of silent - which is the opposite of its sibling Base64ToLatent, which quietly hands you a garbage 1×1 latent when decoding fails. If you're debugging a round-trip and data is vanishing, this node's willingness to yell is an asset.
Reach for this node when your payload isn't a latent or conditioning. For the two flagship flows - moving a latent to a remote GPU box, or caching a prompt's conditioning to skip CLIP - the typed siblings are the better tools, because they let ComfyUI keep type-checking your graph. This one is for everything else.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| b64_string | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| * | * | — |