docs/source/en/api/models/autoencoderkl_minimax_h3.md
The video variational autoencoder (VAE) model with KL loss used in MiniMax-H3 by MiniMax. It pairs a causal 3D CNN encoder with a non-causal ViT decoder and compresses 16x spatially and 4x temporally.
Three things set it apart from most autoencoders in the library:
scaling_factor: a pipeline encodes with (latent - latents_mean) / latents_std and decodes with latent * latents_std + latents_mean.[0, 1] base range, not the usual [-1, 1]. encode expects (pixel - imagenet_mean) / imagenet_std and decode returns values in that same space, so a pipeline applies sample * imagenet_std + imagenet_mean and clamps to [0, 1] before postprocessing.enable_tiling to change the tile geometry and disable_tiling to switch it off.The temporal geometry is fixed by clip_length (17 pixel frames per encoder chunk) and token_drop (3 trailing latent frames dropped per encode), so 17 * n + 5 pixel frames map to 5 * n + 2 latent frames.
import torch
from diffusers import AutoencoderKLMiniMaxH3
vae = AutoencoderKLMiniMaxH3.from_pretrained(
"MiniMaxAI/MiniMax-H3", subfolder="vae", dtype=torch.float32
).to("cuda")
[[autodoc]] AutoencoderKLMiniMaxH3 - encode - decode - all