Nodes/ComfyUI-HttpRequestNodes/Image To Blob Node
ComfyUI Node

Image To Blob Node

Turn your generated image into raw PNG bytes for any API

By ahkimkoo·Created 3 months ago·Updated 3 months ago· 1
Image To Blob Node
  • image
  • BYTES

The Image To Blob Node takes an IMAGE tensor from your graph and hands you back raw PNG bytes. That's the entire job, and it's the bridge between "the image exists inside ComfyUI" and "the image exists as a file an HTTP API will accept." If you've ever stared at a request node and realized there's no way to get your generated image into it, this is the missing piece.

It's one of the converter nodes in ComfyUI-HttpRequestNodes, ahkimkoo's fork of felixszeto's ComfyUI-RequestNodes. The family: this node produces BYTES for raw-body uploads, its sibling Image To Base64 Node produces a base64 string for JSON APIs, and the Blob To Image Node runs the same road in reverse. Choose based on what the endpoint expects.

How it works

One input, image (IMAGE), one output, BYTES. Under the hood it converts the tensor to a PIL image and saves it to memory as PNG - the code literally re-encodes to PNG with no format option, so PNG bytes are what you always get. That matters in two ways:

  • The output is raw bytes, exactly what the Binary Post Request Node's body input wants. Wire them together and you've got a one-way image upload that takes your sampled image straight to an endpoint.
  • It's PNG or nothing. If your API needs JPEG for size reasons, this isn't the node - convert outside first.

One subtlety from the source: the batch dimension gets squeezed before encoding, so a batch of images becomes one tall composite rather than multiple files. Feed it a single image unless that's what you intend. The output also carries no filename or MIME type - that's up to the receiving side, which is why the pack's multipart nodes (Media Form Post Node, Form Post Request Node) handle their own encoding instead of using this.

Install

ComfyUI Manager → search ComfyUI-HttpRequestNodes → Install, restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/ahkimkoo/ComfyUI-HttpRequestNodes
pip install soundfile imageio imageio-ffmpeg

Category: RequestNode/Converters. It only needs PIL, which ComfyUI already ships. The imageio/soundfile pip packages are for the audio and video converters in the same pack - harmless to install, unnecessary for this node. No models, no keys, nothing else to fetch.

CategoryRequestNode/Converters

Inputs (1)

NameTypeDefaultDescription
imageIMAGE

Outputs (1)

NameTypeDescription
BYTESBYTES