Files
diffusers/docs/source/en/api/models/autoencoder_dc.md
T
2024-12-04 21:10:00 +01:00

2.4 KiB

AutoencoderDC

The 2D Autoencoder model used in SANA and introduced in DCAE by authors Junyu Chen, Han Cai, Junsong Chen, Enze Xie, Shang Yang, Haotian Tang, Muyang Li, Yao Lu, Song Han from MIT HAN Lab.

The following DCAE models are released and supported in Diffusers:

The models can be loaded with the following code snippet.

from diffusers import AutoencoderDC

ae = AutoencoderDC.from_pretrained("mit-han-lab/dc-ae-f32c32-sana-1.0-diffusers", torch_dtype=torch.float32).to("cuda")

Single file loading

The AutoencoderDC implementation supports loading checkpoints shipped in the original format by MIT HAN Lab. The following example demonstrates how to load the f128c512 checkpoint:

from diffusers import AutoencoderDC

model_name = "dc-ae-f128c512-mix-1.0"
ae = AutoencoderDC.from_single_file(
    f"https://huggingface.co/mit-han-lab/{model_name}/model.safetensors",
    original_config=f"https://huggingface.co/mit-han-lab/{model_name}/resolve/main/config.json"
)

AutoencoderDC

autodoc AutoencoderDC - decode - all

DecoderOutput

autodoc models.autoencoders.vae.DecoderOutput