FACM
FACM: Flow-Anchored Consistency Models
Install / Use
/learn @ali-vilab/FACMREADME
Progress
- [x] Release FACM on ImageNet 256
- [ ] Release Wan 2.2 T2I + FACM 🚀
ImageNet 256 Performance on 8 × A100 GPUs
| Model | Steps | FID | IS | Epochs-Pretrain | Epochs-Distill | Download | |:-----:|:-----:|:---:|:--:|:---------------:|:--------------:|:--------:| | FACM | 2-step | 1.32 | 292 | 800 | 100 | 100ep-stg2.pt | | FACM | 1-step | 1.76 | 290 | 800 | 250 | 250ep-stg2.pt | | FACM | 1-step | 1.70 | 295 | 800 | 400 | 400ep-stg2.pt |
Quick Start
Prerequisites:
Download the required model weights and statistics files from HuggingFace or ModelScope to ./cache
Including: fid-50k-256.npz, latents_stats.pt, vavae-imagenet256-f16d32-dinov2.pt
Data Preparation
export DATA_PATH="/path/to/imagenet"
export OUTPUT_PATH="/path/to/latents"
bash scripts/extract.sh
*Note: You can also download pre-extracted ImageNet latents following Lightning-DiT.
Inference
pip install -e git+https://github.com/LTH14/torch-fidelity.git@master#egg=torch-fidelity
Download pretrained FACM model checkpoint 100ep-stg2.pt or 400ep-stg2.pt to ./cache
bash scripts/test.sh --ckpt-path cache/100ep-stg2.pt --sampling-steps 2
bash scripts/test.sh --ckpt-path cache/400ep-stg2.pt --sampling-steps 1
Training
Download pretrained FM model checkpoint 800ep-stg1.pt to ./cache
export DATA_PATH="/path/to/latents"
bash scripts/train.sh
Pretraining (Optional)
Replace configs/lightningdit_xl_vavae_f16d32.yaml and transport/transport.py of Lightning-DiT with our ldit/lightningdit_xl_vavae_f16d32.yaml and ldit/transport.py, then follow the instructions.
Reproductions
<details open> <summary> reproductions </summary>We include reproductions of MeanFlow and sCM. Switch methods by changing the loss function in train.py line 81:
facm_loss = FACMLoss() # FACM (default)
facm_loss = MeanFlowLoss() # MeanFlow
facm_loss = sCMLoss() # sCM
</details>
Citation
If you use FACM or its methods in your work, please cite the following BibTeX entries:
@misc{peng2025facm,
title={Flow-Anchored Consistency Models},
author={Yansong Peng and Kai Zhu and Yu Liu and Pingyu Wu and Hebei Li and Xiaoyan Sun and Feng Wu},
year={2025},
eprint={2507.03738},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
</details>
Acknowledgements
The model architecture part is based on the Lightning-DiT repository.
✨ Feel free to contribute and reach out if you have any questions! ✨
Related Skills
node-connect
350.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
