Image2Base64
When your image needs to ride a string instead of a wire
- image
- imagebase64
Image2Base64 is the pack's quiet utility node: one image in, one string out. It takes any IMAGE tensor and returns a base64 data-URI - a data:image/jpeg;base64,... string - that can travel through text wires, get written to a file, or get pasted into a request where a tensor can't go.
Why this node exists
It's not decorative. This is the exact same conversion the pack's "Qwen2 Run Inference" node does internally before handing the image to the Qwen2-VL model, and the author exposed it as a standalone node because it's generally useful. Every vision-language node in ComfyUI does this dance under the hood - convert the image to bytes, base64-encode them, ship them over a string. This node just lets you do it yourself and keep the result.
Concrete reasons you'd grab it: you're calling a vision-capable LLM API that only accepts images as base64 or data-URIs (the format most of them want anyway), you want to embed an image into a log or a text file for later inspection, or you're building a custom workflow where the image needs to pass through a text-handling node. It's also handy for debugging - dump the string and you can decode it anywhere.
How it works
Under the hood it's simple and worth knowing for one reason: the image goes through a JPEG round-trip before encoding. The node takes the tensor, converts it to a PIL image, saves it to memory as JPEG, then base64-encodes the bytes and prefixes data:image/jpeg;base64,. JPEG is lossy compression, so this is a carrier for vision models and APIs, not a lossless pipeline. If you're round-tripping an image this way and the quality matters, do it before any critical detail-dependent step.
The interface
- Input:
image- a standard IMAGE tensor, same as you'd get from a Load Image node or any sampler output. - Output:
imagebase64- a STRING containing the full data-URI.
No knobs, no settings, no hidden parameters. It's a one-trick node, which is the entire point.
Installing it
Image2Base64 ships inside ComfyUI-ARZUMATA-Qwen2, so you get it as part of that pack:
cd ComfyUI/custom_nodes
git clone https://github.com/ARZUMATA/ComfyUI-ARZUMATA-Qwen2
then restart ComfyUI. Or install via ComfyUI Manager by searching ComfyUI-ARZUMATA-Qwen2 and restarting. The pack's full dependency list installs along with it (transformers, accelerate, qwen-vl-utils, and friends), which is more machinery than this node alone needs - but since you're presumably also using the Qwen2 nodes, you want it anyway.
Gotchas
There aren't many, because there's so little to go wrong. Remember the JPEG part - if you're feeding this into something that expects lossless PNG bytes, the output will look the same but won't byte-match your source. And keep expectations calibrated: a base64 string of a high-res image is long, and some downstream string fields truncate. That's more a "where you paste it" problem than an Image2Base64 problem. It does exactly one thing, and it does it correctly.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| imagebase64 | STRING | — |