|  | 
|  | 1 | +<!-- Copyright 2024 The HuggingFace Team. All rights reserved. | 
|  | 2 | +
 | 
|  | 3 | +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | 
|  | 4 | +the License. You may obtain a copy of the License at | 
|  | 5 | +
 | 
|  | 6 | +http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 7 | +
 | 
|  | 8 | +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | 
|  | 9 | +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | 
|  | 10 | +specific language governing permissions and limitations under the License. --> | 
|  | 11 | + | 
|  | 12 | +# AutoencoderDC | 
|  | 13 | + | 
|  | 14 | +*The 2D Autoencoder model used in [SANA](https://arxiv.org/papers/2410.10629) and introduced in [DCAE](https://huggingface.co/papers/2410.10733) by authors Junyu Chen, Han Cai, Junsong Chen, Enze Xie, Shang Yang, Haotian Tang, Muyang Li, Yao Lu, Song Han from MIT HAN Lab.* | 
|  | 15 | + | 
|  | 16 | +The following DCAE models are released and supported in Diffusers: | 
|  | 17 | +- [`mit-han-lab/dc-ae-f32c32-sana-1.0`](https://huggingface.co/mit-han-lab/dc-ae-f32c32-sana-1.0) | 
|  | 18 | +- [`mit-han-lab/dc-ae-f32c32-in-1.0`](https://huggingface.co/mit-han-lab/dc-ae-f32c32-in-1.0) | 
|  | 19 | +- [`mit-han-lab/dc-ae-f32c32-mix-1.0`](https://huggingface.co/mit-han-lab/dc-ae-f32c32-mix-1.0) | 
|  | 20 | +- [`mit-han-lab/dc-ae-f64c128-in-1.0`](https://huggingface.co/mit-han-lab/dc-ae-f64c128-in-1.0) | 
|  | 21 | +- [`mit-han-lab/dc-ae-f64c128-mix-1.0`](https://huggingface.co/mit-han-lab/dc-ae-f64c128-mix-1.0) | 
|  | 22 | +- [`mit-han-lab/dc-ae-f128c512-in-1.0`](https://huggingface.co/mit-han-lab/dc-ae-f128c512-in-1.0) | 
|  | 23 | +- [`mit-han-lab/dc-ae-f128c512-mix-1.0`](https://huggingface.co/mit-han-lab/dc-ae-f128c512-mix-1.0) | 
|  | 24 | + | 
|  | 25 | +The models can be loaded with the following code snippet. | 
|  | 26 | + | 
|  | 27 | +```python | 
|  | 28 | +from diffusers import AutoencoderDC | 
|  | 29 | + | 
|  | 30 | +ae = AutoencoderDC.from_pretrained("mit-han-lab/dc-ae-f32c32-sana-1.0-diffusers", torch_dtype=torch.float32).to("cuda") | 
|  | 31 | +``` | 
|  | 32 | + | 
|  | 33 | +## Single file loading | 
|  | 34 | + | 
|  | 35 | +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: | 
|  | 36 | + | 
|  | 37 | +```python | 
|  | 38 | +from diffusers import AutoencoderDC | 
|  | 39 | + | 
|  | 40 | +model_name = "dc-ae-f128c512-mix-1.0" | 
|  | 41 | +ae = AutoencoderDC.from_single_file( | 
|  | 42 | +    f"https://huggingface.co/mit-han-lab/{model_name}/model.safetensors", | 
|  | 43 | +    original_config=f"https://huggingface.co/mit-han-lab/{model_name}/resolve/main/config.json" | 
|  | 44 | +) | 
|  | 45 | +``` | 
|  | 46 | + | 
|  | 47 | +## AutoencoderDC | 
|  | 48 | + | 
|  | 49 | +[[autodoc]] AutoencoderDC | 
|  | 50 | +    - decode | 
|  | 51 | +    - all | 
|  | 52 | + | 
|  | 53 | +## DecoderOutput | 
|  | 54 | + | 
|  | 55 | +[[autodoc]] models.autoencoders.vae.DecoderOutput | 
|  | 56 | + | 
0 commit comments