MiniMax H3 • Replace Stream
Swap one half of an H3 clip without regenerating the other
- av_latent
- replacement
- av_latent
H3's AV latent holds video and audio in one tensor, and that's exactly why you need a node like this. Replace Stream lets you swap out one stream - video or audio - while leaving the other untouched. It's the successor that absorbed the old per-stream Replace Video and Replace Audio nodes (both deprecated), and it's the tool for the most common latent-edit: "keep my generated pictures, put in my soundtrack" or "keep my audio, put in new pictures."
The inputs that matter
av_latent- the H3 AV latent you're editing.replacement- the latent for the new stream. For audio, that's the output of Encode Audio Stream; for video, Encode Video Stream. Raw AUDIO or IMAGE won't work - it has to be in H3's VAE latent space.stream- the selector:videooraudio. This is the field that didn't exist on the old per-stream nodes; it's the whole reason they were consolidated.fit_mode(strict/crop_pad) -strictis lossless: both streams must already match, and it errors otherwise.crop_padcenter-crops/pads spatially and usesalignment(start/end/center) for time. If you're replacing audio in a clip of a slightly different length,crop_padis your friend.denoise(default 0) - how much the replacement gets re-denoised during sampling. 0 preserves it exactly, which is the right call for a voiceover or reference you want verbatim. 1 fully regenerates it.
One output: the modified av_latent.
How it fits
This is the "surgical edit" tier of the pack. In a typical swap workflow: generate a clip with H3's generated audio, encode your real soundtrack with Encode Audio Stream (connect the packed latent to its target_av input so the duration matches), then Replace Stream with stream=audio and denoise=0. Sample or decode, and the video comes through untouched while the audio is now yours. The reverse - replacing video while keeping audio - is the same node with stream=video, which is how you'd inject a different visual take under an existing track.
Install
Ships in ComfyUI-MiniMax-H3-LongMedia. Manager search "MiniMax-H3-LongMedia", or:
cd ComfyUI/custom_nodes
git clone https://github.com/vizart-vj/ComfyUI-MiniMax-H3-LongMedia
restart, with the H3 checkpoint + both VAEs on hand (MiniMaxAI/MiniMax-H3, ~42.5 GB, community license excludes US/EU/UK/Korea).
Troubleshooting
If strict errors, your replacement stream doesn't match the target geometry or duration - that's the node being honest, not broken; switch to crop_pad or fix the encode. If the swapped-in stream still gets overwritten downstream, check whether the sampler is regenerating that stream afterward (an audio_mode=generate setting will happily re-make the audio you just inserted). And if you get a cryptic error about channels or NestedTensor, verify your replacement actually came from Encode Video/Audio Stream - a plain latent from an SD-style VAE has the wrong channel count and will be rejected.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| av_latent | LATENT | — | |
| replacement | LATENT | — | |
| fit_mode | COMBO | 2 options: strict, crop_pad | |
| alignment | COMBO | 3 options: start, end, center | |
| denoise | FLOAT | 0.000–1 | 0 preserves the replacement exactly; 1 fully denoises it. |
| stream | COMBO | 2 options: video, audio |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| av_latent | LATENT | — |