沐阳 H3 · 二采重叠写入(内部)
Pass 2 doesn't need the anchor twice
- latent
- context_latent
- trim_frames
- masked_latent
There's a subtlety in the pack's second-pass path that costs people real time if they don't know it, and this node is the whole story.
Pass 1 needs explicit keyframe conditioning to establish continuity: the tail of the previous segment is registered as MiniMax keyframe anchors at the head of the next one. That's how the model knows what it's continuing from. Fine.
Pass 2 is already holding that established shot as its input latent. So registering the same high-resolution tail as keyframes again is redundant - and on H3 it isn't free, because keyframe rows are packed into the attention sequence. Doing it a second time inflates the packed sequence from segment 2 onward, which means a second pass that gets slower on every segment for no benefit. That's the bug this node was written to remove.
What it does instead
It copies the previous segment's tail latents straight into the target latent, blocks and all, and preserves them with a mask rather than with conditioning. Zero noise on the overlap. The source comment calls it exactly what it is: the zero-noise overlap is sufficient, because it preserves the exact tail and lets temporal attention carry it into the newly denoised frames. No new tokens.
Three required inputs:
latent- the target segment's latent for this pass.context_latent- the previous segment's latent, i.e. the tail you're carrying in.context_length- the window as an enum:"22"(default),"5","39","56". These are the four lengths that land on whole H3 latent steps, and the pack's README maps them to temporal blocks and to what they're good for: 22 frames (~0.92s) is the recommended starting point, 5 is an experimental speed anchor, 39 and 56 buy stronger continuity at rising token and trimming cost.
Two outputs: trim_frames (INT) - how many frames of head the overlap occupies, go wire it into the trim - and masked_latent (LATENT), which goes to the sampler.
The guards, and why they're welcome
It refuses on mismatched resolution, with a message that says so in plain language rather than producing a latent that decodes to garbage. This is the same constraint the README states as a limitation: resolution must stay constant between segments when continuity uses temporal latents. You can't mix a 832P pass 1 with a 1080P pass 2 and expect the seam math to work.
It also refuses when the overlap window is equal to or larger than the target segment - a target with no room left for new frames - rather than silently delivering a segment made entirely of borrowed frames. Both errors are the kind of thing you'd otherwise diagnose from a weird-looking output three steps later.
Category and install
沐阳 H3/内部 - internal. The Director and the long-video expansion wire it for you in second-pass configurations; you won't place it by hand unless you're building a custom two-pass graph. That said, if you are building one, this node is the difference between a second pass that composes cleanly with pass-1 continuity and one that fights it.
cd ComfyUI/custom_nodes
git clone https://github.com/civilcoco/ComfyUI-MiniMaxH3-Myang
Restart, hard-refresh the browser. No Python dependencies - the pack's dependency list is empty - but it does assume a recent ComfyUI with the official MiniMax H3 nodes.
The thing to take away
Two-pass upscaling on a chained video is where most long-form attempts fall apart, and it's rarely the upscaler's fault. It's that the second pass doesn't reproduce the conditions of the first. The pack makes the same argument elsewhere about its 复用文本/素材条件 option - rebuilding conditioning at the second-pass canvas re-fits reference images to a larger area, changes the reference token layout, and shows up as smearing and identity drift. Same lesson here: reuse what pass 1 established instead of re-deriving it. The long-video stitching problem has the general version of this, and it applies to every model family, H3 included.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | — | |
| context_latent | LATENT | — | |
| context_length | COMBO | 22 | 4 options: 22, 5, 39, 56 |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| trim_frames | INT | — |
| masked_latent | LATENT | — |