Downloads · 30 days
8
2% of all-time downloads
dc-ai/dc-ae-lite-f32c32
dc-ae-lite-f32c32 is a machine learning model from dc-ai. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
8
2% of all-time downloads
All-time downloads
370
Public
Parameters
421M
1.7 GB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors1.7 GB · 100%
From the Hugging Face model README
[github]
Decoding is often the speed bottleneck in few-step latent diffusion models. We release DC-AE-Lite to resolve this problem. It has the same encoder of DC-AE-f32c32-SANA-1.0 while having a much smaller decoder. Without training, it can be applied to diffusion model trained with DC-AE-f32c32-SANA-1.0.
from PIL import Image
import torch
import torchvision.transforms as transforms
from torchvision.utils import save_image
from dc_gen.ae_model_zoo import DCAE_HF
device = torch.device("cuda")
dc_ae_lite = DCAE_HF.from_pretrained("dc-ai/dc-ae-lite-f32c32").to(device).eval()
transform = transforms.Compose([
transforms.CenterCrop((1024,1024)),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
])
image = Image.open("assets/fig/girl.png")
x = transform(image)[None].to(device)
latent = dc_ae_lite.encode(x)
print(f"latent shape: {latent.shape}")
y = dc_ae_lite.decode(latent)
save_image(y * 0.5 + 0.5, "demo_dc_ae_lite.png")