Nodes/X-WIDE Image / Latent Sender / Receiver/X-WIDE Latent Sender 潜空间发送器
ComfyUI Node

X-WIDE Latent Sender 潜空间发送器

Pass the latent, skip the VAE round trip

By XWIDE·Created 22 days ago·Updated 22 days ago· 2
X-WIDE Latent Sender 潜空间发送器
  • samples
  • samples
◄filename_prefixlatents/LatentSender►
◄link_id0►
◄preview_methodLatent2RGB-SDXL►

Every time you decode a latent to pixels and encode it back, you pay - and not just in seconds. VAE encode/decode is lossy, and chained passes that keep ping-ponging through the VAE accumulate that loss. So to hand a mid-pipeline result from one corner of a graph to another, don't hand over the picture. Hand over the latent. That's the entire reason XWIDE_LatentSender exists.

What it is

The X-WIDE pack's second pair, added in v1.1.0. Same deal as the image pair: an independent, bilingual re-wrap of ltdrdata's Impact Pack Latent Sender / Latent Receiver, GPL-3.0, no Impact Pack needed, protocol-compatible with the originals. The author is explicit that it adds no capability the original lacks - it fixes bugs and clears up the UI. Fair warning: this pair is obscure, and searches barely turn it up. That's a shame, because the case for it is real.

How it works

It subclasses ComfyUI's SaveLatent, but points the output at ComfyUI/temp/ instead of output/, so nothing accumulates in your permanent library. Then it does something cleverer than a plain file write.

First it renders a Latent2RGB preview of the tensor using ComfyUI's own latent_preview.Latent2RGBPreviewer - pure CPU matrix math, no VAE, no checkpoint, no download - and rescales the thumbnail into a sane size range. Then it serializes the latent itself with safetensors, zips it, and stuffs the zip into the PNG's EXIF UserComment field via piexif. The result is a .latent.png: a picture you can look at that is secretly a container carrying the exact tensor. Prompt metadata still gets written as PNG text chunks, as usual.

Then it fires a latent-send event with your link_id and the file, same mechanism as the image pair. Files land as temp/latents/LatentSender_00001_.latent.png. If piexif were missing from the environment it would degrade to a plain .latent file - transfer still works, just no thumbnail; both libraries are already in a normal ComfyUI install.

Inputs and outputs

  • samples - the LATENT to send. Wire your KSampler or LatentUpscale output in here.
  • filename_prefix - latents/LatentSender by default; note the subfolder, so temp doesn't get littered.
  • link_id - pairing number, default 0, must match the receiver. Convert it to an input and drive it from a primitive if you like.
  • preview_method - Latent2RGB-SDXL by default, 19 options. The tooltip says it best: this only affects the preview image, never the latent being transferred.

The output is samples (LATENT), passed through untouched. It's an output node, so it runs every queue whether or not anything downstream consumes it.

That preview_method dropdown is where the original had a nasty failure mode, and it's worth knowing because you'll read about it elsewhere: pick Latent2RGB-SDXL for a 64-channel model like Qwen-Image and the RGB factor matrix doesn't fit, surfacing as a shapes error. Here the sender checks the latent's channel count against the chosen format and silently swaps to one that works, logging which. If nothing fits you get a placeholder grey thumbnail - but the file is still .latent.png and the latent inside is byte-for-byte intact. A boring thumbnail never means the transfer failed.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/XWIDE/comfyui-x-wide-image-latent-sender-receiver

Restart ComfyUI and hard-refresh the page (Ctrl + F5) - the receiving end is JavaScript, and a cached page looks broken. Manager users: search X-WIDE Image Latent Sender / Receiver. No models, no pip install: the pack declares no dependencies, and the two libraries this path touches (piexif, safetensors) ship with ComfyUI. One wrinkle - the repo was renamed to add "latent" in October 2026, so the old URL redirects rather than 404s.

Where people get burned

Nothing survives a restart. Everything the pair passes lives in ComfyUI/temp/, which ComfyUI clears on start. Next session the receiver's filename points at nothing and you get an empty latent rather than a red node. Re-send and carry on.

Same one-run lag as the image pair. The receiver reads the filename it held when you pressed Queue, so a fresh send shows up on the following run - send on run one, use it from run two.

Give your pairs different ids. Every node here defaults to link_id 0, and senders fan out to all matching receivers. Image and latent events are separate, so nothing breaks with a shared number - you'll just confuse yourself.

A 64×64 blurry blob downstream means the receiver fell back to its empty 1×4×8×8 latent. That's "the file wasn't there", not a VAE problem.

CategoryX-WIDE/Latent

Inputs (4)

NameTypeDefaultDescription
samplesLATENT要发送的 latent。 / Latent to send.
filename_prefixSTRINGlatents/LatentSender保存到临时目录时用的文件名前缀。 / Filename prefix used in the temp folder.
link_idINT00–9223372036854776000配对编号:和 Latent Receiver 的 link_id 相同才会发过去。 / Pairing id: only the Receiver with the same link_id receives this latent.
preview_methodCOMBOLatent2RGB-SDXL预览图的解码方式(只影响预览图,不影响传递的 latent 本身)。 / How the preview image is decoded (it does not affect the latent itself).

Outputs (1)

NameTypeDescription
samplesLATENT—