From 04e8653c99856950ebf50c99f18a4232635269ec Mon Sep 17 00:00:00 2001 From: WanX-Video Date: Tue, 25 Feb 2025 22:54:11 +0800 Subject: [PATCH 1/8] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 7bf91c1..d22a050 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,7 @@ In this repository, we present **Wan2.1**, a comprehensive and open suite of vid ## Video Demos
- +
## πŸ”₯ Latest News!! From a815a48c3eb2ec1efdc16b290310d24038943641 Mon Sep 17 00:00:00 2001 From: WanX-Video Date: Wed, 26 Feb 2025 11:18:26 +0800 Subject: [PATCH 2/8] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d22a050..5d26fde 100644 --- a/README.md +++ b/README.md @@ -320,6 +320,8 @@ We test the computational efficiency of different **Wan2.1** models on different > (3) For the 1.3B model on a single 4090 GPU, set `--offload_model True --t5_cpu`; > (4) For all testings, no prompt extension was applied, meaning `--use_prompt_extend` was not enabled. +> πŸ’‘Note: T2V-14B is slower than I2V-14B because the former samples 50 steps while the latter uses 40 steps. + ## Community Contributions - [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) provides more support for Wan, including video-to-video, FP8 quantization, VRAM optimization, LoRA training, and more. Please refer to [their examples](https://github.com/modelscope/DiffSynth-Studio/tree/main/examples/wanvideo). From 73648654c5242bd8e11bd05ea36ffa87a6424ff6 Mon Sep 17 00:00:00 2001 From: WanX-Video Date: Wed, 26 Feb 2025 12:02:30 +0800 Subject: [PATCH 3/8] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b24cb85..d416e7b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,4 @@ dashscope imageio-ffmpeg flash_attn gradio>=5.0.0 -numpy==1.24.4 +numpy>=1.23.5,<2 From 0e3c42a830ef87941983a6a494e8df0f90e616d2 Mon Sep 17 00:00:00 2001 From: Adrian Corduneanu Date: Wed, 26 Feb 2025 02:56:57 -0800 Subject: [PATCH 4/8] Update text2video.py to reduce GPU memory by emptying cache (#44) * Update text2video.py to reduce GPU memory by emptying cache If offload_model is set, empty_cache() must be called after the model is moved to CPU to actually free the GPU. I verified on a RTX 4090 that without calling empty_cache the model remains in memory and the subsequent vae decoding never finishes. * Update text2video.py only one empty_cache needed before vae decode --- wan/text2video.py | 1 + 1 file changed, 1 insertion(+) diff --git a/wan/text2video.py b/wan/text2video.py index 96cfa78..2400545 100644 --- a/wan/text2video.py +++ b/wan/text2video.py @@ -252,6 +252,7 @@ class WanT2V: x0 = latents if offload_model: self.model.cpu() + torch.cuda.empty_cache() if self.rank == 0: videos = self.vae.decode(x0) From 89b065f4fe099a59f658d0990a6c352a70f2be43 Mon Sep 17 00:00:00 2001 From: cocktailpeanut <121128867+cocktailpeanut@users.noreply.github.com> Date: Wed, 26 Feb 2025 05:57:30 -0500 Subject: [PATCH 5/8] os.path.sep instead of / (#12) --- gradio/i2v_14B_singleGPU.py | 3 ++- gradio/t2i_14B_singleGPU.py | 3 ++- gradio/t2v_1.3B_singleGPU.py | 3 ++- gradio/t2v_14B_singleGPU.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gradio/i2v_14B_singleGPU.py b/gradio/i2v_14B_singleGPU.py index 9a22297..100002b 100644 --- a/gradio/i2v_14B_singleGPU.py +++ b/gradio/i2v_14B_singleGPU.py @@ -2,6 +2,7 @@ import argparse import gc import os.path as osp +import os import sys import warnings @@ -10,7 +11,7 @@ import gradio as gr warnings.filterwarnings('ignore') # Model -sys.path.insert(0, '/'.join(osp.realpath(__file__).split('/')[:-2])) +sys.path.insert(0, os.path.sep.join(osp.realpath(__file__).split(os.path.sep)[:-2])) import wan from wan.configs import MAX_AREA_CONFIGS, WAN_CONFIGS from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander diff --git a/gradio/t2i_14B_singleGPU.py b/gradio/t2i_14B_singleGPU.py index f81129a..cb42e38 100644 --- a/gradio/t2i_14B_singleGPU.py +++ b/gradio/t2i_14B_singleGPU.py @@ -1,6 +1,7 @@ # Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved. import argparse import os.path as osp +import os import sys import warnings @@ -9,7 +10,7 @@ import gradio as gr warnings.filterwarnings('ignore') # Model -sys.path.insert(0, '/'.join(osp.realpath(__file__).split('/')[:-2])) +sys.path.insert(0, os.path.sep.join(osp.realpath(__file__).split(os.path.sep)[:-2])) import wan from wan.configs import WAN_CONFIGS from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander diff --git a/gradio/t2v_1.3B_singleGPU.py b/gradio/t2v_1.3B_singleGPU.py index 54706b2..87c414e 100644 --- a/gradio/t2v_1.3B_singleGPU.py +++ b/gradio/t2v_1.3B_singleGPU.py @@ -1,6 +1,7 @@ # Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved. import argparse import os.path as osp +import os import sys import warnings @@ -9,7 +10,7 @@ import gradio as gr warnings.filterwarnings('ignore') # Model -sys.path.insert(0, '/'.join(osp.realpath(__file__).split('/')[:-2])) +sys.path.insert(0, os.path.sep.join(osp.realpath(__file__).split(os.path.sep)[:-2])) import wan from wan.configs import WAN_CONFIGS from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander diff --git a/gradio/t2v_14B_singleGPU.py b/gradio/t2v_14B_singleGPU.py index b7448ef..a9b7485 100644 --- a/gradio/t2v_14B_singleGPU.py +++ b/gradio/t2v_14B_singleGPU.py @@ -1,6 +1,7 @@ # Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved. import argparse import os.path as osp +import os import sys import warnings @@ -9,7 +10,7 @@ import gradio as gr warnings.filterwarnings('ignore') # Model -sys.path.insert(0, '/'.join(osp.realpath(__file__).split('/')[:-2])) +sys.path.insert(0, os.path.sep.join(osp.realpath(__file__).split(os.path.sep)[:-2])) import wan from wan.configs import WAN_CONFIGS from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander From d7b01803de788d59c19c7795b12054ae2f6b2d1d Mon Sep 17 00:00:00 2001 From: WanX-Video Date: Wed, 26 Feb 2025 20:33:18 +0800 Subject: [PATCH 6/8] update gradio (#58) --- gradio/t2v_1.3B_singleGPU.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradio/t2v_1.3B_singleGPU.py b/gradio/t2v_1.3B_singleGPU.py index 87c414e..0a752d2 100644 --- a/gradio/t2v_1.3B_singleGPU.py +++ b/gradio/t2v_1.3B_singleGPU.py @@ -46,7 +46,7 @@ def t2v_generation(txt2vid_prompt, resolution, sd_steps, guide_scale, guide_scale=guide_scale, n_prompt=n_prompt, seed=seed, - offload_model=False) + offload_model=True) cache_video( tensor=video[None], From 190e9286813452351f44e9fd11b8614cf5d91fd3 Mon Sep 17 00:00:00 2001 From: Yingda Chen Date: Wed, 26 Feb 2025 22:31:12 +0800 Subject: [PATCH 7/8] add modelscope download cli --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 5d26fde..8c95c58 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,11 @@ pip install "huggingface_hub[cli]" huggingface-cli download Wan-AI/Wan2.1-T2V-14B --local-dir ./Wan2.1-T2V-14B ``` +Download models using modelscope-cli: +``` +pip install modelscope +modelscope download Wan-AI/Wan2.1-T2V-14B --local_dir ./Wan2.1-T2V-14B +``` #### Run Text-to-Video Generation This repository supports two Text-to-Video models (1.3B and 14B) and two resolutions (480P and 720P). The parameters and configurations for these models are as follows: From 6797c48002e977f2bc98ec4da1930f4cd46181a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E8=B0=A8?= Date: Thu, 27 Feb 2025 12:56:36 +0800 Subject: [PATCH 8/8] update comfyui --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8c95c58..b6da55d 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ In this repository, we present **Wan2.1**, a comprehensive and open suite of vid ## πŸ”₯ Latest News!! * Feb 25, 2025: πŸ‘‹ We've released the inference code and weights of Wan2.1. +* Feb 27, 2025: πŸ‘‹ Wan2.1 has been integrated into [ComfyUI](https://comfyanonymous.github.io/ComfyUI_examples/wan/). Enjoy! ## πŸ“‘ Todo List @@ -35,14 +36,15 @@ In this repository, we present **Wan2.1**, a comprehensive and open suite of vid - [x] Multi-GPU Inference code of the 14B and 1.3B models - [x] Checkpoints of the 14B and 1.3B models - [x] Gradio demo + - [x] ComfyUI integration - [ ] Diffusers integration - - [ ] ComfyUI integration - Wan2.1 Image-to-Video - [x] Multi-GPU Inference code of the 14B model - [x] Checkpoints of the 14B model - [x] Gradio demo + - [X] ComfyUI integration - [ ] Diffusers integration - - [ ] ComfyUI integration + ## Quickstart @@ -329,7 +331,7 @@ We test the computational efficiency of different **Wan2.1** models on different ## Community Contributions -- [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) provides more support for Wan, including video-to-video, FP8 quantization, VRAM optimization, LoRA training, and more. Please refer to [their examples](https://github.com/modelscope/DiffSynth-Studio/tree/main/examples/wanvideo). +- [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio) provides more support for **Wan2.1**, including video-to-video, FP8 quantization, VRAM optimization, LoRA training, and more. Please refer to [their examples](https://github.com/modelscope/DiffSynth-Studio/tree/main/examples/wanvideo). -------