Nodes/ComfyUI_JR_MiniMaxH3Node/JR MiniMax H3 AV Latent Builder
ComfyUI Node

JR MiniMax H3 AV Latent Builder

How to weld separate video and audio latents back into one H3 AV latent

By Goldlionren·Created 21 days ago·Updated about 10 hours ago· 28
JR MiniMax H3 AV Latent Builder
  • video_latent
  • audio_latent
  • latent
  • status

MiniMax H3 is an omni-modal model: the thing you sample isn't just a video latent, it's a packed two-stream latent with a video stream and an audio stream living in one NestedTensor. ComfyUI's native H3 nodes hand you that packed latent directly, so most people never think about the seams. But the moment you want video-to-video or latent-to-latent work - encode a source video, edit the latents, sample - you're holding separate video and audio latents and you need a way to put them back together into the shape the H3 sampler expects. That's the entire job of the JR MiniMax H3 AV Latent Builder.

It's a strict validator with a welding step, not a VAE encoder, not a file reader, not an audio processor, and definitely not a sampler. You feed it video_latent and audio_latent that you've already encoded with the H3 VAE nodes, it checks that everything lines up, and it wraps them into the official two-stream NestedTensor LATENT. The validation is the useful part: it insists the video latent is [B,24,T,H,W] and the audio latent is [B,32,2,T_audio], with matching batch, dtype and device, and all-finite values. Video and audio latent lengths differ by design - the video ticks on H3's T=5k+2 grid (which maps to 17k+5 frames at 24fps) while audio runs at 40 latent ticks per second with a ±1 tick tolerance for encoder boundary differences. It won't clone, cast, or move your tensors; it validates and wraps.

Outputs and wiring

  • latent (LATENT) - the packed AV latent, ready for the H3 sampler or the Temporal Chunk Sampler.
  • status (STRING) - validation result you can log or glance at.

The natural chain is the reverse of the Split node: IMAGE → H3 Video VAE Encode → video_latent and AUDIO → H3 Audio VAE Encode → audio_latent, both into this builder, then into sampling. The README also shows the round-trip trick: you can Save Latent the two split streams, Load Latent them later in a different workflow, and rebuild the official AV latent here - that's how you persist a partial-generation state across sessions.

Install

Part of the ComfyUI_JR_MiniMaxH3Node pack:

cd ComfyUI/custom_nodes
git clone https://github.com/Goldlionren/ComfyUI_JR_MiniMaxH3Node
<your-comfyui-python> -m pip install -r ComfyUI_JR_MiniMaxH3Node/requirements.txt

or ComfyUI Manager → search ComfyUI_JR_MiniMaxH3Node. Same Python as ComfyUI, restart, hard-refresh.

Troubleshooting

  • Shape errors on the audio side. [B,32,2,T] is the strict contract. If your audio latent came from a non-H3 encoder or an odd batch, it will (correctly) refuse. Re-encode through the H3 Audio VAE.
  • "Batch / dtype / device mismatch." Both streams must agree. If you moved one stream to CPU or cast it, put them back on the same device and dtype before building.
  • A sampler error right after a successful build. The builder validated the seam; if sampling still fails, check the video latent's time grid - T must fit 5k+2. This is usually an encoder-side problem, not a builder one.
CategoryJR MiniMax H3/Latent

Inputs (2)

NameTypeDefaultDescription
video_latentLATENT
audio_latentLATENT

Outputs (2)

NameTypeDescription
latentLATENT
statusSTRING