Nodes/ComfyUI Ino Nodes/Ino Image To Base64
ComfyUI Node

Ino Image To Base64

Turn an in-graph IMAGE into a data URI for vision APIs

By nobandegani·Created about a year ago·Updated 2 months ago· 6
Ino Image To Base64
  • image
  • success
  • base64_string
enabledtrue
formatpng

You generate an image in ComfyUI, and then you want to send it to a vision LLM to caption it, critique it, or extract a prompt from it. Those APIs don't accept a ComfyUI IMAGE tensor - they want a base64 data URI. Ino Image To Base64 is the bridge: it takes the image tensor straight out of your graph and hands you the data:image/png;base64,... string, no saving to disk required.

It's one of the image helper nodes in ComfyUI-InoNodes. The pack's whole personality is "glue for automation," and this is a pure glue node - it doesn't enhance or edit anything, it just repackages the pixels for handoff.

The inputs

Three, and you'll only touch one of them in practice:

  • enabled - the pack's standard toggle, on by default.
  • image - the IMAGE tensor to convert. Wire in anything that outputs an image: a VAE Decode, an upscaler, a Load Image.
  • format - dropdown with png, jpeg, or webp. Defaults to png. This controls both the encoding and the MIME type in the data URI.

Outputs: success (boolean) and base64_string - the full data URI, ready to paste into an HTTP request.

How it works

The node takes the first frame of the input tensor (image[0]), converts it from the normalized float tensor back to a PIL image, encodes it in your chosen format, base64-encodes the bytes, and prefixes it with the right MIME type. So png gives you data:image/png;base64,..., jpeg gives data:image/jpeg;base64,..., and so on. Clean and predictable.

Where it fits

  • Captioning / prompt extraction. Feed base64_string into an OpenAI-compatible node - the pack ships Ino Openai Responses and Ino Openai Chat Completions for exactly this - and let the vision model tell you what's in the frame.
  • APIs that want media inline. Ino Http Call can carry the data URI in its json_payload to any endpoint.
  • Saving out. If you'd rather store it, the string flows fine into a save or S3 upload node.

The key difference from its disk-based sibling (Ino File To Base64): this one works on the live tensor, so there's no intermediate file write. If the image is already sitting in a folder instead, use the file version.

Gotchas

The "first frame only" behavior matters if you feed it a batched image - you'll only ever get the first image's URI. For single generations that's a non-issue. Also remember the pack's enabled toggle: off means success: false and an empty string, which surfaces as a mysteriously empty API call. And be mindful of size - a full-resolution PNG as base64 is a chunky string, so if an API rejects it, try jpeg for a smaller payload.

Installation

Ships with ComfyUI-InoNodes:

  • ComfyUI Manager: search "ComfyUI Ino Nodes", install, restart ComfyUI.
  • Manual: cd ComfyUI/custom_nodes && git clone https://github.com/nobandegani/comfyui_ino_nodes && cd comfyui_ino_nodes && pip install -r requirements.txt, restart.

Python 3.10+, ComfyUI 0.18.1+ (V3 schema). No models, no keys - encoding is local. If you're already running the pack for its other helpers, this one's already on your graph palette.

CategoryInoImageHelper

Inputs (3)

NameTypeDefaultDescription
enabledBOOLEANtrue
imageIMAGE
formatCOMBOpng3 options: png, jpeg, webp

Outputs (2)

NameTypeDescription
successBOOLEAN
base64_stringSTRING