Views
No views yet
predict_class(latents) exposes that class-token
feature directly from latents.| Model | Mean PSNR (dB) | Std (dB) | Median (dB) | P5 (dB) | P95 (dB) |
|---|---|---|---|---|---|
| dinac_ae | 35.19 | 4.53 | 35.06 | 28.02 | 42.43 |
| FLUX.2 VAE | 36.28 | 4.53 | 36.07 | 28.89 | 43.63 |
2000 validation images.35.15 dB mean PSNR
(25.73 min, 45.99 max).NVIDIA GeForce RTX 5090 in bfloat16, averaging repeated
batches per resolution.| Resolution | Batch Size | dinac_ae encode (ms/batch) | FLUX.2 encode (ms/batch) | dinac_ae peak VRAM (MiB) | FLUX.2 peak VRAM (MiB) | Speedup vs FLUX.2 | Peak VRAM Reduction vs FLUX.2 |
|---|---|---|---|---|---|---|---|
256x256 | 128 | 50 | 383 | 1,637 | 12,511 | 7.62x | 86.9% |
512x512 | 32 | 53 | 354 | 1,639 | 12,511 | 6.72x | 86.9% |
encode() returns DINAC-AE's own whitened latent space.decode() expects that same whitened latent space and dewhitens internally.predict_class() expects the same whitened latent space, dewhitens
internally, and predicts a DINOv3 ViT-B/16 class-token feature.whiten() and dewhiten() are exposed for explicit control.encode_posterior() returns the raw exported posterior before whitening.DinacAEInferenceConfig.num_steps counts decoder evaluations directly:
num_steps=1 means one NFE.float32. The recommended and default runtime path
is bfloat16 AMP for the main encoder, decoder, and class-token path. The
loader retains normalization affine parameters, GRN/residual gates, the final
pixel projection, latent statistics, RoPE/time frequencies, sampler state, and
whitening/dewhitening in float32. These tensors are loaded from the original
FP32 weights before ordinary parameters are converted to BF16.1import torch
2
3from dinac_ae import DinacAE, DinacAEInferenceConfig
4
5
6device = "cuda"
7model = DinacAE.from_pretrained(
8 "data-archetype/dinac_ae",
9 device=device,
10 dtype=torch.bfloat16,
11)
12
13image = ... # [1, 3, H, W] in [-1, 1], H and W divisible by 16
14
15with torch.inference_mode():
16 latents = model.encode(image.to(device=device, dtype=torch.bfloat16))
17 class_token = model.predict_class(latents)
18 recon = model.decode(
19 latents,
20 height=int(image.shape[-2]),
21 width=int(image.shape[-1]),
22 inference_config=DinacAEInferenceConfig(num_steps=1),
23 )6-block ViT/DiT-style transformer encoder and an 8-block
FCDM decoder.16, model width is 896, and latent width is 128.predict_class(latents) reaches mean cosine similarity 0.757458 against
the frozen DINOv3 ViT-B/16 teacher class token on the same 2000 images.1@misc{dinac_ae,
2 title = {DINAC-AE: a DINO-aligned class-token diffusion autoencoder},
3 author = {data-archetype},
4 email = {data-archetype@proton.me},
5 year = {2026},
6 month = may,
7 url = {https://huggingface.co/data-archetype/dinac_ae},
8}