LanPaint MiniMax Audio Encode
The correct way to get audio into MiniMax H3's audio VAE
- audio
- vae
- latent
MiniMax H3's audio VAE has a particular idea about how audio should be arranged, and if you feed it audio in ComfyUI's usual layout it will happily hand you garbage. LanPaint_MiniMaxAudioEncode exists so you don't have to learn what "channels-last" means the hard way.
This is the small, unglamorous node buried inside LanPaint's MiniMax H3 AV pipeline. Its whole job: take an AUDIO track and encode it into a latent with the H3 audio VAE, correctly. ComfyUI carries audio as [B, C, L] - batch, channels, samples - while the H3 VAE wrapper expects channels-last [B, L, C] and converts internally. This node does that transposition for you, exactly like ComfyUI's own VAEEncodeAudio does, and then adds one more convenience: it upmixes mono to stereo, because the H3 audio VAE expects a stereo input. It also resamples the waveform to the VAE's rate (32 kHz) if your source is at a different sample rate.
The inputs
- audio - the audio track to encode. Resampled to the VAE's rate if needed.
- vae - the MiniMax H3 audio VAE. Not the video VAE, not a text VAE - the audio one.
Output is a single latent, ready to feed a sampler.
How it fits the AV pipeline
A deliberate design choice: this node does not attach an inpainting mask. Audio inpainting masks come from the VideoMaskEditor, and the workflow attaches them to the latent with a standard SetLatentNoiseMask. So the flow is: VideoMaskEditor → (audio out) → MiniMaxAudioEncode → SetLatentNoiseMask → sampler. In the all-in-one AV path you don't even touch this node directly - LanPaint_AVEncode calls the same encode internally, which is exactly why both exist.
Install
Part of the LanPaint pack - ComfyUI Manager → search "LanPaint", or:
cd ComfyUI/custom_nodes
git clone https://github.com/scraed/LanPaint
then restart. The pack has no required pip dependencies, but the resample path needs torchaudio; without it, feeding audio at a non-32 kHz rate raises an error instead of converting. And you need the H3 model's audio VAE downloaded, which comes with the MiniMax H3 setup rather than this repo.
Worth knowing before you reach for it: this node is useful almost exclusively inside the MiniMax H3 audio inpainting stack. For plain audio that isn't being inpainted, ComfyUI's stock VAEEncodeAudio is the same thing minus the stereo upmix. Grab this one when you're building an H3 AV workflow and want the layout handled for you.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | The audio track to encode (resampled to the VAE's rate if needed). | |
| vae | VAE | The MiniMax H3 audio VAE. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| latent | LATENT | — |