We introduce AnyFlow, the first any-step video diffusion framework built on flow maps. AnyFlow offers these key features:
conda create -n far python=3.10
conda activate far
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt --no-build-isolation
pre-commit install
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
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
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
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 uses mode: train configs under options/train/anyflow/.
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
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 uses mode: eval configs under options/test/anyflow/.
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
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>/.
This project is released under the Apache License 2.0. See LICENSE for full text.
Feel free to open an issue or email Yuchao Gu for questions about the codebase.
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.
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}
}
Python
99.8%
We introduce AnyFlow, the first any-step video diffusion framework built on flow maps. AnyFlow offers these key features:
conda create -n far python=3.10
conda activate far
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt --no-build-isolation
pre-commit install
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
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
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
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 uses mode: train configs under options/train/anyflow/.
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
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 uses mode: eval configs under options/test/anyflow/.
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
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>/.
This project is released under the Apache License 2.0. See LICENSE for full text.
Feel free to open an issue or email Yuchao Gu for questions about the codebase.
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.
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}
}
Python
99.8%