Base64 Decode to Image
Base64 Decode to Image (Base64DecodeNode) — ComfyUI-LogicUtils
- IMAGE
If you're driving ComfyUI over its API, feeding an image into a workflow is more annoying than it should be. You either upload the file first and reference it, or you pass a URL and hope it's reachable. This node gives you a third option: hand it the image as a base64 string, inline, right there in the prompt JSON, and it decodes that text back into a real IMAGE the rest of the graph can use.
That's the entire use case, and it's a good one for automation. When you're generating requests programmatically, packing the source image straight into the payload as a string means one less round trip and one less thing to host. No temp file, no upload endpoint, no URL that might 404. The image travels with the request. This is why the node shows up mostly in headless and API contexts rather than in someone clicking around the editor.
It comes from ComfyUI-LogicUtils, the utility pack by aria1th (AngelBottomless, the Illustrious XL trainer). The pack is a personal toolkit with famously thin docs, so nodes like this are lean and you figure them out by using them.
Inputs and outputs
One input: base64_string, a STRING. One output: an IMAGE. You give it the base64-encoded bytes of an image, it decodes and returns the picture. That's the whole node.
Because the input is just a string, this pairs naturally with API workflows where that string field gets populated from your request rather than typed by hand. In the editor you can paste a base64 blob into the field, but that's rarely why you'd want it.
Installing it
- ComfyUI Manager: search "ComfyUI-LogicUtils," install, restart.
- Manual:
cd ComfyUI/custom_nodes && git clone https://github.com/aria1th/ComfyUI-LogicUtils, then restart.
No models, no heavy dependencies. The pack's optional dependency auto-installer stays off unless you set COMFYUI_LOGICUTILS_AUTO_INSTALL=1 (disable with COMFYUI_LOGICUTILS_SKIP_INSTALL=1), and decoding base64 needs none of it.
Common snags
The usual failure is a malformed string. If it errors on decode, check two things. First, the data-URI prefix: strings copied from browsers often start with data:image/png;base64, and the actual base64 comes after the comma. If the node chokes, try stripping that prefix and passing only the encoded part. Second, whitespace and line breaks. A base64 blob that got wrapped across lines when it was pasted can fail; clean it up to a single unbroken string.
Beyond that it's a well-behaved little node. It doesn't touch the network, doesn't need a file on disk, and does exactly one thing. For the "get an image into a headless run without hosting it anywhere" problem, it's the simplest tool in the box.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| base64_string | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |