|
Download README.md from Davidwang215/dmvae: direct link, hf CLI and curl.
- Browser
- Download file 2.05 kB
-
https://huggingface.co/Davidwang215/dmvae/resolve/main/README.md
- Command line
-
hf download hf://Davidwang215/dmvae/README.md
-
curl -L -o README.md https://huggingface.co/Davidwang215/dmvae/resolve/main/README.md
2.05 kB
| license: apache-2.0 | |
| library_name: pytorch | |
| pipeline_tag: unconditional-image-generation | |
| tags: | |
| - image-generation | |
| - vae | |
| - diffusion | |
| - safetensors | |
| # DM-VAE inference weights | |
| Matched ImageNet-256 DM-VAE tokenizers and LightningDiT-XL/1 generators. | |
| | Variant | VAE | LightningDiT | | |
| | --- | --- | --- | | |
| | f16d32 | [50ep](vae/dmvae-f16d32-50ep.safetensors) | [64ep](lightningdit/lightningdit-f16d32-64ep.safetensors), [400ep](lightningdit/lightningdit-f16d32-400ep.safetensors) | | |
| | f16d64 | [50ep](vae/dmvae-f16d64-50ep.safetensors) | [400ep](lightningdit/lightningdit-f16d64-400ep.safetensors) | | |
| Use each generator with the tokenizer and channel normalization in its matching `configs/d32.json` or `configs/d64.json`. Weights retain their original tensor precision. | |
| ## Inference | |
| Install the [DM-VAE inference code](https://github.com/ustcchx/DM-VAE) and download this repository: | |
| ```bash | |
| git clone https://github.com/ustcchx/DM-VAE.git | |
| cd DM-VAE | |
| python -m pip install -e ".[hub]" safetensors | |
| hf download Davidwang215/dmvae --local-dir weights/dmvae | |
| python weights/dmvae/inference.py --variant d32 --dit-epochs 64 --classes 207 --device cuda --precision bf16 --output samples/d32-64ep | |
| python weights/dmvae/inference.py --variant d32 --classes 207 --device cuda --precision bf16 --output samples/d32 | |
| python weights/dmvae/inference.py --variant d64 --classes 207 --device cuda --precision bf16 --output samples/d64 | |
| ``` | |
| The loader verifies the SHA-256 of both weight files and loads each architecture strictly. The JSON files provide the matching architecture and latent-channel statistics. `inference.py` supports IG_TS sampling and optional interval CFG with `--cfg`. | |
| For direct use in Python: | |
| ```python | |
| import sys | |
| import torch | |
| sys.path.insert(0, "weights/dmvae") | |
| from inference import load_pair | |
| vae, dit, means, scales = load_pair("weights/dmvae", "d32", "cuda", torch.bfloat16) | |
| ``` | |
| Select the f16d32 64ep generator with `--dit-epochs 64`. The default is 400ep. Both f16d32 generators use the same f16d32 50ep VAE and channel normalization. | |