Views
No views yet
1conda create -n far python=3.10
2conda activate far1pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu128
2pip install -r requirements.txt --no-build-isolation| Model | Tasks | Resolution | Download Link |
|---|---|---|---|
AnyFlow-FAR-Wan2.1-1.3B-Diffusers | T2V, I2V, V2V | 480P | 🤗 Hugging Face |
AnyFlow-FAR-Wan2.1-14B-Diffusers | T2V, I2V, V2V | 480P | 🤗 Hugging Face |
AnyFlow-Wan2.1-T2V-14B-Diffusers | T2V | 480P | 🤗 Hugging Face |
AnyFlow-Wan2.1-T2V-1.3B-Diffusers | T2V | 480P | 🤗 Hugging Face |
pip install "huggingface_hub[cli]"
hf download nvidia/AnyFlow-FAR-Wan2.1-1.3B-Diffusers --repo-type model --local-dir experiments/pretrained_models/AnyFlow-FAR-Wan2.1-1.3B-Diffusers1import torch
2from diffusers.utils import export_to_video
3
4from far.pipelines.pipeline_far_wan_anyflow import FARWanAnyFlowPipeline
5
6model_id = "nvidia/AnyFlow-FAR-Wan2.1-14B-Diffusers"
7pipeline = FARWanAnyFlowPipeline.from_pretrained(model_path).to('cuda', dtype=torch.bfloat16)
8
9prompt = "CG game concept digital art, a majestic elephant with a vibrant tusk and sleek fur running swiftly towards a herd of its kind."
10
11video = pipeline(
12 prompt=prompt,
13 height=480,
14 width=832,
15 num_frames=81,
16 num_inference_steps=4,
17 generator=torch.Generator('cuda').manual_seed(0)
18).frames[0]
19export_to_video(output, "output.mp4", fps=16)1import torch
2from diffusers.utils import export_to_video
3from PIL import Image
4from torchvision import transforms
5
6from far.pipelines.pipeline_far_wan_anyflow import FARWanAnyFlowPipeline
7
8model_id = "nvidia/AnyFlow-FAR-Wan2.1-14B-Diffusers"
9pipeline = FARWanAnyFlowPipeline.from_pretrained(model_path).to('cuda', dtype=torch.bfloat16)
10
11# load image
12image_path = 'assets/example_image.jpg'
13prompt = 'A towering, battle-scarred humanoid robot walking through the skeletal remains of a city ruin.'
14
15image = Image.open(image_path).convert('RGB')
16image = transforms.ToTensor()(transforms.Resize([480, 832])(image)).unsqueeze(0).unsqueeze(0)
17
18video = pipeline(
19 prompt=prompt,
20 context_sequence={'raw': image},
21 height=480,
22 width=832,
23 num_frames=81,
24 num_inference_steps=4,
25 generator=torch.Generator('cuda').manual_seed(0)
26).frames[0]
27export_to_video(output, "output.mp4", fps=16)1import torch
2from diffusers.utils import export_to_video
3import decord
4from torchvision import transforms
5
6from far.pipelines.pipeline_far_wan_anyflow import FARWanAnyFlowPipeline
7
8decord.bridge.set_bridge('torch')
9
10model_id = "nvidia/AnyFlow-FAR-Wan2.1-14B-Diffusers"
11pipeline = FARWanAnyFlowPipeline.from_pretrained(model_path).to('cuda', dtype=torch.bfloat16)
12
13# load video
14video_path = 'assets/example_video.mp4'
15prompt = "A focused trail runner's powerful strides through a dense, sun-dappled forest."
16
17video_reader = decord.VideoReader(video_path)
18frame_idxs = select_frame_indices(len(video_reader), video_reader.get_avg_fps(), target_fps=16)[:num_cond_frames]
19frames = video_reader.get_batch(frame_idxs)
20frames = (frames / 255.0).float().permute(0, 3, 1, 2).contiguous()
21frames = transforms.Resize([480, 832])(frames).unsqueeze(0)
22
23video = pipeline(
24 prompt=prompt,
25 context_sequence={'raw': frames},
26 height=480,
27 width=832,
28 num_frames=81,
29 num_inference_steps=4,
30 generator=torch.Generator('cuda').manual_seed(0)
31).frames[0]
32export_to_video(output, "output.mp4", fps=16)1@article{gu2026anyflow,
2 title={AnyFlow: Any-Step Video Diffusion Model with On-Policy Flow Map Distillation},
3 author={Gu, Yuchao and Fang, Guian and Jiang, Yuxin and Mao, Weijia and Han, Song and Cai, Han and Shou, Mike Zheng},
4 journal={arXiv preprint arXiv:2605.13724},
5 year={2026}
6}
7
8@article{gu2025long,
9 title={Long-Context Autoregressive Video Modeling with Next-Frame Prediction},
10 author={Gu, Yuchao and Mao, weijia and Shou, Mike Zheng},
11 journal={arXiv preprint arXiv:2503.19325},
12 year={2025}
13}