Nodes/ComfyUI-MiniMax-H3-LongMedia/MiniMax H3 • Replace Stream
ComfyUI Node

MiniMax H3 • Replace Stream

Swap one half of an H3 clip without regenerating the other

By vizart-vj·Created 14 days ago·Updated 2 days ago· 71
MiniMax H3 • Replace Stream
  • av_latent
  • replacement
  • av_latent
fit_mode
alignment
denoise0.00
stream

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: video or audio. 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) - strict is lossless: both streams must already match, and it errors otherwise. crop_pad center-crops/pads spatially and uses alignment (start / end / center) for time. If you're replacing audio in a clip of a slightly different length, crop_pad is 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.

CategoryMiniMax H3/LongMedia/Streams

Inputs (6)

NameTypeDefaultDescription
av_latentLATENT
replacementLATENT
fit_modeCOMBO2 options: strict, crop_pad
alignmentCOMBO3 options: start, end, center
denoiseFLOAT0.000–10 preserves the replacement exactly; 1 fully denoises it.
streamCOMBO2 options: video, audio

Outputs (1)

NameTypeDescription
av_latentLATENT