🔗 H3 Relay · Latent Save
Save the latent, not the mp4 — the handoff that makes H3 continuation lossless
- latent
- latent
- path
Every segment of a relay run ends by handing something to the next segment. H3RelayLatentSave decides what that something is: the finished AV latent, written to output/relay_kit/<run_id>/stage_NNNNN.safetensors. Not a frame, not an mp4 - the actual packed latent the sampler produced, at full precision.
That choice is the whole reason the pack can claim zero re-encoding. The next segment's Copy Bridge will splice this exact tensor into its own head, bit for bit. If you'd gone via pixels, the tail would have been decoded, quantised to 8-bit video, then re-encoded through the VAE - three lossy steps before it even reached the sampler. Here there are none. You also get perfect reproducibility: the same saved latent produces the same continuation, which isn't true of a pixel round-trip.
The cost is disk, and it's small: about 12 MB per segment for the latent sidecar. Let it accumulate.
Inputs and outputs
Required: latent, run_id, stage_index, note.
latent- pull it from your sampler's latent output. The pack deliberately binds to no particular sampler: the officialSamplerCustomAdvancedworks, and so do the third-party progressive samplers people run for H3. One rule, and it's the one people break: if you're doing the two-pass "sample → upscale → sample again" route, tap the first pass. The continuation contract lives in the native resolution domain. Save the upscaled second-pass latent and the next segment's bridge will splice SR-domain data into a native-domain window, then upscale it again - double drift, and a shape mismatch is likely.run_id- the film's name, e.g.myfilm. Must match the bridge and Latent Load exactly. This also names the folder, so reusing a name across films overwrites same-numbered stages. New film, new name.stage_index- 0 for the first segment, 1 for the second, and so on. It has to agree with the bridge's value. On the canvas the Chain node advances them together; do it by hand and you'll get it wrong eventually.note- free text, written into the file's metadata. Cheap, and genuinely useful three weeks later when you have four versions of the same stage and no memory of which window size you used.
Outputs: latent (a pass-through, so you can keep the sampler's output flowing downstream without re-tapping) and path (STRING - the file it actually wrote). Wire path to a display node if you want to confirm where things landed.
It's registered as an output node, meaning it executes even with nothing attached downstream. That matters: the sidecar has to be written for later segments to read, and a node whose output nobody consumes would otherwise be pruned from the run.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/ZenHG/ComfyUI-H3-Latent-Relay.git
Or ComfyUI Manager → Custom Nodes Manager → search h3-latent-relay (registry id, no "ComfyUI" prefix). Restart the backend afterwards - restarting the Python process, not just refreshing the tab.
No models to download for this node. safetensors is imported lazily inside the save/load functions rather than at module top, so a broken safetensors install lets the pack register and only fails at the moment of writing. torch is imported at module top, so a broken torch means none of the eight nodes appear at all - check the startup log for an import failure if the 🔗 H3 Relay category is empty.
Where it goes wrong
"wrote to a folder you didn't expect" is almost always a stale run_id in one of the six places that carry it. The pack's front-end syncs run_id within a canvas group, and since 0.6.19 it refuses to run when it finds two different names in the group rather than guessing one - because a wrong run_id drops your stage files in the wrong directory, which is far harder to trace than an error message.
Nothing to continue from. Run the stages in order and don't skip numbers; Latent Load resolves stage_index − 1, so a hole in the sequence is a hard stop.
Host too old. If your ComfyUI predates MiniMax-H3 support, this node will happily write files and the continuation will quietly not happen. The pack's banner and /h3relay/health endpoint both check for it, which is worth a glance on first install.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | 【接法】接本段采样器的 latent 输出,存成文件给下一段接力。 ⚠ 走「采样 → 放大 → 再采样」时接第一次采样的输出,别接放大后的。 | |
| run_id | STRING | relay | 【填什么】片名,例如 myfilm。 ⚠ 必须与 Copy Bridge 一字不差,否则找不到文件。换片必须换名(同名会覆盖旧文件)。 |
| stage_index | INT | 00–9999 | 【填什么】第 1 段填 0,第 2 段填 1…… ⚠ 必须与 Copy Bridge 相同(用 Chain 节点可自动改)。 |
| note | STRING | 【可留空】随手写个备注,便于事后分辨版本。 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |
| path | STRING | — |