minimax_h3_audio_vae ¶
MiniMax-H3 audio VAE (DAC encoder + BigVGAN decoder) for Apple Silicon MLX.
Faithful port of fastvideo/models/vaes/minimax_h3_audio.py:
- Encoder: plain-Snake residual units (dilations ⅓/9), strided down-sampling blocks, then the attention projection block — causal multi-head attention over the latent stream with q/v biases and a forced zero k bias, head averaging, average pooling into
latent_channelsstreams, output projection, and a GeGLU MLP. - Decoder: 1x1 projection back to the trunk width, BigVGAN with weight-normalized ConvTranspose1d upsampling, AMP residual blocks with SnakeBeta behind alias-free Kaiser-window up/down sampling, final SnakeBeta
- conv, and the [-1, 1] clamp.
- Kaiser-window low-pass filters exactly as released; released filter buffers are used when present so numerics do not depend on window construction.
Waveforms are float32 in [-1, 1] at 32 kHz. Stereo latents (2, 32, N) decode independently while preserving channel order and duration. Production code never imports PyTorch; torch parity references live only in tests.
Classes¶
fastvideo.mlx_runtime.minimax_h3_audio_vae.MLXMiniMaxH3AudioVAE ¶
MLXMiniMaxH3AudioVAE(weights: dict[str, Any], config: MiniMaxH3AudioVAEConfigView, *, include_encoder: bool = True)
DAC-style posterior encoder plus BigVGAN waveform decoder.
Source code in fastvideo/mlx_runtime/minimax_h3_audio_vae.py
Methods:¶
fastvideo.mlx_runtime.minimax_h3_audio_vae.MLXMiniMaxH3AudioVAE.decode ¶
Latents (B, 32, N) -> waveforms (B, 1, S) clamped to [-1, 1].
Source code in fastvideo/mlx_runtime/minimax_h3_audio_vae.py
fastvideo.mlx_runtime.minimax_h3_audio_vae.MLXMiniMaxH3AudioVAE.encode ¶
Mono waveform (1, 1, S) -> posterior mean/logvar each (1, C, N).
Source code in fastvideo/mlx_runtime/minimax_h3_audio_vae.py
fastvideo.mlx_runtime.minimax_h3_audio_vae.MiniMaxH3AudioVAEConfigView dataclass ¶
MiniMaxH3AudioVAEConfigView(encoder_dim: int = 64, encoder_rates: tuple[int, ...] = (2, 4, 4, 5, 5), latent_dim: int = 2048, latent_channels: int = 32, num_attention_heads: int = 8, decoder_dim: int = 1024, decoder_rates: tuple[int, ...] = (5, 5, 2, 2, 2, 2, 2), decoder_kernel_sizes: tuple[int, ...] = (9, 9, 4, 4, 4, 4, 4), resblock_kernel_sizes: tuple[int, ...] = (3, 7, 11), resblock_dilation_sizes: tuple[tuple[int, ...], ...] = ((1, 3, 5), (1, 3, 5), (1, 3, 5)), sampling_rate: int = 32000, latents_mean: tuple[float, ...] | None = None, latents_std: tuple[float, ...] | None = None)
Architecture constants (defaults mirror the released audio_vae/config.json).
Functions:¶
fastvideo.mlx_runtime.minimax_h3_audio_vae.kaiser_sinc_filter1d ¶
NumPy replica of the released Kaiser-windowed sinc low-pass.
Source code in fastvideo/mlx_runtime/minimax_h3_audio_vae.py
fastvideo.mlx_runtime.minimax_h3_audio_vae.mlx_h3_audio_vae_from_dir ¶
mlx_h3_audio_vae_from_dir(component_dir: str | Path, *, include_encoder: bool = True, storage_dtype: str = 'fp32') -> MLXMiniMaxH3AudioVAE
Load from the released component directory (audio_vae/).
Source code in fastvideo/mlx_runtime/minimax_h3_audio_vae.py
fastvideo.mlx_runtime.minimax_h3_audio_vae.mlx_h3_audio_vae_from_file ¶
mlx_h3_audio_vae_from_file(weights_path: str | Path, *, include_encoder: bool = True, config: MiniMaxH3AudioVAEConfigView | None = None, component_dir: str | Path | None = None) -> MLXMiniMaxH3AudioVAE
Load the released audio VAE from its single safetensors file.
The released checkpoint is ~605 MB fp32; it is read whole (bounded) and kept at release precision.