diff --git a/README.md b/README.md index 2301d87..52aa338 100644 --- a/README.md +++ b/README.md @@ -27,13 +27,13 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models - WanGP will keep the last generated videos in the Gallery and will remember the last model you used if you restart the app but kept the Web page open Taking care of your life is not enough, you want new stuff to play with ? -- MMAudio directly inside WanGP : add an audio soundtrack that matches the content of your video. By the way it is a low VRAM MMAudio and 6 GB of VRAM should be sufficient +- MMAudio directly inside WanGP : add an audio soundtrack that matches the content of your video. By the way it is a low VRAM MMAudio and 6 GB of VRAM should be sufficient. You will need to go in the *Extensions* tab of the WanGP *Configuration* to enalbe MMAudio - Forgot to upsample your video during the generation ? want to try another MMAudio variation ? Fear not you can also apply upsampling or add an MMAudio track once the video generation is done. Even better you can ask WangGP for multiple variations of MMAudio to pick the one you like best - MagCache support: a new step skipping approach, supposed to be better than TeaCache. Makes a difference if you usually generate with a high number of steps - SageAttention2++ support : not just the compatibility but also a slightly reduced VRAM usage - Video2Video in Wan Text2Video : this is the paradox, a text2video can become a video2video if you start the denoising process later on an existing video - FusioniX upsampler: this is an illustration of Video2Video in Text2Video. Use the FusioniX text2video model with an output resolution of 1080p and a denoising strength of 0.25 and you will get one of the best upsamplers (in only 2/3 steps, you will need lots of VRAM though). Increase the denoising strength and you will get one of the best Video Restorer -- Preliminary support for multiple Wan Samplers +- Preliminary support for multiple Wan Samplers / Schedulers ### June 23 2025: WanGP v6.3, Vace Unleashed. Thought we couldnt squeeze Vace even more ? - Multithreaded preprocessing when possible for faster generations diff --git a/wgp.py b/wgp.py index 1a3286e..9615a96 100644 --- a/wgp.py +++ b/wgp.py @@ -41,6 +41,7 @@ from preprocessing.matanyone import app as matanyone_app from tqdm import tqdm import requests + global_queue_ref = [] AUTOSAVE_FILENAME = "queue.zip" PROMPT_VARS_MAX = 10 @@ -2136,6 +2137,31 @@ def get_hunyuan_text_encoder_filename(text_encoder_quantization): return text_encoder_filename +def process_files_def(repoId, sourceFolderList, fileList): + from huggingface_hub import hf_hub_download, snapshot_download + targetRoot = "ckpts/" + for sourceFolder, files in zip(sourceFolderList,fileList ): + if len(files)==0: + if not Path(targetRoot + sourceFolder).exists(): + snapshot_download(repo_id=repoId, allow_patterns=sourceFolder +"/*", local_dir= targetRoot) + else: + for onefile in files: + if len(sourceFolder) > 0: + if not os.path.isfile(targetRoot + sourceFolder + "/" + onefile ): + hf_hub_download(repo_id=repoId, filename=onefile, local_dir = targetRoot, subfolder=sourceFolder) + else: + if not os.path.isfile(targetRoot + onefile ): + hf_hub_download(repo_id=repoId, filename=onefile, local_dir = targetRoot) + +def download_mmaudio(): + if server_config.get("mmaudio_enabled", 0) != 0: + enhancer_def = { + "repoId" : "DeepBeepMeep/Wan2.1", + "sourceFolderList" : [ "mmaudio", "DFN5B-CLIP-ViT-H-14-378" ], + "fileList" : [ ["mmaudio_large_44k_v2.pth", "synchformer_state_dict.pth", "v1-44.pth"],["open_clip_config.json", "open_clip_pytorch_model.bin"]] + } + process_files_def(**enhancer_def) + def download_models(model_filename, model_type): def computeList(filename): if filename == None: @@ -2144,22 +2170,8 @@ def download_models(model_filename, model_type): filename = filename[pos+1:] return [filename] - def process_files_def(repoId, sourceFolderList, fileList): - targetRoot = "ckpts/" - for sourceFolder, files in zip(sourceFolderList,fileList ): - if len(files)==0: - if not Path(targetRoot + sourceFolder).exists(): - snapshot_download(repo_id=repoId, allow_patterns=sourceFolder +"/*", local_dir= targetRoot) - else: - for onefile in files: - if len(sourceFolder) > 0: - if not os.path.isfile(targetRoot + sourceFolder + "/" + onefile ): - hf_hub_download(repo_id=repoId, filename=onefile, local_dir = targetRoot, subfolder=sourceFolder) - else: - if not os.path.isfile(targetRoot + onefile ): - hf_hub_download(repo_id=repoId, filename=onefile, local_dir = targetRoot) - from huggingface_hub import hf_hub_download, snapshot_download + from urllib.request import urlretrieve from wan.utils.utils import create_progress_hook @@ -2180,15 +2192,7 @@ def download_models(model_filename, model_type): } process_files_def(**enhancer_def) - if server_config.get("mmaudio_enabled", 0) != 0: - enhancer_def = { - "repoId" : "DeepBeepMeep/Wan2.1", - "sourceFolderList" : [ "mmaudio", "DFN5B-CLIP-ViT-H-14-378" ], - "fileList" : [ ["mmaudio_large_44k_v2.pth", "synchformer_state_dict.pth", "v1-44.pth"],["open_clip_config.json", "open_clip_pytorch_model.bin"]] - } - process_files_def(**enhancer_def) - - + download_mmaudio() def download_file(url,filename): if url.startswith("https://huggingface.co/") and "/resolve/main/" in url: @@ -2686,7 +2690,8 @@ def apply_changes( state, model_choice = generate_dropdown_model_list(transformer_type) header = generate_header(state["model_type"], compile=compile, attention_mode= attention_mode) - return "