NVlabs/AnyFlow
Tentang
AnyFlow Series for Large-Scale Diffusion Post-Training
Proyek lainnyaPertumbuhan bintang terukur
- dalam 24 jam
- +14
- dalam 7 hari
- +24
- dalam 15 hari
- +25
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asli๐ AnyFlow
๐ Overview
We introduce AnyFlow, the first any-step video diffusion framework built on flow maps. AnyFlow offers these key features:
- โก Any-Step Generation: Unlike traditional distilled models tied to fixed step budgets, AnyFlow enables a single model to adapt to arbitrary inference budgets. It achieves high-quality few-step generation while providing stable improvements as more sampling steps are added.
- ๐ Multiple Architectures: AnyFlow supports any-step distillation for both causal and bidirectional video diffusion models.
- ๐ฌ Multiple Tasks: AnyFlow supports Text-to-Video, Image-to-Video, and Video-to-Video generation within one causal video diffusion model.
- ๐ Scalable Performance: AnyFlow is validated from 1.3B up to 14B parameters.
๐ ๏ธ Setup Environment
1๏ธโฃ Create conda environment
conda create -n far python=3.10
conda activate far
2๏ธโฃ Install PyTorch & dependencies
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt --no-build-isolation
3๏ธโฃ Install pre-commit (optional)
pre-commit install
๐ง On NVIDIA cluster
If you are on an NVIDIA internal cluster, install the logger utils:
pip install --index-url=https://sc-hw-artf.nvidia.com/artifactory/api/pypi/hwinf-mlwfo-pypi/simple --upgrade one-logger-utils
๐ฎ Run Demo
๐ฅ Download pretrained model
hf download nvidia/AnyFlow-FAR-Wan2.1-1.3B-Diffusers --repo-type model --local-dir experiments/pretrained_models/AnyFlow-FAR-Wan2.1-1.3B-Diffusers
hf download nvidia/AnyFlow-FAR-Wan2.1-14B-Diffusers --repo-type model --local-dir experiments/pretrained_models/AnyFlow-FAR-Wan2.1-14B-Diffusers
hf download nvidia/AnyFlow-Wan2.1-T2V-1.3B-Diffusers --repo-type model --local-dir experiments/pretrained_models/AnyFlow-Wan2.1-T2V-1.3B-Diffusers
hf download nvidia/AnyFlow-Wan2.1-T2V-14B-Diffusers --repo-type model --local-dir experiments/pretrained_models/AnyFlow-Wan2.1-T2V-14B-Diffusers
โถ๏ธ Start demo
python demo.py \
model_path=experiments/pretrained_models/AnyFlow-Wan2.1-T2V-1.3B-Diffusers \
task_type=t2v \
save_dir=results/demo/AnyFlow-Wan2.1-T2V-1.3B-Diffusers
๐ป ComfyUI Node
A third-party node is available for ComfyUI at SimpleTuner-io/ComfyUI-AnyFlow, using its model patcher interface to support n-step inference for Wan 2.1 and other community-developed models such as Anima v1.0.
๐๏ธ Training
Training uses mode: train configs under options/train/anyflow/.
Data preparation
See docs/DATA.md for how to construction training dataset. We provide an exmaple dummy dataset for quick start:
hf download dc-ai/vidprom_dummy --repo-type dataset --local-dir datasets/vidprom_dummy
Launch
torchrun --nnodes 1 --nproc_per_node=8 --master_port 17154 \
-m far.main \
config_path=options/train/anyflow/farwan_causal/pretrain/train_farwan1b_student_shift5_81f_480p_lr5e-5_6k_b32.yml
Set --nproc_per_node to the number of GPUs you use. Logs and checkpoints go under experiments/<run_name>/ (the name field in the YAML).
๐ Evaluation
Evaluation uses mode: eval configs under options/test/anyflow/.
VBench preparation
The evaluators set VBENCH_CACHE_DIR to experiments/pretrained_models/vbench. Download the VBench model bundle there:
hf download dc-ai/vbench_pretrained_models --repo-type model --local-dir experiments/pretrained_models/vbench
If you run configs that evaluate VBench I2V, download reference images for evaluation:
hf download dc-ai/vbench_i2v --repo-type dataset --local-dir datasets/vbench_i2v
Launch
torchrun --nnodes 1 --nproc_per_node=8 --master_port 17154 \
-m far.main \
config_path=options/test/anyflow/test_AnyFlow-FAR-Wan2.1-1.3B-Diffusers.yml
Outputs and logs are written under results/<run_name>/.
๐ License
This project is released under the Apache License 2.0. See LICENSE for full text.
๐ฌ Contact & Discussion
Feel free to open an issue or email Yuchao Gu for questions about the codebase.
โญ Acknowledgement
This codebase is built on Diffusers. We also refer to implementations from FAR, Self-Forcing, and TiM. We thank the authors for open-sourcing their work.
๐ Citation
If you find AnyFlow useful in your research, please cite our work:
@article{gu2026anyflow,
title={AnyFlow: Any-Step Video Diffusion Model with On-Policy Flow Map Distillation},
author={Gu, Yuchao and Fang, Guian and Jiang, Yuxin and Mao, Weijia and Han, Song and Cai, Han and Shou, Mike Zheng},
journal={arXiv preprint arXiv:2605.13724},
year={2026}
}
@article{gu2025long,
title={Long-Context Autoregressive Video Modeling with Next-Frame Prediction},
author={Gu, Yuchao and Mao, weijia and Shou, Mike Zheng},
journal={arXiv preprint arXiv:2503.19325},
year={2025}
}
Jelajahi proyek terkait
Memuatโฆ
