KVAE 3.0: Video tokenizer

KVAE-3D-3.0 is a causal video variational autoencoder for latent diffusion. It encodes RGB video into 128-channel continuous latents with 4Γ— temporal downsampling and 32Γ— downsampling along each spatial axis. Its fully convolutional architecture combines higher spatial compression with V-JEPA feature alignment for downstream generation.

Model zoo

Compression is shown as H Γ— W for images and T Γ— H Γ— W for videos. For audio, it is the number of waveform samples per latent timestep; both audio models operate at 48 kHz.

Current models

Model Modality Compression Latent channels
KVAE-Image 3.0 Image 8 Γ— 8 32
KVAE-Video 3.0 Video 4 Γ— 32 Γ— 32 128
KVAE-Audio-Stereo Stereo audio 960 128

Previous models

Model Modality Compression Latent channels
KVAE-Video 2.0 t4s8 Video 4 Γ— 8 Γ— 8 16
KVAE-Video 2.0 t4s16 Video 4 Γ— 16 Γ— 16 64
KVAE-Video 1.0 Video 4 Γ— 8 Γ— 8 16

Architecture and training

KVAE-3D-3.0 increases spatial compression from the f16t4 design of KVAE-3D-2.0 to f32t4. The encoder adds a downsampling stage, the decoder adds a corresponding upsampling stage, and both include additional residual blocks. The architecture remains fully convolutional and supports full-frame inference.

Training aligns the latent representations with V-JEPA features. The decoder is fine-tuned using both images and video clips, with higher-resolution refinement producing better results.

Inference

Run from the KVAE source repository root with the KVAE 3.0 code. The reference environment uses Python 3.11, PyTorch 2.8.0, and CUDA 12.8.

pip install -r requirements.txt
import torch

from data import VideoReader
from data.video_dataset import TruncVideo
from kvae import KVAEVideo

device = torch.device("cuda:0")
dtype = torch.bfloat16

model = (
    KVAEVideo.from_pretrained("kandinskylab/KVAE-3D-3.0", strict=True)
    .eval()
    .to(device=device, dtype=dtype)
)

reader = VideoReader(
    stream_pattern="*.png",
    input_norm="m11",
    transform=TruncVideo(spatial_compression=32, temporal_compression=4),
)
video = reader.read_video("path/to/video.mp4")["frames"].unsqueeze(0)
video = video.to(device=device, dtype=dtype)

with torch.no_grad():
    latent = model.encode(video, seg_len=16).latent_dist.mode()
    reconstruction = model.decode(latent, seg_len=16).clip(-1, 1)

input_norm="m11" converts pixel values using pixel / 128 - 1. TruncVideo(32, 4) crops height and width to multiples of 32 and keeps 4n + 1 frames.

Temporal segments are processed through internal block caches. Do not process independent videos concurrently or interleave their chunks on the same model instance. Use a separate KVAEVideo instance for each concurrent stream.

Per-channel latent normalization

from_pretrained loads the checkpoint's per-channel statistics into model.latent_mean and model.latent_std together with the weights. With normalization enabled, encode returns the posterior in normalized coordinates, z_normalized = (z_raw - latent_mean) / latent_std; decode reverses this transform before reconstruction.

KVAE-Video 3.0 enables normalization by default through model.latent_normalization.enabled in config.json. Omitting use_latent_norm or passing None follows this default. To override it, use the same flag in both calls:

with torch.no_grad():
    # Use the per-channel statistics loaded from the checkpoint.
    latent = model.encode(video, use_latent_norm=True).latent_dist.mode()
    reconstruction = model.decode(latent, use_latent_norm=True).clip(-1, 1)

    # Work with raw latents, without normalization.
    latent = model.encode(video, use_latent_norm=False).latent_dist.mode()
    reconstruction = model.decode(latent, use_latent_norm=False).clip(-1, 1)

Evaluation

Reconstruction

Reconstruction is evaluated on MCL-JCV (720p).

PSNR and SSIM are higher-is-better; LPIPS is lower-is-better. Bold indicates the best result for each metric.

Tokenizer PSNR (dB) ↑ SSIM ↑ LPIPS ↓
FLUX.3-Action 32.79 0.878 0.181
MiniMax-H3 32.44 0.877 0.176
KVAE-3D-3.0 32.26 0.878 0.161

Generation

Video generation models are trained first on images and then on videos, using the causal tokenizer across both stages. The figure compares human preference shares for generators using KVAE-3D-3.0 and MiniMax-H3 VAE.

Both-good ratings give half credit to each system; both-poor ratings are excluded. The generation setups use different latent patches: 1 Γ— 1 for KVAE and 2 Γ— 2 for MiniMax-H3, resulting in 128- and 96-dimensional input vectors, respectively.

Human preference shares for generators using KVAE-3D-3.0 and MiniMax-H3 VAE

Downloads last month
-
Safetensors
Model size
1B params
Tensor type
F32
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including kandinskylab/KVAE-3D-3.0

Paper for kandinskylab/KVAE-3D-3.0

Article mentioning kandinskylab/KVAE-3D-3.0