Merge remote-tracking branch 'myfork/main'

This commit is contained in:
Bakhtiyor Sulaymonov 2025-02-26 22:18:27 +05:00
commit 04bf7390fe
6 changed files with 15 additions and 5 deletions

View File

@ -79,6 +79,11 @@ pip install "huggingface_hub[cli]"
huggingface-cli download Wan-AI/Wan2.1-T2V-14B --local-dir ./Wan2.1-T2V-14B 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 #### 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: 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:

View File

@ -2,6 +2,7 @@
import argparse import argparse
import gc import gc
import os.path as osp import os.path as osp
import os
import sys import sys
import warnings import warnings
@ -10,7 +11,7 @@ import gradio as gr
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
# Model # 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 import wan
from wan.configs import MAX_AREA_CONFIGS, WAN_CONFIGS from wan.configs import MAX_AREA_CONFIGS, WAN_CONFIGS
from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander

View File

@ -1,6 +1,7 @@
# Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved. # Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved.
import argparse import argparse
import os.path as osp import os.path as osp
import os
import sys import sys
import warnings import warnings
@ -9,7 +10,7 @@ import gradio as gr
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
# Model # 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 import wan
from wan.configs import WAN_CONFIGS from wan.configs import WAN_CONFIGS
from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander

View File

@ -1,6 +1,7 @@
# Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved. # Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved.
import argparse import argparse
import os.path as osp import os.path as osp
import os
import sys import sys
import warnings import warnings
@ -9,7 +10,7 @@ import gradio as gr
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
# Model # 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 import wan
from wan.configs import WAN_CONFIGS from wan.configs import WAN_CONFIGS
from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander
@ -45,7 +46,7 @@ def t2v_generation(txt2vid_prompt, resolution, sd_steps, guide_scale,
guide_scale=guide_scale, guide_scale=guide_scale,
n_prompt=n_prompt, n_prompt=n_prompt,
seed=seed, seed=seed,
offload_model=False) offload_model=True)
cache_video( cache_video(
tensor=video[None], tensor=video[None],

View File

@ -1,6 +1,7 @@
# Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved. # Copyright 2024-2025 The Alibaba Wan Team Authors. All rights reserved.
import argparse import argparse
import os.path as osp import os.path as osp
import os
import sys import sys
import warnings import warnings
@ -9,7 +10,7 @@ import gradio as gr
warnings.filterwarnings('ignore') warnings.filterwarnings('ignore')
# Model # 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 import wan
from wan.configs import WAN_CONFIGS from wan.configs import WAN_CONFIGS
from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander from wan.utils.prompt_extend import DashScopePromptExpander, QwenPromptExpander

View File

@ -252,6 +252,7 @@ class WanT2V:
x0 = latents x0 = latents
if offload_model: if offload_model:
self.model.cpu() self.model.cpu()
torch.cuda.empty_cache()
if self.rank == 0: if self.rank == 0:
videos = self.vae.decode(x0) videos = self.vae.decode(x0)