Nodes/H3 Latent Relay/🔗 H3 Relay · Copy Bridge
ComfyUI Node

🔗 H3 Relay · Copy Bridge

The node that makes MiniMax H3 segments actually continue each other

By ZenHG·Created about a month ago·Updated 2 days ago· 36
🔗 H3 Relay · Copy Bridge
  • latent
  • anchor_latent
  • conditioning
  • ref_anchor_latent
  • voice_anchor
  • context_latent
  • latent
  • report
  • trim_frames
  • conditioning
◄context_frames22►
◄mask_modehard►
◄taper_tokens4►
◄seam_min0.10►
◄pin_audiotrue►
◄ramp_top0.25►
◄ramp_tokens0►
◄anchor_blend1.00►
◄blend_top0.50►
◄blend_tokens0►
◄blend_shapesmoothstep►
◄window_top0.50►
◄window_shapesine►
◄run_idrelay►
◄stage_index0►
◄ref_anchor_stage-1►
◄ref_anchor_frames5►
◄audio_ref_seconds0.0►
◄voice_anchor_stage-1►
◄exp_anchorauto►

By default, if you want segment 2 to pick up where segment 1 ended, you do pixel continuation: decode the mp4, encode the last frame back through the VAE, and feed that as an anchor keyframe. Three costs: the round-trip is lossy; the anchor and the sampling latent are different kinds of object, so the continuation drifts; and you can only anchor frame 0.

H3RelayCopyBridge takes the other road. MiniMax H3 generates picture and audio as one packed AV latent, and ComfyUI's H3 support exposes a native minimax_keyframes channel that accepts anchors at any resolved frame index. So instead of re-encoding anything, the bridge copies the previous segment's latent tail bit for bit into the head of the current segment's initial latent, and writes a noise mask over that region. Pinned means zero redraw: those rows get their velocity scaled by the mask and never get re-sampled. Nothing is decoded - the only disk artifact is a ~12 MB latent sidecar per segment.

This is the pack's one bridge. Since 0.6.0 the old conditioning-only route was folded in as a second, parallel path - the two act on different objects (latent vs conditioning), so they don't conflict:

| | [0] latent copy (motion) | [3] conditioning pin (framing) | |---|---|---| | mechanism | bit-exact tail copy, pinned rows zero redraw | tail pinned into conditioning, model redraws | | blur on reproduce | none | yes | | brightness step at seam | large (~0.040) | small (~0.004) |

Connect both and you get the copy route's zero-blur with the pin route's low brightness step: measured at 0.3 MP, the seam brightness step is 0.0009 with the composite bridge vs 0.0097 with conditioning alone, about 11× better.

Wiring it

Required: latent (this segment's initial AV latent, from the official loader or the pack's own), context_latent (the previous segment's full latent, from Latent Load), context_frames.

Connect context_latent on segment 1 too. Latent Load hands over an empty context when stage_index is 0 and the bridge passes through automatically - no continuation, no trimming. Bypassing the wire because "there's no previous segment" removes a required input, and the whole prompt gets rejected with Required input is missing.

context_frames default 22. The H3 VAE's temporal kernel is (1,4,4,4,4) - five latent tokens span seventeen pixel frames - so only 5 + 17k windows are legal: 5, 22, 39, 56, 73, 90, 107, 124. Off-grid values raise rather than snapping, because a misaligned window renders a spatially shifted seam. It must also be smaller than the segment length.

Outputs: latent → your sampler's latent input (it must go through the bridge), trim_frames (INT) → Trim AV's trim_frames, conditioning → the sampler's positive, report.

mask_mode stays hard for real work. ramp, blend, window and taper exist, and the author's note is blunt: a retest with better metrics found all four modes still jump at the seam, they just fail differently - hard keeps framing but spikes the motion, ramp/blend smooth the motion and rewrite the framing. Tuning the mask alone doesn't fix a seam; that's why the composite bridge exists.

Optional extras that earn their slot: pin_audio (on - carries the previous segment's audio tail into this segment's audio latent as sampling context), ref_anchor_stage/ref_anchor_latent (a global appearance anchor riding every step at near-zero noise, an attention sink against long-range drift), and voice_anchor - feed a LoadAudio → VAEEncodeAudio latent of this segment's speaker, ≥0.9 s, and timbre stops cross-contaminating across a speaker change. An empty or silent anchor raises immediately; to disable it, unplug the wire, don't hand it a zero latent.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/ZenHG/ComfyUI-H3-Latent-Relay.git

Or ComfyUI Manager → search h3-latent-relay. Restart the backend. The hard requirement is the host, not a pip package: ComfyUI ≥ 0.35.0 with the MiniMax-H3 extras. On an older host the nodes still register and the seam is silently not continued, which is the worst possible outcome - you only catch it by looking. The pack prints an explicit banner line if H3 support is missing.

The two failures you'll actually hit

A shape mismatch deep inside the model means the anchor grid doesn't match the target grid. minimax_keyframes is computed against the target spatial grid - so if you ran a latent upscale before the bridge and then connected conditioning, you get something like shape mismatch [2392,96] vs [3134,96]. Only the native-resolution pass connects the bridge's conditioning; the second pass's guider takes the prompt encoder's positive directly, and the latent-side pin (prefix copy + noise mask) is grid-agnostic and still works.

"stage_index=N says this is segment N+1 but there's no previous segment to continue" - the run_id and stage_index on the save and the load don't agree, or you changed films without renaming. Both are hard errors, deliberately. One caveat: this pack is new, from a single author, and there's no community folklore for it yet - the H3 ecosystem itself only dates from August 2026. The tooltips are long and mostly measurements, which is more than most packs give you. Read them.

CategoryH3 Latent Relay

Inputs (26)

NameTypeDefaultDescription
latentLATENT【接法】本段的初始 AV latent(潜空间构造节点的输出)。 它把上一段的尾部写进开头,并附上噪声掩码。
context_framesINT225–124【拷贝窗帧数】写进本段开头的帧数。 只认 5+17k(5/22/39/56/73/90/107/124),必须小于本段帧数。 窗越长接缝越稳,留给新内容的帧越少。
mask_modeoptCOMBOhard【掩码模式】每个像素用多少模型生成、多少用上一段。 · hard(推荐,默认)= 整窗都用上一段、不重绘 —— 真续接用它。 · ramp / window = 接缝处松一点,取景可能被改写。 · taper / blend = 仅对照。 · m = 0 才是全用上一段;四个非 hard 档都会跳。
taper_tokensoptINT41–12【渐缩档】只在 taper 档生效:接缝前多少个 token 参与线性过渡。
seam_minoptFLOAT0.100–1【渐缩档】只在 taper 档生效:接缝端的掩码下限。 0 = 完全用上一段;0.3 = 这里留 30% 给模型重绘。 本段开头始终全重绘,这一档管不到它。
pin_audiooptBOOLEANtrue【复制音频】开(默认)= 上一段的声音也复制过来。 只想复制画面时关掉;能听的拼接仍由 Trim AV 与拼接步骤负责。
ramp_topoptFLOAT0.250–1【斜坡档】只在 ramp 档生效:接缝处最多让模型改多少。 0 = 变成 hard;越大接缝越协调,但噪声落差越陡。 想调大就同时加长拷贝窗。
ramp_tokensoptINT00–12【斜坡档】只在 ramp 档生效:接缝处参与斜坡的 token 数。 0 = 铺满整个拷贝窗;2~3 = 只松接缝、锁住运动。
anchor_latentoptLATENT【统计纠偏,可选】全局外观参考段(通常第 1 段)的 AV latent。 接上后:被裁掉的前缀会被拉向参考段的色档与方差 ⇒ 本段新内容回到全局色档。治「越跑越偏色」。
anchor_blendoptFLOAT1.000–1【纠偏强度】0~1:把开头拉向参考段的比例。 1 = 全量(默认),0.5 = 一半;参考段与本段允许有差异时调低。 不接参考 latent 时无效。
blend_topoptFLOAT0.500–1【混合档】只在 blend 档生效:接缝处模型占比的上限。 0 = 变成 hard;越大越信任本段自己的生成。 建议从 0.5 起。
blend_tokensoptINT00–12【混合档】只在 blend 档生效:接缝处参与混合的 token 数。 0 = 整个拷贝窗;2~3 = 只混接缝。
blend_shapeoptCOMBOsmoothstep【混合档】只在 blend 档生效:混合窗形。 smoothstep = 多项式(默认);hann = 余弦。 两者两端变化率都为 0 ⇒ 过渡更柔和。
window_topoptFLOAT0.500–1【窗口档】只在 window 档生效:窗的峰值(中间最松)。0 = 变成 hard。 与斜坡相反:接缝两端回落到低位 ⇒ 接缝保持复制。 太大会把取景交还给模型。
window_shapeoptCOMBOsine【窗口档】只在 window 档生效:窗形。 sine = 两端低但不是 0(默认);hann = 两端严格为 0(两端都复制)。
conditioningoptCONDITIONING【可选】接上后,采样条件里也追加这些复制帧。 它管取景和构图,与 latent 复制窗同时生效;不接 = 只做拷贝桥。 ⚠ 第 4 路输出要接到采样器的 positive。
run_idoptSTRINGrelay【填什么】片名,与 Latent Save 一致。 填了才能用下面两个「只填段号」的参考(它们靠它找段文件)。
stage_indexoptINT00–9999【填什么】本段段号(第 1 段 = 0)。 与 run_id 一起用于自动读参考,也要与保存一致。
ref_anchor_latentoptLATENT【外观参考·接线】全局外观参考(通常第 1 段)的 AV latent,直接接线喂进来。 每一步都拿它当几乎无噪的基准来对齐,压住长程漂移(越跑越偏色、偏构图)。
ref_anchor_stageoptINT-1-1–9999【外观参考·免接线】只填段号,不用接线。 ≥ 0 = 没接 ref_anchor_latent 时自动读 stage_<该值>;-1(默认)= 关。 ⚠ 必须小于本段段号(参考得是跑完的段)。
ref_anchor_framesoptINT51–64【外观参考·取多少】从参考段开头取几帧。 默认 5;取多了会把参考段的动作也拖进来。
audio_ref_secondsoptFLOAT0.00–30【音频参考窗】0(默认)= 自动。 从上一段尾部往前累计够 2 秒有声就停(上限 6 秒)。 窗里可含多个说话人的音色;只占官方 3 个音频槽里的 1 个。 标题的 `refs n/3` = 额度:`⚠` 越界、`?` 读不到。 ⚠ 参考里就是上一段的台词,可能被复述;接了声音参考时本项不生效。
voice_anchoroptLATENT【声音参考·接线】接说话人的音频(LoadAudio → 音频编码)。 接上后:复制过来的音频开头和音频参考都改用它的尾部,不再取上一段。 · 谁接:接缝后第一个开口的人;同一个人不必接,换人才接。 ⚠ 复制音频关闭时无效;全零 / 常量 / 静音的参考会当场报错。
voice_anchor_stageoptINT-1-1–9999【声音参考·免接线】只填段号,不用接线。 ≥ 0 = 没接 voice_anchor 时自动读 stage_<该值> 的音频;-1(默认)= 关。 ⚠ 必须小于本段段号;接了 voice_anchor 时本档不生效。
exp_anchoroptCOMBOauto【实验·默认 auto】两个实验的总开关:按人累积音色 / 时不变历史参考。 · auto(默认)= 与旧版一致:看 run 目录的配置文件,有就开。 · off = 显式关(文件在也不开,报告会点名)。 · 其余 = 显式开;缺配置文件直接报错。 ⚠ 两者都是未实测的实验件。
context_latentoptLATENT【接法】上一段的完整 AV latent。 不接也行:留空 = 桥按片名与段号−1 自己从磁盘取(少接一根线)。 接了 = 以接线为准;第 1 段空包照旧直通。

Outputs (4)

NameTypeDescription
latentLATENT—
reportSTRING—
trim_framesINT—
conditioningCONDITIONING—