Nodes/lf-nodes/Blob to Image
ComfyUI Node

Blob to Image

Decode raw file bytes back into an image tensor

By lucafoscili·Created 2 years ago·Updated 6 days ago· 35
Blob to Image
  • file_blob
  • ui_widget
  • image
  • image_list

Most ComfyUI workflows read images the normal way - an Image Load node points at a file, and an image tensor appears. But if you've gone down the rabbit hole of the LF Nodes IO layer, you've met FILE_BLOB: a raw byte blob as loaded by LF_LoadFileOnce and friends, which hands you the file's actual bytes instead of decoding them. LF_BlobToImage is the decoder at the end of that path. Give it a blob, get back an image tensor.

When does this matter? When you want to read a file without going through ComfyUI's usual folder-path loader - e.g. pulling an image from an arbitrary path, from a network download, or from a workflow that passes raw bytes around for a reason. It's plumbing, but it's the plumbing that makes the file-blob workflow coherent.

How it works

The node takes a file_blob and figures out what format is inside by sniffing magic headers and footers - it recognizes PNG, JPEG, GIF, WebP, BMP, TIFF, ICO, and HEIF/HEVC, and extracts the image bytes from the blob before decoding with Pillow. In other words, you don't tell it the format; it detects it from the byte patterns. That's a genuinely nice property when your blob source doesn't reliably know what it's holding.

One required input: file_blob (a raw byte blob, e.g. from LF_LoadFileOnce). Outputs: image (the decoded tensor) and image_list (the same, as a list) - pick whichever your downstream nodes expect.

Installing it

lf-nodes is one pack:

cd ComfyUI/custom_nodes
git clone https://github.com/lucafoscili/lf-nodes

restart ComfyUI, or install "LF Nodes" from ComfyUI Manager. Pillow (already in the suite's requirements) is the only real dependency here.

Troubleshooting

  • "No recognizable image format" - the blob isn't an image (or the sniffing missed an exotic format). Check what LF_LoadFileOnce actually loaded.
  • Blob loads but decodes wrong - some files embed extra bytes before the image payload; the node handles the common cases, but very unusual containers can confound the heuristic.
  • If you don't need raw bytes, you probably don't need this node - a plain image loader is simpler. Reach for it only when your workflow is already passing blobs.
Category✨ LF Nodes/Image

Inputs (2)

NameTypeDefaultDescription
file_blobFILE_BLOBRaw byte blob, e.g. from LF_LoadFileOnce
ui_widgetoptLF_CODE[object Object]

Outputs (2)

NameTypeDescription
imageIMAGEImage tensor with blob-to-image conversion applied.
image_listIMAGEList of image tensors with blob-to-image conversion applied.