Nodes/ComfyUI_Mira/Image To Gzipped Base64
ComfyUI Node

Image To Gzipped Base64

Image into a text string

By mirabarukaso·Created 2 years ago·Updated 9 days ago· 206
Image To Gzipped Base64
  • image
  • base64text

This node turns an image into a plain text string. It takes your IMAGE, gzip-compresses it, and encodes the result as base64 - a long chunk of ASCII you can paste, log, or ship over an API that only speaks text. Its partner node, Gzipped Base64 To Image, does the reverse. Together they're a little codec pair for moving images around as strings.

Here's the honest framing: this exists for a specific reason, and it's stamped right on the node. The author, mirabarukaso, built ComfyUI_Mira partly to support their own SAA - the character_select_stand_alone_app, a separate standalone app that drives ComfyUI over an API. That app needs to hand images back and forth as text, and gzip+base64 is how it does it compactly. So the node's own description says it plainly: "Load Image and Gzipped then convert to Base64 string for SAA." If you're not wiring ComfyUI up to that app (or something like it), you probably don't need this node at all.

How it works

Raw base64 of an image is huge. Gzipping first shrinks it before encoding, so the string you get out is a fraction of what a naive base64 dump would be - which matters when you're passing it through an API payload or embedding it somewhere with size limits. The output is just text; nothing about it is image-native anymore until something decodes it back.

The inputs and outputs that matter

  • image - the IMAGE you want to serialize.
  • base64text (output) - the gzipped-then-base64 STRING. Wire it into whatever consumes text: an API request node, a save-to-file, a show-text preview, or straight back into Gzipped Base64 To Image to round-trip it.

That's the whole surface. No compression-level knob, no format toggle - it does one job.

Installing it

ComfyUI Manager: search ComfyUI_Mira, install, restart. Or clone:

cd ComfyUI/custom_nodes && git clone https://github.com/mirabarukaso/ComfyUI_Mira.git

then restart. If it errors on load, run pip install -r requirements.txt in the ComfyUI_Mira folder. It shows up under Mira/Util/Image.

Common issues

  • It's a niche bridge node. For normal in-graph work you never serialize an image to text - you just keep it as an IMAGE. If you found this while looking for a way to save or preview an image, you want a standard Save Image node instead.
  • The string is still large. Gzip helps, but a big image is a big string. If you're pasting it somewhere with a length cap, resize the image down first.
  • Round-trip with the right partner. Only Gzipped Base64 To Image knows how to decode this exact format (gzip then base64). A generic base64-to-image node won't understand the gzip layer and will fail. Keep the pair together.
CategoryMira/Util/Image

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
base64textSTRINGL