VaeZip: open-source codec stores VAE latent datasets 5-10x smaller with near-zero quality loss
TensorForger · reddit · 2026-10-17
A developer released VaeZip, an open-source PyTorch library tackling the fact that VAE latent datasets often take more space than the original data (JPEG/video codecs compress the source well, latents are nearly uncompressed).
How it works
- Implements several quantization codecs designed specifically for VAE latents, exploiting spatial redundancy and the roughly normal latent distribution;
- The best codec combines global/local range scaling with a Lloyd-Max codebook tuned per sample distribution, quantizing values to 2-8 bits and packing them;
- Achieves 3 bits/value (10x smaller files) with decoded pixel MSE of just 0.0003;
- Stores results in standard Safetensors files.
Validation
- Codecs were selected from a benchmark comparing 50 algorithms across 8 image and video VAEs (reconstruction quality, fidelity, space, I/O latency);
- Pretraining a small T2I flow-matching DiT on 6-bit-compressed latents gives a loss curve indistinguishable from the fp32 baseline.
Use case is narrow but valuable when latent datasets are too large for local disk and require costly S3 storage.
More from Infra
- ExecuTorch is now an official Zephyr module, bringing PyTorch models to MCUs via west — PyTorch · 2026-10-17
- AMD shows OCP OAC accelerator cards with up to 5000W liquid-cooled designs — wkmyrhang · 2026-10-17
- Fixing Omarchy install on ASUS laptops when UEFI NVRAM is full, with Codex's help — GuyHachmon · 2026-10-17
- fx v0.0.14 ships durable agents: same API survives crashes on laptop, cloud via Vercel — cramforce · 2026-10-17
- VM filesystem sharing still painful: virtiofs costs too much with live migration — davidcrawshaw · 2026-10-17
- MicroVM shared-fs prototyping: NFS cuts throughput in half, IOPS to 20% — zeeg · 2026-10-17