ali-vilab/FACM

FACM: Flow-Anchored Consistency Models

Python

147

6 commits

updated Aug 6, 2025

See the code

README

FACM: Flow-Anchored Consistency Models

🔥 FACM outperforms 2×250-step Lightning-DiT on ImageNet 256 with only 2 steps

FID=1.70 (1-step)      FID=1.32 (2-step)

📄 This is the official implementation of the paper:
Flow-Anchored Consistency Models

Yansong Peng, Kai Zhu, Yu Liu, Pingyu Wu, Hebei Li, Xiaoyan Sun, Feng Wu


If you like FACM, please give us a ⭐! Your support motivates us to keep improving!

Progress

  • Release FACM on ImageNet 256
  • Release Wan 2.2 T2I + FACM 🚀

ImageNet 256 Performance on 8 × A100 GPUs

ModelStepsFIDISEpochs-PretrainEpochs-DistillDownload
FACM2-step1.32292800100100ep-stg2.pt
FACM1-step1.76290800250250ep-stg2.pt
FACM1-step1.70295800400400ep-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

reproductions

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

Citation

If you use FACM or its methods in your work, please cite the following BibTeX entries:

bibtex
@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}
}

Acknowledgements

The model architecture part is based on the Lightning-DiT repository.

✨ Feel free to contribute and reach out if you have any questions! ✨

ali-vilab/FACM

FACM: Flow-Anchored Consistency Models

Python

147

6 commits

updated Aug 6, 2025

See the code

README

FACM: Flow-Anchored Consistency Models

🔥 FACM outperforms 2×250-step Lightning-DiT on ImageNet 256 with only 2 steps

FID=1.70 (1-step)      FID=1.32 (2-step)

📄 This is the official implementation of the paper:
Flow-Anchored Consistency Models

Yansong Peng, Kai Zhu, Yu Liu, Pingyu Wu, Hebei Li, Xiaoyan Sun, Feng Wu


If you like FACM, please give us a ⭐! Your support motivates us to keep improving!

Progress

  • Release FACM on ImageNet 256
  • Release Wan 2.2 T2I + FACM 🚀

ImageNet 256 Performance on 8 × A100 GPUs

ModelStepsFIDISEpochs-PretrainEpochs-DistillDownload
FACM2-step1.32292800100100ep-stg2.pt
FACM1-step1.76290800250250ep-stg2.pt
FACM1-step1.70295800400400ep-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

reproductions

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

Citation

If you use FACM or its methods in your work, please cite the following BibTeX entries:

bibtex
@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}
}

Acknowledgements

The model architecture part is based on the Lightning-DiT repository.

✨ Feel free to contribute and reach out if you have any questions! ✨

Significant stargazers

innnky

971 followers · starred Jul 2025

Dongyang Liu

80 followers · starred Aug 2025

Junho Kim

1,957 followers · starred Jul 2025

Tianhe Wu

137 followers · starred Nov 2025