ImageSaveAsBase64(IOHelpers)
Turn any ComfyUI image into a base64 data URI — no files, no API key
- images
ComfyUI's Save Image is great at one thing: writing PNGs into ComfyUI/output/. The moment your pipeline wants the image as a string instead of a file - to post to a webhook, feed a second API, stash in a database, or show on a page - that file round-trip is pure friction. ImageSaveAsBase64(IOHelpers) skips the disk entirely: it encodes each image to a data:image/png;base64,... data URI and hands it back in the node's output, no filesystem involved.
How it works
Under the hood it's embarrassingly simple, which is why it's reliable. The image tensor goes from torch to numpy to a PIL image, gets saved into an in-memory BytesIO buffer as a PNG, and the bytes get base64-encoded with the standard data-URI prefix slapped on. You never touch disk, so there's nothing to clean up and no filename to remember. The name is not a lie: it doesn't call any API and needs no key.
The inputs that matter
- images - the IMAGE you're converting. Feed it whatever comes out of VAE Decode or your sampler.
- save_prompt (default on) - embeds the workflow's prompt JSON as PNG metadata, same as core Save Image.
- save_extra_pnginfo (default on) - embeds the extra PNG info (workflow graph and friends) into the encoded PNG.
The last two are worth understanding, because ComfyUI's habit of baking the whole workflow into every PNG is a feature for sharing and a liability for payload size. If you're shipping base64 somewhere, you probably don't want your entire graph embedded in every single string - flip both off and the URI gets noticeably slimmer.
What comes out
There's no wireable output - this is an output node, so the data URIs show up in the UI's results area and, if you're driving ComfyUI from a script, in the API response under ui.images[].base64_string. One entry per image, in order, each a full data:image/png;base64,... string.
Installing it
The pack is a single, dependency-free file from GitHub user Ryuukeisyou. No requirements.txt, no model downloads, nothing but Pillow and the Python stdlib - all already present in ComfyUI's environment. Easiest route: ComfyUI Manager → search "comfyui_io_helpers" → install → restart. Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/Ryuukeisyou/comfyui_io_helpers
Then restart ComfyUI. Nodes land under the "io_helpers" category.
Common issues
- The string is only in the UI/API, not a file. If you expected a file on disk, you grabbed the wrong node. This one's whole job is keeping it in memory.
- Some consumers reject the prefix. Most accept a full data URI directly, but if your tool wants raw base64, strip the
data:image/png;base64,part. Handy symmetry: the pack's sibling ImageLoadFromBase64 accepts both forms, so save and load round-trip cleanly. - Metadata bloat. Large
save_extra_pnginfographs make the string long. If size matters, disable the metadata booleans.
For a small pack with no dependencies, this is the node I'd actually reach for whenever an image needs to leave ComfyUI without becoming a file first.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | — | |
| save_prompt | BOOLEAN | true | — |
| save_extra_pnginfo | BOOLEAN | true | — |
Outputs (0)
No outputs