Views
No views yet

1git clone https://github.com/Tugra-Video/TUĞRA.git
2cd TUĞRA1# Ensure torch >= 2.4.0
2# If the installation of `flash_attn` fails, try installing the other packages first and install `flash_attn` last
3pip install -r requirements.txt
4# If you want to use CosyVoice to synthesize speech for Speech-to-Video Generation, please install requirements_s2v.txt additionally
5pip install -r requirements_s2v.txt| Models | Download Links | Description |
|---|---|---|
| T2V-A14B | 🤗 Huggingface 🤖 ModelScope | Text-to-Video MoE model, supports 480P & 720P |
| I2V-A14B | 🤗 Huggingface 🤖 ModelScope | Image-to-Video MoE model, supports 480P & 720P |
| TI2V-5B | 🤗 Huggingface 🤖 ModelScope | High-compression VAE, T2V+I2V, supports 720P |
| S2V-14B | 🤗 Huggingface 🤖 ModelScope | Speech-to-Video model, supports 480P & 720P |
| Animate-14B | 🤗 Huggingface 🤖 ModelScope | Character animation and replacement |
💡Note: The TI2V-5B model supports 720P video generation at 24 FPS.
1pip install "huggingface_hub[cli]"
2huggingface-cli download Tugra-AI/TUĞRA-T2V-A14B --local-dir ./TUĞRA-T2V-A14B1pip install modelscope
2modelscope download Tugra-AI/TUĞRA-T2V-A14B --local_dir ./TUĞRA-T2V-A14BTUĞRA-T2V-A14B Text-to-Video model and can simultaneously support video generation at 480P and 720P resolutions.python generate.py --task t2v-A14B --size 1280*720 --ckpt_dir ./TUĞRA-T2V-A14B --offload_model True --convert_model_dtype --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."💡 This command can run on a GPU with at least 80GB VRAM.
💡If you encounter OOM (Out-of-Memory) issues, you can use the--offload_model True,--convert_model_dtypeand--t5_cpuoptions to reduce GPU memory usage.
torchrun --nproc_per_node=8 generate.py --task t2v-A14B --size 1280*720 --ckpt_dir ./TUĞRA-T2V-A14B --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."dashscope.api_key in advance (EN | CN).DASH_API_KEY to specify the Dashscope API key. For users of Alibaba Cloud's international site, you also need to set the environment variable DASH_API_URL to 'https://dashscope-intl.aliyuncs.com/api/v1'. For more detailed instructions, please refer to the dashscope document.qwen-plus model for text-to-video tasks and qwen-vl-max for image-to-video tasks.--prompt_extend_model. For example:DASH_API_KEY=your_key torchrun --nproc_per_node=8 generate.py --task t2v-A14B --size 1280*720 --ckpt_dir ./TUĞRA-T2V-A14B --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage" --use_prompt_extend --prompt_extend_method 'dashscope' --prompt_extend_target_lang 'zh'Qwen/Qwen2.5-14B-Instruct, Qwen/Qwen2.5-7B-Instruct and Qwen/Qwen2.5-3B-Instruct.Qwen/Qwen2.5-VL-7B-Instruct and Qwen/Qwen2.5-VL-3B-Instruct.--prompt_extend_model , allowing you to specify either a local model path or a Hugging Face model. For example:torchrun --nproc_per_node=8 generate.py --task t2v-A14B --size 1280*720 --ckpt_dir ./TUĞRA-T2V-A14B --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage" --use_prompt_extend --prompt_extend_method 'local_qwen' --prompt_extend_target_lang 'zh'TUĞRA-I2V-A14B Image-to-Video model and can simultaneously support video generation at 480P and 720P resolutions.python generate.py --task i2v-A14B --size 1280*720 --ckpt_dir ./TUĞRA-I2V-A14B --offload_model True --convert_model_dtype --image examples/i2v_input.JPG --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."This command can run on a GPU with at least 80GB VRAM.
💡For the Image-to-Video task, thesizeparameter represents the area of the generated video, with the aspect ratio following that of the original input image.
torchrun --nproc_per_node=8 generate.py --task i2v-A14B --size 1280*720 --ckpt_dir ./TUĞRA-I2V-A14B --image examples/i2v_input.JPG --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."DASH_API_KEY=your_key torchrun --nproc_per_node=8 generate.py --task i2v-A14B --size 1280*720 --ckpt_dir ./TUĞRA-I2V-A14B --prompt '' --image examples/i2v_input.JPG --dit_fsdp --t5_fsdp --ulysses_size 8 --use_prompt_extend --prompt_extend_method 'dashscope'💡The model can generate videos solely from the input image. You can use prompt extension to generate prompt from the image.
The process of prompt extension can be referenced here.
TUĞRA-TI2V-5B Text-Image-to-Video model and can support video generation at 720P resolutions.python generate.py --task ti2v-5B --size 1280*704 --ckpt_dir ./TUĞRA-TI2V-5B --offload_model True --convert_model_dtype --t5_cpu --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage"💡Unlike other tasks, the 720P resolution of the Text-Image-to-Video task is1280*704or704*1280.
This command can run on a GPU with at least 24GB VRAM (e.g, RTX 4090 GPU).
💡If you are running on a GPU with at least 80GB VRAM, you can remove the--offload_model True,--convert_model_dtypeand--t5_cpuoptions to speed up execution.
python generate.py --task ti2v-5B --size 1280*704 --ckpt_dir ./TUĞRA-TI2V-5B --offload_model True --convert_model_dtype --t5_cpu --image examples/i2v_input.JPG --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."💡If the image parameter is configured, it is an Image-to-Video generation; otherwise, it defaults to a Text-to-Video generation.
💡Similar to Image-to-Video, thesizeparameter represents the area of the generated video, with the aspect ratio following that of the original input image.
torchrun --nproc_per_node=8 generate.py --task ti2v-5B --size 1280*704 --ckpt_dir ./TUĞRA-TI2V-5B --dit_fsdp --t5_fsdp --ulysses_size 8 --image examples/i2v_input.JPG --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard. The fluffy-furred feline gazes directly at the camera with a relaxed expression. Blurred beach scenery forms the background featuring crystal-clear waters, distant green hills, and a blue sky dotted with white clouds. The cat assumes a naturally relaxed posture, as if savoring the sea breeze and warm sunlight. A close-up shot highlights the feline's intricate details and the refreshing atmosphere of the seaside."The process of prompt extension can be referenced here.
TUĞRA-S2V-14B Speech-to-Video model and can simultaneously support video generation at 480P and 720P resolutions.1python generate.py --task s2v-14B --size 1024*704 --ckpt_dir ./TUĞRA-S2V-14B/ --offload_model True --convert_model_dtype --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard." --image "examples/i2v_input.JPG" --audio "examples/talk.wav"
2# Without setting --num_clip, the generated video length will automatically adjust based on the input audio length
3
4# You can use CosyVoice to generate audio with --enable_tts
5python generate.py --task s2v-14B --size 1024*704 --ckpt_dir ./TUĞRA-S2V-14B/ --offload_model True --convert_model_dtype --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard." --image "examples/i2v_input.JPG" --enable_tts --tts_prompt_audio "examples/zero_shot_prompt.wav" --tts_prompt_text "希望你以后能够做的比我还好呦。" --tts_text "收到好友从远方寄来的生日礼物,那份意外的惊喜与深深的祝福让我心中充满了甜蜜的快乐,笑容如花儿般绽放。"💡 This command can run on a GPU with at least 80GB VRAM.
torchrun --nproc_per_node=8 generate.py --task s2v-14B --size 1024*704 --ckpt_dir ./TUĞRA-S2V-14B/ --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "Summer beach vacation style, a white cat wearing sunglasses sits on a surfboard." --image "examples/i2v_input.JPG" --audio "examples/talk.wav"torchrun --nproc_per_node=8 generate.py --task s2v-14B --size 1024*704 --ckpt_dir ./TUĞRA-S2V-14B/ --dit_fsdp --t5_fsdp --ulysses_size 8 --prompt "a person is singing" --image "examples/pose.png" --audio "examples/sing.MP3" --pose_video "./examples/pose.mp4" 💡For the Speech-to-Video task, thesizeparameter represents the area of the generated video, with the aspect ratio following that of the original input image.
💡The model can generate videos from audio input combined with reference image and optional text prompt.
💡The--pose_videoparameter enables pose-driven generation, allowing the model to follow specific pose sequences while generating videos synchronized with audio input.
💡The--num_clipparameter controls the number of video clips generated, useful for quick preview with shorter generation time.
1python ./wan/modules/animate/preprocess/preprocess_data.py \
2 --ckpt_path ./TUĞRA-Animate-14B/process_checkpoint \
3 --video_path ./examples/wan_animate/animate/video.mp4 \
4 --refer_path ./examples/wan_animate/animate/image.jpeg \
5 --save_path ./examples/wan_animate/animate/process_results \
6 --resolution_area 1280 720 \
7 --retarget_flag \
8 --use_flux1python ./wan/modules/animate/preprocess/preprocess_data.py \
2 --ckpt_path ./TUĞRA-Animate-14B/process_checkpoint \
3 --video_path ./examples/wan_animate/replace/video.mp4 \
4 --refer_path ./examples/wan_animate/replace/image.jpeg \
5 --save_path ./examples/wan_animate/replace/process_results \
6 --resolution_area 1280 720 \
7 --iterations 3 \
8 --k 7 \
9 --w_len 1 \
10 --h_len 1 \
11 --replace_flagpython generate.py --task animate-14B --ckpt_dir ./TUĞRA-Animate-14B/ --src_root_path ./examples/wan_animate/animate/process_results/ --refert_num 1python -m torch.distributed.run --nnodes 1 --nproc_per_node 8 generate.py --task animate-14B --ckpt_dir ./TUĞRA-Animate-14B/ --src_root_path ./examples/wan_animate/animate/process_results/ --refert_num 1 --dit_fsdp --t5_fsdp --ulysses_size 81from diffusers import WanAnimatePipeline
2from diffusers.utils import export_to_video, load_image, load_video
3
4device = "cuda:0"
5dtype = torch.bfloat16
6model_id = "Tugra-AI/TUĞRA-Animate-14B-Diffusers"
7pipe = WanAnimatePipeline.from_pretrained(model_id torch_dtype=dtype)
8pipe.to(device)
9
10seed = 42
11prompt = "People in the video are doing actions."
12
13# Animation
14image = load_image("/path/to/animate/reference/image/src_ref.png")
15pose_video = load_video("/path/to/animate/pose/video/src_pose.mp4")
16face_video = load_video("/path/to/animate/face/video/src_face.mp4")
17
18animate_video = pipe(
19 image=image,
20 pose_video=pose_video,
21 face_video=face_video,
22 prompt=prompt,
23 mode="animate",
24 segment_frame_length=77, # clip_len in original code
25 prev_segment_conditioning_frames=1, # refert_num in original code
26 guidance_scale=1.0,
27 num_inference_steps=20,
28 generator=torch.Generator(device=device).manual_seed(seed),
29).frames[0]
30export_to_video(animate_video, "diffusers_animate.mp4", fps=30)python generate.py --task animate-14B --ckpt_dir ./TUĞRA-Animate-14B/ --src_root_path ./examples/wan_animate/replace/process_results/ --refert_num 1 --replace_flag --use_relighting_lora python -m torch.distributed.run --nnodes 1 --nproc_per_node 8 generate.py --task animate-14B --ckpt_dir ./TUĞRA-Animate-14B/ --src_root_path ./examples/wan_animate/replace/process_results/src_pose.mp4 --refert_num 1 --replace_flag --use_relighting_lora --dit_fsdp --t5_fsdp --ulysses_size 81# create pipeline as in the Animation code ☝️
2
3# Replacement
4image = load_image("/path/to/replace/reference/image/src_ref.png")
5pose_video = load_video("/path/to/replace/pose/video/src_pose.mp4")
6face_video = load_video("/path/to/replace/face/video/src_face.mp4")
7background_video = load_video("/path/to/replace/background/video/src_bg.mp4")
8mask_video = load_video("/path/to/replace/mask/video/src_mask.mp4")
9
10replace_video = pipe(
11 image=image,
12 pose_video=pose_video,
13 face_video=face_video,
14 background_video=background_video,
15 mask_video=mask_video,
16 prompt=prompt,
17 mode="replace",
18 segment_frame_length=77, # clip_len in original code
19 prev_segment_conditioning_frames=1, # refert_num in original code
20 guidance_scale=1.0,
21 num_inference_steps=20,
22 generator=torch.Generator(device=device).manual_seed(seed),
23).frames[0]
24export_to_video(replace_video, "diffusers_replace.mp4", fps=30)💡 If you're using Tugra-Animate, we do not recommend using LoRA models trained onTUĞRA, since weight changes during training may lead to unexpected behavior.

The parameter settings for the tests presented in this table are as follows: (1) Multi-GPU: 14B:--ulysses_size 4/8 --dit_fsdp --t5_fsdp, 5B:--ulysses_size 4/8 --offload_model True --convert_model_dtype --t5_cpu; Single-GPU: 14B:--offload_model True --convert_model_dtype, 5B:--offload_model True --convert_model_dtype --t5_cpu(--convert_model_dtype converts model parameter types to config.param_dtype); (2) The distributed testing utilizes the built-in FSDP and Ulysses implementations, with FlashAttention3 deployed on Hopper architecture GPUs; (3) Tests were run without the--use_prompt_extendflag; (4) Reported results are the average of multiple samples taken after the warm-up phase.




@article{wan2025,
title={Wan: Open and Advanced Large-Scale Video Generative Models},
author={Team Wan and Ang Wang and Baole Ai and Bin Wen and Chaojie Mao and Chen-Wei Xie and Di Chen and Feiwu Yu and Haiming Zhao and Jianxiao Yang and Jianyuan Zeng and Jiayu Wang and Jingfeng Zhang and Jingren Zhou and Jinkai Wang and Jixuan Chen and Kai Zhu and Kang Zhao and Keyu Yan and Lianghua Huang and Mengyang Feng and Ningyi Zhang and Pandeng Li and Pingyu Wu and Ruihang Chu and Ruili Feng and Shiwei Zhang and Siyang Sun and Tao Fang and Tianxing Wang and Tianyi Gui and Tingyu Weng and Tong Shen and Wei Lin and Wei Wang and Wei Wang and Wenmeng Zhou and Wente Wang and Wenting Shen and Wenyuan Yu and Xianzhong Shi and Xiaoming Huang and Xin Xu and Yan Kou and Yangyu Lv and Yifei Li and Yijing Liu and Yiming Wang and Yingya Zhang and Yitong Huang and Yong Li and You Wu and Yu Liu and Yulin Pan and Yun Zheng and Yuntao Hong and Yupeng Shi and Yutong Feng and Zeyinzi Jiang and Zhen Han and Zhi-Fan Wu and Ziyu Liu},
journal = {arXiv preprint arXiv:2503.20314},
year={2025}
}