Skip to content
Python

Multi checkpoints folders support

DeepBeepMeep61817be4517b
diff --git a/README.md b/README.md
index e7e9400..126e97d 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,7 @@ WanGP supports the Wan (and derived models), Hunyuan Video and LTV Video models
**Follow DeepBeepMeep on Twitter/X to get the Latest News**: https://x.com/deepbeepmeep
## 🔥 Latest Updates :
-### October 5 2025: WanGP v8.993 - One Last Thing before the Big Unknown ...
+### October 6 2025: WanGP v8.993 - A few last things before the Big Unknown ...
This new version hasn't any new model...
@@ -37,11 +37,14 @@ I have created the new Discord Channel **share-your-settings** where you can pos
The *Scaled FP8 format* is widely used as it the format used by ... *ComfyUI*. So I except a flood of Finetunes in the *share-your-finetune* channel. If not it means this feature was useless and I will remove it 😈😈😈
+Not enough Space left on your SSD to download more models ? Would like to reuse Scaled FP8 files in your ComfyUI Folder without duplicating them ? Here comes *WanGP 8.994* **Multiple Checkpoints Folders** : you just need to move the files into different folders / hard drives or reuse existing folders and let know WanGP about it in the *Config Tab* and WanGP will be able to put all the parts together.
+
Last but not least the Lora's documentation has been updated.
*update 8.991*: full power of *Vace Lynx* unleashed with new combinations such as Landscape + Face / Clothes + Face / Injectd Frame (Start/End frames/...) + Face
*update 8.992*: optimized gen with Lora, should be 10% faster if many loras
*update 8.993*: Support for *Scaled FP8* format and samples *Paligenesis* finetunes, merged Loras Accelerators and Non Accelerators
+*update 8.994*: Added custom checkpoints folders
### September 30 2025: WanGP v8.9 - Combinatorics
diff --git a/defaults/animate.json b/defaults/animate.json
index 3289197..bf45f4a 100644
--- a/defaults/animate.json
+++ b/defaults/animate.json
@@ -12,7 +12,6 @@
[
"https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/wan2.2_animate_relighting_lora.safetensors"
],
- "profiles_dir": [ "profiles_wan" ],
"group": "wan2_2"
}
}
\ No newline at end of file
diff --git a/defaults/flux.json b/defaults/flux.json
index 87bab0f..724ec1a 100644
--- a/defaults/flux.json
+++ b/defaults/flux.json
@@ -7,8 +7,7 @@
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-dev_bf16.safetensors",
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-dev_quanto_bf16_int8.safetensors"
],
- "image_outputs": true,
- "flux-model": "flux-dev"
+ "image_outputs": true
},
"prompt": "draw a hat",
"resolution": "1280x720",
diff --git a/defaults/flux_chroma.json b/defaults/flux_chroma.json
index 7ffc426..ebb8076 100644
--- a/defaults/flux_chroma.json
+++ b/defaults/flux_chroma.json
@@ -1,14 +1,13 @@
{
"model": {
"name": "Flux 1 Chroma 1 HD 8.9B",
- "architecture": "flux",
+ "architecture": "flux_chroma",
"description": "FLUX.1 Chroma is a 8.9 billion parameters model. As a base model, Chroma1 is intentionally designed to be an excellent starting point for finetuning. It provides a strong, neutral foundation for developers, researchers, and artists to create specialized models..",
"URLs": [
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-chroma_hd_bf16.safetensors",
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-chroma_hd_quanto_bf16_int8.safetensors"
],
- "image_outputs": true,
- "flux-model": "flux-chroma"
+ "image_outputs": true
},
"prompt": "draw a hat",
"resolution": "1280x720",
diff --git a/defaults/flux_dev_kontext.json b/defaults/flux_dev_kontext.json
index 20b6bc4..cf3631a 100644
--- a/defaults/flux_dev_kontext.json
+++ b/defaults/flux_dev_kontext.json
@@ -1,13 +1,12 @@
{
"model": {
"name": "Flux 1 Dev Kontext 12B",
- "architecture": "flux",
+ "architecture": "flux_dev_kontext",
"description": "FLUX.1 Kontext is a 12 billion parameter rectified flow transformer capable of editing images based on instructions stored in the Prompt. Please be aware that Flux Kontext is picky on the resolution of the input image and the output dimensions may not match the dimensions of the input image.",
"URLs": [
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1_kontext_dev_bf16.safetensors",
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1_kontext_dev_quanto_bf16_int8.safetensors"
- ],
- "flux-model": "flux-dev-kontext"
+ ]
},
"prompt": "add a hat",
"resolution": "1280x720",
diff --git a/defaults/flux_dev_umo.json b/defaults/flux_dev_umo.json
index 57164bb..ea73680 100644
--- a/defaults/flux_dev_umo.json
+++ b/defaults/flux_dev_umo.json
@@ -1,10 +1,9 @@
{
"model": {
"name": "Flux 1 Dev UMO 12B",
- "architecture": "flux",
+ "architecture": "flux_dev_umo",
"description": "FLUX.1 Dev UMO is a model that can Edit Images with a specialization in combining multiple image references (resized internally at 512x512 max) to produce an Image output. Best Image preservation at 768x768 Resolution Output.",
"URLs": "flux",
- "flux-model": "flux-dev-umo",
"loras": ["https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-dev-UMO_dit_lora_bf16.safetensors"],
"resolutions": [ ["1024x1024 (1:1)", "1024x1024"],
["768x1024 (3:4)", "768x1024"],
diff --git a/defaults/flux_dev_uso.json b/defaults/flux_dev_uso.json
index 806dd7e..fee8f25 100644
--- a/defaults/flux_dev_uso.json
+++ b/defaults/flux_dev_uso.json
@@ -1,12 +1,11 @@
{
"model": {
"name": "Flux 1 Dev USO 12B",
- "architecture": "flux",
+ "architecture": "flux_dev_uso",
"description": "FLUX.1 Dev USO is a model that can Edit Images with a specialization in Style Transfers (up to two).",
"modules": [ ["https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-dev-USO_projector_bf16.safetensors"]],
"URLs": "flux",
- "loras": ["https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-dev-USO_dit_lora_bf16.safetensors"],
- "flux-model": "flux-dev-uso"
+ "loras": ["https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-dev-USO_dit_lora_bf16.safetensors"]
},
"prompt": "the man is wearing a hat",
"embedded_guidance_scale": 4,
diff --git a/defaults/flux_krea.json b/defaults/flux_krea.json
index 3caba1a..4fa0b3f 100644
--- a/defaults/flux_krea.json
+++ b/defaults/flux_krea.json
@@ -7,8 +7,7 @@
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-krea-dev_bf16.safetensors",
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-krea-dev_quanto_bf16_int8.safetensors"
],
- "image_outputs": true,
- "flux-model": "flux-dev"
+ "image_outputs": true
},
"prompt": "draw a hat",
"resolution": "1280x720",
diff --git a/defaults/flux_schnell.json b/defaults/flux_schnell.json
index d7abcde..1645a86 100644
--- a/defaults/flux_schnell.json
+++ b/defaults/flux_schnell.json
@@ -1,14 +1,13 @@
{
"model": {
"name": "Flux 1 Schnell 12B",
- "architecture": "flux",
+ "architecture": "flux_schnell",
"description": "FLUX.1 Schnell is a 12 billion parameter rectified flow transformer capable of generating images from text descriptions. As a distilled model it requires fewer denoising steps.",
"URLs": [
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-schnell_bf16.safetensors",
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-schnell_quanto_bf16_int8.safetensors"
],
- "image_outputs": true,
- "flux-model": "flux-schnell"
+ "image_outputs": true
},
"prompt": "draw a hat",
"resolution": "1280x720",
diff --git a/defaults/flux_srpo.json b/defaults/flux_srpo.json
index 59f07c6..188c162 100644
--- a/defaults/flux_srpo.json
+++ b/defaults/flux_srpo.json
@@ -6,8 +6,7 @@
"URLs": [
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-srpo-dev_bf16.safetensors",
"https://huggingface.co/DeepBeepMeep/Flux/resolve/main/flux1-srpo-dev_quanto_bf16_int8.safetensors"
- ],
- "flux-model": "flux-dev"
+ ]
},
"prompt": "draw a hat",
"resolution": "1024x1024",
diff --git a/defaults/flux_srpo_uso.json b/defaults/flux_srpo_uso.json
index ddfe50d..e43371d 100644
--- a/defaults/flux_srpo_uso.json
+++ b/defaults/flux_srpo_uso.json
@@ -1,12 +1,11 @@
{
"model": {
"name": "Flux 1 SRPO USO 12B",
- "architecture": "flux",
+ "architecture": "flux_dev_uso",
"description": "FLUX.1 SRPO USO is a model that can Edit Images with a specialization in Style Transfers (up to two). It leverages the improved Image quality brought by the SRPO process",
"modules": [ "flux_dev_uso"],
"URLs": "flux_srpo",
- "loras": "flux_dev_uso",
- "flux-model": "flux-dev-uso"
+ "loras": "flux_dev_uso"
},
"prompt": "the man is wearing a hat",
"embedded_guidance_scale": 4,
diff --git a/defaults/vace_14B_2_2.json b/defaults/vace_14B_2_2.json
new file mode 100644
index 0000000..6aa8cf8
--- /dev/null
+++ b/defaults/vace_14B_2_2.json
@@ -0,0 +1,18 @@
+{
+ "model": {
+ "name": "Wan2.2 Vace Experimental 14B",
+ "architecture": "vace_14B_2_2",
+ "modules": [
+ "vace_14B"
+ ],
+ "description": "There is so far only PARTIAL support of Vace 2.1 which is currently used.",
+ "URLs": "t2v_2_2",
+ "URLs2": "t2v_2_2",
+ "visible": false
+ },
+ "guidance_phases": 2,
+ "guidance_scale": 1,
+ "guidance2_scale": 1,
+ "flow_shift": 2,
+ "switch_threshold" : 875
+}
\ No newline at end of file
diff --git a/defaults/vace_14B_cocktail_2_2.json b/defaults/vace_14B_cocktail_2_2.json
index 5783922..a704241 100644
--- a/defaults/vace_14B_cocktail_2_2.json
+++ b/defaults/vace_14B_cocktail_2_2.json
@@ -1,7 +1,7 @@
{
"model": {
"name": "Wan2.2 Vace Experimental Cocktail 14B",
- "architecture": "vace_14B",
+ "architecture": "vace_14B_2_2",
"modules": [
"vace_14B"
],
diff --git a/defaults/vace_14B_lightning_3p_2_2.json b/defaults/vace_14B_lightning_3p_2_2.json
index fca6cb8..00bca66 100644
--- a/defaults/vace_14B_lightning_3p_2_2.json
+++ b/defaults/vace_14B_lightning_3p_2_2.json
@@ -1,7 +1,7 @@
{
"model": {
"name": "Wan2.2 Vace Lightning 3 Phases 14B",
- "architecture": "vace_14B",
+ "architecture": "vace_14B_2_2",
"modules": [
"vace_14B"
],
diff --git a/defaults/vace_fun_14B_2_2.json b/defaults/vace_fun_14B_2_2.json
index 8f22d34..febf5ea 100644
--- a/defaults/vace_fun_14B_2_2.json
+++ b/defaults/vace_fun_14B_2_2.json
@@ -1,7 +1,7 @@
{
"model": {
"name": "Wan2.2 Vace Fun 14B",
- "architecture": "vace_14B",
+ "architecture": "vace_14B_2_2",
"description": "This is the Fun Vace 2.2 version, that is not the official Vace 2.2",
"URLs": [
"https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/Wan2_2_Fun_VACE_A14B_HIGH_mbf16.safetensors",
diff --git a/loras/profiles_wan/Text2Video Cocktail - 10 Steps.json b/loras/profiles_wan/Text2Video Cocktail - 10 Steps.json
deleted file mode 100644
index 087e49c..0000000
--- a/loras/profiles_wan/Text2Video Cocktail - 10 Steps.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/Wan21_CausVid_14B_T2V_lora_rank32_v2.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/DetailEnhancerV1.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/Wan21_AccVid_T2V_14B_lora_rank32_fp16.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/Wan21_T2V_14B_MoviiGen_lora_rank32_fp16.safetensors"
- ],
- "loras_multipliers": "1 0.5 0.5 0.5",
- "num_inference_steps": 10,
- "guidance_phases": 1,
- "guidance_scale": 1,
- "flow_shift": 2
-}
diff --git a/loras/profiles_wan/Text2Video FusioniX - 10 Steps.json b/loras/profiles_wan/Text2Video FusioniX - 10 Steps.json
deleted file mode 100644
index 9fabf09..0000000
--- a/loras/profiles_wan/Text2Video FusioniX - 10 Steps.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/Wan2.1_T2V_14B_FusionX_LoRA.safetensors"
- ],
- "loras_multipliers": "1",
- "num_inference_steps": 10,
- "guidance_phases": 1,
- "guidance_scale": 1,
- "flow_shift": 2
-}
diff --git a/loras/profiles_wan/Text2Video Lightx2v Cfg Step Distill Rank32 - 4 Steps.json b/loras/profiles_wan/Text2Video Lightx2v Cfg Step Distill Rank32 - 4 Steps.json
deleted file mode 100644
index 8ed2a4d..0000000
--- a/loras/profiles_wan/Text2Video Lightx2v Cfg Step Distill Rank32 - 4 Steps.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/Wan21_T2V_14B_lightx2v_cfg_step_distill_lora_rank32.safetensors"
- ],
- "loras_multipliers": "1",
- "num_inference_steps": 4,
- "guidance_phases": 1,
- "guidance_scale": 1,
- "flow_shift": 2
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Fun Inp HPS2 Reward 2 Phases - 4 Steps.json b/loras/profiles_wan2_2/Fun Inp HPS2 Reward 2 Phases - 4 Steps.json
deleted file mode 100644
index 1b58ec7..0000000
--- a/loras/profiles_wan2_2/Fun Inp HPS2 Reward 2 Phases - 4 Steps.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "num_inference_steps": 8,
- "guidance_scale": 1,
- "guidance2_scale": 1,
- "model_switch_phase": 1,
- "switch_threshold": 876,
- "guidance_phases": 2,
- "flow_shift": 3,
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Fun-A14B-InP-high-noise-HPS2.1.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Fun-A14B-InP-low-noise-HPS2.1.safetensors"
- ],
- "loras_multipliers": "1;0 0;1"
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Fun Inp MPS Reward 2 Phases - 4 Steps.json b/loras/profiles_wan2_2/Fun Inp MPS Reward 2 Phases - 4 Steps.json
deleted file mode 100644
index cc57422..0000000
--- a/loras/profiles_wan2_2/Fun Inp MPS Reward 2 Phases - 4 Steps.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "num_inference_steps": 4,
- "guidance_scale": 1,
- "guidance2_scale": 1,
- "model_switch_phase": 1,
- "switch_threshold": 876,
- "guidance_phases": 2,
- "flow_shift": 3,
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Fun-A14B-InP-high-noise-MPS.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Fun-A14B-InP-low-noise-MPS.safetensors"
- ],
- "loras_multipliers": "1;0 0;1"
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Lightning v1.0 2 Phases - 4 Steps.json b/loras/profiles_wan2_2/Lightning v1.0 2 Phases - 4 Steps.json
deleted file mode 100644
index 51c903b..0000000
--- a/loras/profiles_wan2_2/Lightning v1.0 2 Phases - 4 Steps.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "num_inference_steps": 4,
- "guidance_scale": 1,
- "guidance2_scale": 1,
- "model_switch_phase": 1,
- "switch_threshold": 876,
- "guidance_phases": 2,
- "flow_shift": 3,
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Lightning_T2V-v1.1-A14B-4steps-lora_HIGH_fp16.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Lightning_T2V-v1.1-A14B-4steps-lora_LOW_fp16.safetensors"
- ],
- "loras_multipliers": "1;0 0;1"
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Lightning v1.0 3 Phases - 8 Steps.json b/loras/profiles_wan2_2/Lightning v1.0 3 Phases - 8 Steps.json
deleted file mode 100644
index a308344..0000000
--- a/loras/profiles_wan2_2/Lightning v1.0 3 Phases - 8 Steps.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "num_inference_steps": 8,
- "guidance_scale": 3.5,
- "guidance2_scale": 1,
- "guidance3_scale": 1,
- "switch_threshold": 965,
- "switch_threshold2": 800,
- "guidance_phases": 3,
- "model_switch_phase": 2,
- "flow_shift": 3,
- "sample_solver": "euler",
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Lightning_T2V-v1.1-A14B-4steps-lora_HIGH_fp16.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2.2-Lightning_T2V-v1.1-A14B-4steps-lora_LOW_fp16.safetensors"
- ],
- "loras_multipliers": "0;1;0 0;0;1",
- "help": "This finetune uses the Lightning 4 steps Loras Accelerator for Wan 2.2 but extend them to 8 steps in order to insert a CFG phase before the 2 accelerated phases with no Guidance. The ultimate goal is reduce the slow motion effect of these Loras Accelerators."
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Lightning v2025-09-28 - 4 Steps.json b/loras/profiles_wan2_2/Lightning v2025-09-28 - 4 Steps.json
deleted file mode 100644
index 31e4f0d..0000000
--- a/loras/profiles_wan2_2/Lightning v2025-09-28 - 4 Steps.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "num_inference_steps": 4,
- "guidance_scale": 1,
- "guidance2_scale": 1,
- "switch_threshold": 876,
- "model_switch_phase": 1,
- "guidance_phases": 2,
- "flow_shift": 3,
- "loras_multipliers": "1;0 0;1",
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan22_A14B_T2V_HIGH_Lightning_4steps_lora_250928_rank128_fp16.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan22_A14B_T2V_LOW_Lightning_4steps_lora_250928_rank64_fp16.safetensors"
- ]
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Lightning v2025-09-28 2 Phases - 4 Steps.json b/loras/profiles_wan2_2/Lightning v2025-09-28 2 Phases - 4 Steps.json
deleted file mode 100644
index 31e4f0d..0000000
--- a/loras/profiles_wan2_2/Lightning v2025-09-28 2 Phases - 4 Steps.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "num_inference_steps": 4,
- "guidance_scale": 1,
- "guidance2_scale": 1,
- "switch_threshold": 876,
- "model_switch_phase": 1,
- "guidance_phases": 2,
- "flow_shift": 3,
- "loras_multipliers": "1;0 0;1",
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan22_A14B_T2V_HIGH_Lightning_4steps_lora_250928_rank128_fp16.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan22_A14B_T2V_LOW_Lightning_4steps_lora_250928_rank64_fp16.safetensors"
- ]
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Lightning v2025-09-28 3 Phases - 8 Steps.json b/loras/profiles_wan2_2/Lightning v2025-09-28 3 Phases - 8 Steps.json
deleted file mode 100644
index 839e056..0000000
--- a/loras/profiles_wan2_2/Lightning v2025-09-28 3 Phases - 8 Steps.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "num_inference_steps": 8,
- "guidance_scale": 3.5,
- "guidance2_scale": 1,
- "guidance3_scale": 1,
- "switch_threshold": 965,
- "switch_threshold2": 800,
- "guidance_phases": 3,
- "model_switch_phase": 2,
- "flow_shift": 3,
- "sample_solver": "euler",
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan22_A14B_T2V_HIGH_Lightning_4steps_lora_250928_rank128_fp16.safetensors",
- "https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan22_A14B_T2V_LOW_Lightning_4steps_lora_250928_rank64_fp16.safetensors"
- ],
- "loras_multipliers": "0;1;0 0;0;1",
- "help": "This finetune uses the Lightning 250928 4 steps Loras Accelerator for Wan 2.2 but extend them to 8 steps in order to insert a CFG phase before the 2 accelerated phases with no Guidance. The ultimate goal is reduce the slow motion effect of these Loras Accelerators."
-}
\ No newline at end of file
diff --git a/loras/profiles_wan2_2/Text2Video FusioniX - 10 Steps.json b/loras/profiles_wan2_2/Text2Video FusioniX - 10 Steps.json
deleted file mode 100644
index 1ad921b..0000000
--- a/loras/profiles_wan2_2/Text2Video FusioniX - 10 Steps.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
-
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/Wan2.1_T2V_14B_FusionX_LoRA.safetensors"
- ],
- "loras_multipliers": "1",
- "num_inference_steps": 10,
- "guidance_scale": 1,
- "guidance2_scale": 1,
- "guidance_phases": 2,
- "flow_shift": 2
-}
diff --git a/loras/profiles_wan2_2_5B/FastWan 3 Steps.json b/loras/profiles_wan2_2_5B/FastWan 3 Steps.json
deleted file mode 100644
index 1e0383c..0000000
--- a/loras/profiles_wan2_2_5B/FastWan 3 Steps.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "activated_loras": ["https://huggingface.co/DeepBeepMeep/Wan2.2/resolve/main/loras_accelerators/Wan2_2_5B_FastWanFullAttn_lora_rank_128_bf16.safetensors"],
- "guidance_scale": 1,
- "flow_shift": 3,
- "num_inference_steps": 3,
- "loras_multipliers": "1"
-}
\ No newline at end of file
diff --git a/loras_i2v/profiles_wan/Image2Video FusioniX - 10 Steps.json b/loras_i2v/profiles_wan/Image2Video FusioniX - 10 Steps.json
deleted file mode 100644
index 1fe4c14..0000000
--- a/loras_i2v/profiles_wan/Image2Video FusioniX - 10 Steps.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-
- "activated_loras": [
- "https://huggingface.co/DeepBeepMeep/Wan2.1/resolve/main/loras_accelerators/Wan2.1_I2V_14B_FusionX_LoRA.safetensors"
- ],
- "loras_multipliers": "1",
- "num_inference_steps": 10,
- "guidance_phases": 1,
- "guidance_scale": 1
-}
diff --git a/models/flux/flux_handler.py b/models/flux/flux_handler.py
index 471c339..cff1af4 100644
--- a/models/flux/flux_handler.py
+++ b/models/flux/flux_handler.py
@@ -1,15 +1,35 @@
import torch
+from shared.utils import files_locator as fl
def get_ltxv_text_encoder_filename(text_encoder_quantization):
- text_encoder_filename = "ckpts/T5_xxl_1.1/T5_xxl_1.1_enc_bf16.safetensors"
+ text_encoder_filename = "T5_xxl_1.1/T5_xxl_1.1_enc_bf16.safetensors"
if text_encoder_quantization =="int8":
text_encoder_filename = text_encoder_filename.replace("bf16", "quanto_bf16_int8")
- return text_encoder_filename
+ return fl.locate_file(text_encoder_filename, True)
class family_handler():
@staticmethod
+ def query_supported_types():
+ return ["flux", "flux_chroma", "flux_dev_kontext", "flux_dev_umo", "flux_dev_uso", "flux_schnell" ]
+
+ @staticmethod
+ def query_family_maps():
+
+ models_eqv_map = {
+ "flux_dev_kontext" : "flux",
+ "flux_dev_umo" : "flux",
+ "flux_dev_uso" : "flux",
+ "flux_schnell" : "flux",
+ "flux_chroma" : "flux",
+ }
+
+ models_comp_map = {
+ "flux": ["flux_chroma", "flux_dev_kontext", "flux_dev_umo", "flux_dev_uso", "flux_schnell" ]
+ }
+ return models_eqv_map, models_comp_map
+ @staticmethod
def query_model_def(base_model_type, model_def):
- flux_model = model_def.get("flux-model", "flux-dev")
+ flux_model = "flux-dev" if base_model_type == "flux" else base_model_type.replace("_", "-")
flux_schnell = flux_model == "flux-schnell"
flux_chroma = flux_model == "flux-chroma"
flux_uso = flux_model == "flux-dev-uso"
@@ -19,6 +39,7 @@ class family_handler():
extra_model_def = {
"image_outputs" : True,
"no_negative_prompt" : not flux_chroma,
+ "flux-model": flux_model,
}
if flux_chroma:
extra_model_def["guidance_max_phases"] = 1
@@ -60,13 +81,6 @@ class family_handler():
return extra_model_def
- @staticmethod
- def query_supported_types():
- return ["flux"]
-
- @staticmethod
- def query_family_maps():
- return {}, {}
@staticmethod
def get_rgb_factors(base_model_type ):
diff --git a/models/flux/flux_main.py b/models/flux/flux_main.py
index 6746a23..7f18d9d 100644
--- a/models/flux/flux_main.py
+++ b/models/flux/flux_main.py
@@ -12,6 +12,7 @@ from transformers import SiglipVisionModel, SiglipImageProcessor
import torchvision.transforms.functional as TVF
import math
from shared.utils.utils import convert_image_to_tensor, convert_tensor_to_image
+from shared.utils import files_locator as fl
from .util import (
aspect_ratio_to_height_width,
@@ -101,7 +102,7 @@ class model_factory:
siglip_processor = siglip_model = feature_embedder = None
if self.name == 'flux-dev-uso':
- siglip_path = "ckpts/siglip-so400m-patch14-384"
+ siglip_path = fl.locate_folder("siglip-so400m-patch14-384")
siglip_processor = SiglipImageProcessor.from_pretrained(siglip_path)
siglip_model = SiglipVisionModel.from_pretrained(siglip_path)
siglip_model.eval().to("cpu")
diff --git a/models/flux/util.py b/models/flux/util.py
index af75f62..909d6b4 100644
--- a/models/flux/util.py
+++ b/models/flux/util.py
@@ -14,6 +14,7 @@ from safetensors.torch import load_file as load_sft
from .model import Flux, FluxLoraWrapper, FluxParams
from .modules.autoencoder import AutoEncoder, AutoEncoderParams
from .modules.conditioner import HFEmbedder
+from shared.utils import files_locator as fl
CHECKPOINTS_DIR = Path("checkpoints")
@@ -756,12 +757,12 @@ def load_t5(device: str | torch.device = "cuda", text_encoder_filename = None, m
def load_clip(device: str | torch.device = "cuda") -> HFEmbedder:
- return HFEmbedder("ckpts/clip_vit_large_patch14", "", max_length=77, torch_dtype=torch.bfloat16, is_clip =True).to(device)
+ return HFEmbedder( fl.locate_folder("clip_vit_large_patch14"), "", max_length=77, torch_dtype=torch.bfloat16, is_clip =True).to(device)
def load_ae(name: str, device: str | torch.device = "cuda") -> AutoEncoder:
config = configs[name]
- ckpt_path = str(get_checkpoint_path(config.repo_id, config.repo_ae, "FLUX_AE"))
+ ckpt_path = str(get_checkpoint_path(config.repo_id, fl.locate_file("flux_vae.safetensors"), "FLUX_AE"))
# Loading the autoencoder
with torch.device("meta"):
diff --git a/models/hyvideo/hunyuan.py b/models/hyvideo/hunyuan.py
index aa6c3b3..91aaf7f 100644
--- a/models/hyvideo/hunyuan.py
+++ b/models/hyvideo/hunyuan.py
@@ -3,7 +3,7 @@ import time
import random
import functools
from typing import List, Optional, Tuple, Union
-
+from shared.utils import files_locator as fl
from pathlib import Path
from einops import rearrange
import torch
@@ -405,14 +405,14 @@ class Inference(object):
# ============================= Build extra models ========================
# VAE
if custom or avatar:
- vae_configpath = "ckpts/hunyuan_video_custom_VAE_config.json"
- vae_filepath = "ckpts/hunyuan_video_custom_VAE_fp32.safetensors"
+ vae_configpath = fl.locate_file("hunyuan_video_custom_VAE_config.json")
+ vae_filepath = fl.locate_file("hunyuan_video_custom_VAE_fp32.safetensors")
# elif avatar:
# vae_configpath = "ckpts/config_vae_avatar.json"
# vae_filepath = "ckpts/vae_avatar.pt"
else:
- vae_configpath = "ckpts/hunyuan_video_VAE_config.json"
- vae_filepath = "ckpts/hunyuan_video_VAE_fp32.safetensors"
+ vae_configpath = fl.locate_file("hunyuan_video_VAE_config.json")
+ vae_filepath = fl.locate_file("hunyuan_video_VAE_fp32.safetensors")
# config = AutoencoderKLCausal3D.load_config("ckpts/hunyuan_video_VAE_config.json")
# config = AutoencoderKLCausal3D.load_config("c:/temp/hvae/config_vae.json")
@@ -486,12 +486,12 @@ class Inference(object):
align_instance = None
if avatar or custom_audio:
- feature_extractor = AutoFeatureExtractor.from_pretrained("ckpts/whisper-tiny/")
- wav2vec = WhisperModel.from_pretrained("ckpts/whisper-tiny/").to(device="cpu", dtype=torch.float32)
+ feature_extractor = AutoFeatureExtractor.from_pretrained(fl.locate_folder("whisper-tiny"))
+ wav2vec = WhisperModel.from_pretrained(fl.locate_folder("whisper-tiny")).to(device="cpu", dtype=torch.float32)
wav2vec._model_dtype = torch.float32
wav2vec.requires_grad_(False)
if avatar:
- align_instance = AlignImage("cuda", det_path="ckpts/det_align/detface.pt")
+ align_instance = AlignImage("cuda", det_path= fl.locate_file("det_align/detface.pt"))
align_instance.facedet.model.to("cpu")
adapt_model(model, "audio_adapter_blocks")
elif custom_audio:
diff --git a/models/hyvideo/hunyuan_handler.py b/models/hyvideo/hunyuan_handler.py
index ebe07d2..4a0c035 100644
--- a/models/hyvideo/hunyuan_handler.py
+++ b/models/hyvideo/hunyuan_handler.py
@@ -1,12 +1,13 @@
import torch
+from shared.utils import files_locator as fl
def get_hunyuan_text_encoder_filename(text_encoder_quantization):
if text_encoder_quantization =="int8":
- text_encoder_filename = "ckpts/llava-llama-3-8b/llava-llama-3-8b-v1_1_vlm_quanto_int8.safetensors"
+ text_encoder_filename = "llava-llama-3-8b/llava-llama-3-8b-v1_1_vlm_quanto_int8.safetensors"
else:
- text_encoder_filename = "ckpts/llava-llama-3-8b/llava-llama-3-8b-v1_1_vlm_fp16.safetensors"
+ text_encoder_filename = "llava-llama-3-8b/llava-llama-3-8b-v1_1_vlm_fp16.safetensors"
- return text_encoder_filename
+ return fl.locate_file(text_encoder_filename, True)
class family_handler():
diff --git a/models/ltx_video/ltxv.py b/models/ltx_video/ltxv.py
index 080860c..7959c67 100644
--- a/models/ltx_video/ltxv.py
+++ b/models/ltx_video/ltxv.py
@@ -38,6 +38,7 @@ from .utils.skip_layer_strategy import SkipLayerStrategy
from .models.autoencoders.latent_upsampler import LatentUpsampler
from .pipelines import crf_compressor
import cv2
+from shared.utils import files_locator as fl
MAX_HEIGHT = 720
MAX_WIDTH = 1280
@@ -177,7 +178,7 @@ class LTXV:
# offload.save_model(transformer, "ckpts/ltxv_0.9.8_13B_quanto_bf16_int8.safetensors", do_quantize= True, config_file_path= "c:/temp/ltxv_config.json")
# vae = CausalVideoAutoencoder.from_pretrained(ckpt_path)
- vae = offload.fast_load_transformers_model("ckpts/ltxv_0.9.7_VAE.safetensors", modelClass=CausalVideoAutoencoder)
+ vae = offload.fast_load_transformers_model( fl.locate_file("ltxv_0.9.7_VAE.safetensors"), modelClass=CausalVideoAutoencoder)
# vae = offload.fast_load_transformers_model("ckpts/ltxv_0.9.8_VAE.safetensors", modelClass=CausalVideoAutoencoder)
# if VAE_dtype == torch.float16:
VAE_dtype = torch.bfloat16
@@ -196,11 +197,11 @@ class LTXV:
transformer._lock_dtype = torch.float
- scheduler = RectifiedFlowScheduler.from_pretrained("ckpts/ltxv_scheduler.json")
+ scheduler = RectifiedFlowScheduler.from_pretrained(fl.locate_file("ltxv_scheduler.json"))
# transformer = offload.fast_load_transformers_model("ltx_13B_quanto_bf16_int8.safetensors", modelClass=Transformer3DModel, modelPrefix= "model.diffusion_model", forcedConfigPath="config_transformer.json")
# offload.save_model(transformer, "ltx_13B_quanto_bf16_int8.safetensors", do_quantize= True, config_file_path="config_transformer.json")
- latent_upsampler = LatentUpsampler.from_pretrained("ckpts/ltxv_0.9.7_spatial_upscaler.safetensors").to("cpu").eval()
+ latent_upsampler = LatentUpsampler.from_pretrained(fl.locate_file("ltxv_0.9.7_spatial_upscaler.safetensors")).to("cpu").eval()
# latent_upsampler = LatentUpsampler.from_pretrained("ckpts/ltxv_0.9.8_spatial_upscaler.safetensors").to("cpu").eval()
latent_upsampler.to(VAE_dtype)
latent_upsampler._model_dtype = VAE_dtype
@@ -216,19 +217,13 @@ class LTXV:
text_encoder = offload.fast_load_transformers_model(text_encoder_filepath)
patchifier = SymmetricPatchifier(patch_size=1)
- tokenizer = T5Tokenizer.from_pretrained( "ckpts/T5_xxl_1.1")
+ tokenizer = T5Tokenizer.from_pretrained(fl.locate_folder("T5_xxl_1.1"))
enhance_prompt = False
- if enhance_prompt:
- prompt_enhancer_image_caption_model = AutoModelForCausalLM.from_pretrained( "ckpts/Florence2", trust_remote_code=True)
- prompt_enhancer_image_caption_processor = AutoProcessor.from_pretrained( "ckpts/Florence2", trust_remote_code=True)
- prompt_enhancer_llm_model = offload.fast_load_transformers_model("ckpts/Llama3_2_quanto_bf16_int8.safetensors")
- prompt_enhancer_llm_tokenizer = AutoTokenizer.from_pretrained("ckpts/Llama3_2")
- else:
- prompt_enhancer_image_caption_model = None
- prompt_enhancer_image_caption_processor = None
- prompt_enhancer_llm_model = None
- prompt_enhancer_llm_tokenizer = None
+ prompt_enhancer_image_caption_model = None
+ prompt_enhancer_image_caption_processor = None
+ prompt_enhancer_llm_model = None
+ prompt_enhancer_llm_tokenizer = None
# if prompt_enhancer_image_caption_model != None:
# pipe["prompt_enhancer_image_caption_model"] = prompt_enhancer_image_caption_model
@@ -489,7 +484,7 @@ class LTXV:
if letter in video_prompt_type:
for file_name in preloadURLs:
if signature in file_name:
- loras += [ os.path.join("ckpts", os.path.basename(file_name))]
+ loras += [ fl.locate_file(os.path.basename(file_name))]
break
loras_mult = [1.] * len(loras)
return loras, loras_mult
diff --git a/models/ltx_video/ltxv_handler.py b/models/ltx_video/ltxv_handler.py
index 8c322e1..6386f68 100644
--- a/models/ltx_video/ltxv_handler.py
+++ b/models/ltx_video/ltxv_handler.py
@@ -1,11 +1,12 @@
import torch
+from shared.utils import files_locator as fl
def get_ltxv_text_encoder_filename(text_encoder_quantization):
- text_encoder_filename = "ckpts/T5_xxl_1.1/T5_xxl_1.1_enc_bf16.safetensors"
+ text_encoder_filename = "T5_xxl_1.1/T5_xxl_1.1_enc_bf16.safetensors"
if text_encoder_quantization =="int8":
text_encoder_filename = text_encoder_filename.replace("bf16", "quanto_bf16_int8")
- return text_encoder_filename
+ return fl.locate_file(text_encoder_filename, True)
class family_handler():
@staticmethod
diff --git a/configs/qwen_image_20B.json b/models/qwen/configs/qwen_image_20B.json
similarity index 100%
rename from configs/qwen_image_20B.json
rename to models/qwen/configs/qwen_image_20B.json
diff --git a/models/qwen/qwen_handler.py b/models/qwen/qwen_handler.py
index 99864a5..2a3c848 100644
--- a/models/qwen/qwen_handler.py
+++ b/models/qwen/qwen_handler.py
@@ -1,12 +1,13 @@
import torch
import gradio as gr
+from shared.utils import files_locator as fl
def get_qwen_text_encoder_filename(text_encoder_quantization):
- text_encoder_filename = "ckpts/Qwen2.5-VL-7B-Instruct/Qwen2.5-VL-7B-Instruct_bf16.safetensors"
+ text_encoder_filename = "Qwen2.5-VL-7B-Instruct/Qwen2.5-VL-7B-Instruct_bf16.safetensors"
if text_encoder_quantization =="int8":
text_encoder_filename = text_encoder_filename.replace("bf16", "quanto_bf16_int8")
- return text_encoder_filename
+ return fl.locate_file(text_encoder_filename, True)
class family_handler():
@staticmethod
@@ -18,6 +19,7 @@ class family_handler():
("Lightning", "lightning")],
"guidance_max_phases" : 1,
"fit_into_canvas_image_refs": 0,
+ "profiles_dir": ["qwen"],
}
if base_model_type in ["qwen_image_edit_20B", "qwen_image_edit_plus_20B"]:
diff --git a/models/qwen/qwen_main.py b/models/qwen/qwen_main.py
index 8c4514f..bf27338 100644
--- a/models/qwen/qwen_main.py
+++ b/models/qwen/qwen_main.py
@@ -18,6 +18,7 @@ from diffusers import FlowMatchEulerDiscreteScheduler
from .pipeline_qwenimage import QwenImagePipeline
from PIL import Image
from shared.utils.utils import calculate_new_dimensions, convert_tensor_to_image
+from shared.utils import files_locator as fl
def stitch_images(img1, img2):
# Resize img2 to match img1's height
@@ -56,7 +57,7 @@ class model_factory():
tokenizer = AutoTokenizer.from_pretrained(os.path.join(checkpoint_dir,"Qwen2.5-VL-7B-Instruct"))
self.base_model_type = base_model_type
- base_config_file = "configs/qwen_image_20B.json"
+ base_config_file = "models/qwen/configs/qwen_image_20B.json"
with open(base_config_file, 'r', encoding='utf-8') as f:
transformer_config = json.load(f)
transformer_config.pop("_diffusers_version")
@@ -223,6 +224,6 @@ class model_factory():
if model_mode == 0: return [], []
preloadURLs = get_model_recursive_prop(model_type, "preload_URLs")
if len(preloadURLs) == 0: return [], []
- return [os.path.join("ckpts", os.path.basename(preloadURLs[0]))] , [1]
+ return [ fl.locate_file(os.path.basename(preloadURLs[0]))] , [1]
diff --git a/models/wan/any2video.py b/models/wan/any2video.py
index 01c2cd8..b2ee944 100644
--- a/models/wan/any2video.py
+++ b/models/wan/any2video.py
@@ -37,6 +37,7 @@ from shared.utils.utils import get_outpainting_frame_location, resize_lanczos, c
from .multitalk.multitalk_utils import MomentumBuffer, adaptive_projected_guidance, match_and_blend_colors, match_and_blend_colors_with_mask
from shared.utils.audio_video import save_video
from mmgp import safetensors2
+from shared.utils import files_locator as fl
def optimized_scale(positive_flat, negative_flat):
@@ -91,16 +92,15 @@ class WanAny2V:
dtype=config.t5_dtype,
device=torch.device('cpu'),
checkpoint_path=text_encoder_filename,
- tokenizer_path=os.path.join(checkpoint_dir, "umt5-xxl"),
+ tokenizer_path=fl.locate_folder("umt5-xxl"),
shard_fn= None)
# base_model_type = "i2v2_2"
if hasattr(config, "clip_checkpoint") and not base_model_type in ["i2v_2_2", "i2v_2_2_multitalk"] or base_model_type in ["animate"]:
self.clip = CLIPModel(
dtype=config.clip_dtype,
device=self.device,
- checkpoint_path=os.path.join(checkpoint_dir ,
- config.clip_checkpoint),
- tokenizer_path=os.path.join(checkpoint_dir , "xlm-roberta-large"))
+ checkpoint_path=fl.locate_file(config.clip_checkpoint),
+ tokenizer_path=fl.locate_folder("xlm-roberta-large"))
ignore_unused_weights = model_def.get("ignore_unused_weights", False)
@@ -114,9 +114,7 @@ class WanAny2V:
vae = WanVAE
self.patch_size = config.patch_size
- self.vae = vae(
- vae_pth=os.path.join(checkpoint_dir, vae_checkpoint), dtype= VAE_dtype,
- device="cpu")
+ self.vae = vae( vae_pth=fl.locate_file(vae_checkpoint), dtype= VAE_dtype, device="cpu")
self.vae.device = self.device
# config_filename= "configs/t2v_1.3B.json"
@@ -125,7 +123,7 @@ class WanAny2V:
# config = json.load(f)
# sd = safetensors2.torch_load_file(xmodel_filename)
# model_filename = "c:/temp/wan2.2i2v/low/diffusion_pytorch_model-00001-of-00006.safetensors"
- base_config_file = f"configs/{base_model_type}.json"
+ base_config_file = f"models/wan/configs/{base_model_type}.json"
forcedConfigPath = base_config_file if len(model_filename) > 1 else None
# forcedConfigPath = base_config_file = f"configs/flf2v_720p.json"
# model_filename[1] = xmodel_filename
@@ -702,7 +700,7 @@ class WanAny2V:
if True:
with init_empty_weights():
arc_resampler = Resampler( depth=4, dim=1280, dim_head=64, embedding_dim=512, ff_mult=4, heads=20, num_queries=16, output_dim=2048 if lynx_lite else 5120 )
- offload.load_model_data(arc_resampler, os.path.join("ckpts", "wan2.1_lynx_lite_arc_resampler.safetensors" if lynx_lite else "wan2.1_lynx_full_arc_resampler.safetensors"))
+ offload.load_model_data(arc_resampler, fl.locate_file("wan2.1_lynx_lite_arc_resampler.safetensors" if lynx_lite else "wan2.1_lynx_full_arc_resampler.safetensors"))
arc_resampler.to(self.device)
arcface_embed = face_arc_embeds[None,None,:].to(device=self.device, dtype=torch.float)
ip_hidden_states = arc_resampler(arcface_embed).to(self.dtype)
@@ -1125,6 +1123,6 @@ class WanAny2V:
if "#" in video_prompt_type and "1" in video_prompt_type:
preloadURLs = get_model_recursive_prop(model_type, "preload_URLs")
if len(preloadURLs) > 0:
- return [os.path.join("ckpts", os.path.basename(preloadURLs[0]))] , [1]
+ return [fl.locate_file(os.path.basename(preloadURLs[0]))] , [1]
return [], []
diff --git a/models/wan/configs/__pycache__/__init__.cpython-310.pyc b/models/wan/configs/__pycache__/__init__.cpython-310.pyc
new file mode 100644
index 0000000..5fdfaf6
Binary files /dev/null and b/models/wan/configs/__pycache__/__init__.cpython-310.pyc differ
diff --git a/models/wan/configs/__pycache__/shared_config.cpython-310.pyc b/models/wan/configs/__pycache__/shared_config.cpython-310.pyc
new file mode 100644
index 0000000..82608d3
Binary files /dev/null and b/models/wan/configs/__pycache__/shared_config.cpython-310.pyc differ
diff --git a/models/wan/configs/__pycache__/wan_i2v_14B.cpython-310.pyc b/models/wan/configs/__pycache__/wan_i2v_14B.cpython-310.pyc
new file mode 100644
index 0000000..e8b61e5
Binary files /dev/null and b/models/wan/configs/__pycache__/wan_i2v_14B.cpython-310.pyc differ
diff --git a/models/wan/configs/__pycache__/wan_t2v_14B.cpython-310.pyc b/models/wan/configs/__pycache__/wan_t2v_14B.cpython-310.pyc
new file mode 100644
index 0000000..97ace13
Binary files /dev/null and b/models/wan/configs/__pycache__/wan_t2v_14B.cpython-310.pyc differ
diff --git a/models/wan/configs/__pycache__/wan_t2v_1_3B.cpython-310.pyc b/models/wan/configs/__pycache__/wan_t2v_1_3B.cpython-310.pyc
new file mode 100644
index 0000000..afefc10
Binary files /dev/null and b/models/wan/configs/__pycache__/wan_t2v_1_3B.cpython-310.pyc differ
diff --git a/configs/animate.json b/models/wan/configs/animate.json
similarity index 100%
rename from configs/animate.json
rename to models/wan/configs/animate.json
diff --git a/configs/fantasy.json b/models/wan/configs/fantasy.json
similarity index 100%
rename from configs/fantasy.json
rename to models/wan/configs/fantasy.json
diff --git a/configs/flf2v_720p.json b/models/wan/configs/flf2v_720p.json
similarity index 100%
rename from configs/flf2v_720p.json
rename to models/wan/configs/flf2v_720p.json
diff --git a/configs/i2v.json b/models/wan/configs/i2v.json
similarity index 100%
rename from configs/i2v.json
rename to models/wan/configs/i2v.json
diff --git a/configs/i2v_2_2.json b/models/wan/configs/i2v_2_2.json
similarity index 100%
rename from configs/i2v_2_2.json
rename to models/wan/configs/i2v_2_2.json
diff --git a/configs/i2v_2_2_multitalk.json b/models/wan/configs/i2v_2_2_multitalk.json
similarity index 100%
rename from configs/i2v_2_2_multitalk.json
rename to models/wan/configs/i2v_2_2_multitalk.json
diff --git a/configs/infinitetalk.json b/models/wan/configs/infinitetalk.json
similarity index 100%
rename from configs/infinitetalk.json
rename to models/wan/configs/infinitetalk.json
diff --git a/configs/lucy_edit.json b/models/wan/configs/lucy_edit.json
similarity index 100%
rename from configs/lucy_edit.json
rename to models/wan/configs/lucy_edit.json
diff --git a/configs/lynx.json b/models/wan/configs/lynx.json
similarity index 100%
rename from configs/lynx.json
rename to models/wan/configs/lynx.json
diff --git a/models/wan/configs/lynx_lite.json b/models/wan/configs/lynx_lite.json
new file mode 100644
index 0000000..11618e7
--- /dev/null
+++ b/models/wan/configs/lynx_lite.json
@@ -0,0 +1,15 @@
+{
+ "_class_name": "WanModel",
+ "_diffusers_version": "0.30.0",
+ "dim": 5120,
+ "eps": 1e-06,
+ "ffn_dim": 13824,
+ "freq_dim": 256,
+ "in_dim": 16,
+ "model_type": "t2v",
+ "num_heads": 40,
+ "num_layers": 40,
+ "out_dim": 16,
+ "text_len": 512,
+ "lynx": "lite"
+}
diff --git a/configs/multitalk.json b/models/wan/configs/multitalk.json
similarity index 100%
rename from configs/multitalk.json
rename to models/wan/configs/multitalk.json
diff --git a/configs/phantom_1.3B.json b/models/wan/configs/phantom_1.3B.json
similarity index 100%
rename from configs/phantom_1.3B.json
rename to models/wan/configs/phantom_1.3B.json
diff --git a/configs/phantom_14B.json b/models/wan/configs/phantom_14B.json
similarity index 100%
rename from configs/phantom_14B.json
rename to models/wan/configs/phantom_14B.json
diff --git a/configs/sky_df_1.3.json b/models/wan/configs/sky_df_1.3.json
similarity index 100%
rename from configs/sky_df_1.3.json
rename to models/wan/configs/sky_df_1.3.json
diff --git a/configs/sky_df_14B.json b/models/wan/configs/sky_df_14B.json
similarity index 100%
rename from configs/sky_df_14B.json
rename to models/wan/configs/sky_df_14B.json
diff --git a/configs/standin.json b/models/wan/configs/standin.json
similarity index 100%
rename from configs/standin.json
rename to models/wan/configs/standin.json
diff --git a/configs/t2v.json b/models/wan/configs/t2v.json
similarity index 100%
rename from configs/t2v.json
rename to models/wan/configs/t2v.json
diff --git a/configs/t2v_1.3B.json b/models/wan/configs/t2v_1.3B.json
similarity index 100%
rename from configs/t2v_1.3B.json
rename to models/wan/configs/t2v_1.3B.json
diff --git a/models/wan/configs/t2v_2_2.json b/models/wan/configs/t2v_2_2.json
new file mode 100644
index 0000000..c554e73
--- /dev/null
+++ b/models/wan/configs/t2v_2_2.json
@@ -0,0 +1,14 @@
+{
+ "_class_name": "WanModel",
+ "_diffusers_version": "0.30.0",
+ "dim": 5120,
+ "eps": 1e-06,
+ "ffn_dim": 13824,
+ "freq_dim": 256,
+ "in_dim": 16,
+ "model_type": "t2v",
+ "num_heads": 40,
+ "num_layers": 40,
+ "out_dim": 16,
+ "text_len": 512
+}
diff --git a/configs/ti2v_2_2.json b/models/wan/configs/ti2v_2_2.json
similarity index 100%
rename from configs/ti2v_2_2.json
rename to models/wan/configs/ti2v_2_2.json
diff --git a/configs/vace_1.3B.json b/models/wan/configs/vace_1.3B.json
similarity index 100%
rename from configs/vace_1.3B.json
rename to models/wan/configs/vace_1.3B.json
diff --git a/configs/vace_14B.json b/models/wan/configs/vace_14B.json
similarity index 100%
rename from configs/vace_14B.json
rename to models/wan/configs/vace_14B.json
diff --git a/models/wan/configs/vace_14B_2_2.json b/models/wan/configs/vace_14B_2_2.json
new file mode 100644
index 0000000..e48a816
--- /dev/null
+++ b/models/wan/configs/vace_14B_2_2.json
@@ -0,0 +1,16 @@
+{
+ "_class_name": "VaceWanModel",
+ "_diffusers_version": "0.30.0",
+ "dim": 5120,
+ "eps": 1e-06,
+ "ffn_dim": 13824,
+ "freq_dim": 256,
+ "in_dim": 16,
+ "model_type": "t2v",
+ "num_heads": 40,
+ "num_layers": 40,
+ "out_dim": 16,
+ "text_len": 512,
+ "vace_layers": [0, 5, 10, 15, 20, 25, 30, 35],
+ "vace_in_dim": 96
+}
diff --git a/configs/vace_lynx_14B.json b/models/wan/configs/vace_lynx_14B.json
similarity index 100%
rename from configs/vace_lynx_14B.json
rename to models/wan/configs/vace_lynx_14B.json
diff --git a/configs/vace_multitalk_14B.json b/models/wan/configs/vace_multitalk_14B.json
similarity index 100%
rename from configs/vace_multitalk_14B.json
rename to models/wan/configs/vace_multitalk_14B.json
diff --git a/configs/vace_standin_14B.json b/models/wan/configs/vace_standin_14B.json
similarity index 100%
rename from configs/vace_standin_14B.json
rename to models/wan/configs/vace_standin_14B.json
diff --git a/models/wan/fantasytalking/infer.py b/models/wan/fantasytalking/infer.py
index d96bea0..a756417 100644
--- a/models/wan/fantasytalking/infer.py
+++ b/models/wan/fantasytalking/infer.py
@@ -5,6 +5,7 @@ from transformers import Wav2Vec2Model, Wav2Vec2Processor
from .model import FantasyTalkingAudioConditionModel
from .utils import get_audio_features
import gc, torch
+from shared.utils import files_locator as fl
def parse_audio(audio_path, start_frame, num_frames, fps = 23, device = "cuda"):
fantasytalking = FantasyTalkingAudioConditionModel(None, 768, 2048).to(device)
@@ -16,10 +17,10 @@ def parse_audio(audio_path, start_frame, num_frames, fps = 23, device = "cuda"):
with init_empty_weights():
proj_model = AudioProjModel( 768, 2048)
- offload.load_model_data(proj_model, "ckpts/fantasy_proj_model.safetensors")
+ offload.load_model_data(proj_model, fl.locate_file("fantasy_proj_model.safetensors"))
proj_model.to("cpu").eval().requires_grad_(False)
- wav2vec_model_dir = "ckpts/wav2vec"
+ wav2vec_model_dir = fl.locate_folder("wav2vec")
wav2vec_processor = Wav2Vec2Processor.from_pretrained(wav2vec_model_dir)
wav2vec = Wav2Vec2Model.from_pretrained(wav2vec_model_dir, device_map="cpu").eval().requires_grad_(False)
wav2vec.to(device)
diff --git a/models/wan/multitalk/multitalk.py b/models/wan/multitalk/multitalk.py
index 52d2dd9..845e39b 100644
--- a/models/wan/multitalk/multitalk.py
+++ b/models/wan/multitalk/multitalk.py
@@ -19,6 +19,7 @@ from einops import rearrange
import soundfile as sf
import re
import math
+from shared.utils import files_locator as fl
def custom_init(device, wav2vec):
audio_encoder = Wav2Vec2Model.from_pretrained(wav2vec, local_files_only=True).to(device)
@@ -215,7 +216,7 @@ def process_tts_multi(text, save_dir, voice1, voice2):
def get_full_audio_embeddings(audio_guide1 = None, audio_guide2 = None, combination_type ="add", num_frames = 0, fps = 25, sr = 16000, padded_frames_for_embeddings = 0, min_audio_duration = 0, return_sum_only = False):
- wav2vec_feature_extractor, audio_encoder= custom_init('cpu', "ckpts/chinese-wav2vec2-base")
+ wav2vec_feature_extractor, audio_encoder= custom_init('cpu', fl.locate_folder("chinese-wav2vec2-base"))
# wav2vec_feature_extractor, audio_encoder= custom_init('cpu', "ckpts/wav2vec")
pad = int(padded_frames_for_embeddings/ fps * sr)
new_human_speech1, new_human_speech2, sum_human_speechs, duration_changed = audio_prepare_multi(audio_guide1, audio_guide2, combination_type, duration= num_frames / fps, pad = pad, min_audio_duration = min_audio_duration )
diff --git a/models/wan/wan_handler.py b/models/wan/wan_handler.py
index a5d1e3d..dfc416e 100644
--- a/models/wan/wan_handler.py
+++ b/models/wan/wan_handler.py
@@ -1,6 +1,7 @@
import torch
import numpy as np
import gradio as gr
+from shared.utils import files_locator as fl
def test_class_i2v(base_model_type):
return base_model_type in ["i2v", "i2v_2_2", "fun_inp_1.3B", "fun_inp", "flf2v_720p", "fantasy", "multitalk", "infinitetalk", "i2v_2_2_multitalk", "animate" ]
@@ -22,7 +23,44 @@ def test_lynx(base_model_type):
def test_wan_5B(base_model_type):
return base_model_type in ["ti2v_2_2", "lucy_edit"]
+
class family_handler():
+ @staticmethod
+ def query_supported_types():
+ return ["multitalk", "infinitetalk", "fantasy", "vace_14B", "vace_14B_2_2", "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_14B",
+ "t2v_1.3B", "standin", "lynx_lite", "lynx", "t2v", "t2v_2_2", "vace_1.3B", "phantom_1.3B", "phantom_14B",
+ "recam_1.3B", "animate",
+ "i2v", "i2v_2_2", "i2v_2_2_multitalk", "ti2v_2_2", "lucy_edit", "flf2v_720p", "fun_inp_1.3B", "fun_inp"]
+
+
+ @staticmethod
+ def query_family_maps():
+
+ models_eqv_map = {
+ "flf2v_720p" : "i2v",
+ "t2v_1.3B" : "t2v",
+ "t2v_2_2" : "t2v",
+ "vace_standin_14B" : "vace_14B",
+ "vace_lynx_14B" : "vace_14B",
+ "vace_14B_2_2": "vace_14B",
+ }
+
+ models_comp_map = {
+ "vace_14B" : [ "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_lite_14B", "vace_lynx_14B", "vace_14B_2_2"],
+ "t2v" : [ "vace_14B", "vace_1.3B" "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_lite_14B", "vace_lynx_14B", "vace_14B_2_2", "t2v_1.3B", "phantom_1.3B","phantom_14B", "standin", "lynx_lite", "lynx"],
+ "i2v" : [ "fantasy", "multitalk", "flf2v_720p" ],
+ "i2v_2_2" : ["i2v_2_2_multitalk"],
+ "fantasy": ["multitalk"],
+ }
+ return models_eqv_map, models_comp_map
+
+ @staticmethod
+ def query_model_family():
+ return "wan"
+
+ @staticmethod
+ def query_family_infos():
+ return {"wan":(0, "Wan2.1"), "wan2_2":(1, "Wan2.2") }
@staticmethod
def set_cache_parameters(cache_type, base_model_type, model_def, inputs, skip_steps_cache):
@@ -71,10 +109,10 @@ class family_handler():
@staticmethod
def get_wan_text_encoder_filename(text_encoder_quantization):
- text_encoder_filename = "ckpts/umt5-xxl/models_t5_umt5-xxl-enc-bf16.safetensors"
+ text_encoder_filename = "umt5-xxl/models_t5_umt5-xxl-enc-bf16.safetensors"
if text_encoder_quantization =="int8":
text_encoder_filename = text_encoder_filename.replace("bf16", "quanto_int8")
- return text_encoder_filename
+ return fl.locate_file(text_encoder_filename, True)
@staticmethod
def query_model_def(base_model_type, model_def):
@@ -86,8 +124,24 @@ class family_handler():
extra_model_def["multitalk_class"] = test_multitalk(base_model_type)
extra_model_def["standin_class"] = test_standin(base_model_type)
extra_model_def["lynx_class"] = test_lynx(base_model_type)
- vace_class = base_model_type in ["vace_14B", "vace_1.3B", "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_14B"]
+ vace_class = base_model_type in ["vace_14B", "vace_14B_2_2", "vace_1.3B", "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_14B"]
extra_model_def["vace_class"] = vace_class
+ group = "wan"
+ if base_model_type in ["t2v_2_2", "i2v_2_2", "vace_14B_2_2"]:
+ profiles_dir = "wan_2_2"
+ group = "wan_2_2"
+ elif i2v:
+ profiles_dir = "wan_i2v"
+ elif test_wan_5B(base_model_type):
+ profiles_dir = "wan_2_2_5B"
+ group = "wan_2_2"
+ elif test_class_1_3B(base_model_type):
+ profiles_dir = "wan_1.3B"
+ else:
+ profiles_dir = "wan"
+
+ extra_model_def["profiles_dir"] = [profiles_dir]
+ extra_model_def["group"] = group
if base_model_type in ["animate"]:
fps = 30
@@ -108,7 +162,7 @@ class family_handler():
extra_model_def.update({
"frames_minimum" : frames_minimum,
"frames_steps" : frames_steps,
- "sliding_window" : base_model_type in ["multitalk", "infinitetalk", "t2v", "fantasy", "animate"] or test_class_i2v(base_model_type) or test_wan_5B(base_model_type) or vace_class, #"ti2v_2_2",
+ "sliding_window" : base_model_type in ["multitalk", "infinitetalk", "t2v", "t2v_2_2", "fantasy", "animate"] or test_class_i2v(base_model_type) or test_wan_5B(base_model_type) or vace_class, #"ti2v_2_2",
"multiple_submodels" : multiple_submodels,
"guidance_max_phases" : 3,
"skip_layer_guidance" : True,
@@ -127,7 +181,7 @@ class family_handler():
})
- if base_model_type in ["t2v"]:
+ if base_model_type in ["t2v", "t2v_2_2"]:
extra_model_def["guide_custom_choices"] = {
"choices":[("Use Text Prompt Only", ""),
("Video to Video guided by Text Prompt", "GUV"),
@@ -363,40 +417,6 @@ class family_handler():
return extra_model_def
- @staticmethod
- def query_supported_types():
- return ["multitalk", "infinitetalk", "fantasy", "vace_14B", "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_14B",
- "t2v_1.3B", "standin", "lynx_lite", "lynx", "t2v", "vace_1.3B", "phantom_1.3B", "phantom_14B",
- "recam_1.3B", "animate",
- "i2v", "i2v_2_2", "i2v_2_2_multitalk", "ti2v_2_2", "lucy_edit", "flf2v_720p", "fun_inp_1.3B", "fun_inp"]
-
-
- @staticmethod
- def query_family_maps():
-
- models_eqv_map = {
- "flf2v_720p" : "i2v",
- "t2v_1.3B" : "t2v",
- "vace_standin_14B" : "vace_14B",
- "vace_lynx_14B" : "vace_14B",
- }
-
- models_comp_map = {
- "vace_14B" : [ "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_lite_14B", "vace_lynx_14B"],
- "t2v" : [ "vace_14B", "vace_1.3B" "vace_multitalk_14B", "vace_standin_14B", "vace_lynx_lite_14B", "vace_lynx_14B", "t2v_1.3B", "phantom_1.3B","phantom_14B", "standin", "lynx_lite", "lynx"],
- "i2v" : [ "fantasy", "multitalk", "flf2v_720p" ],
- "i2v_2_2" : ["i2v_2_2_multitalk"],
- "fantasy": ["multitalk"],
- }
- return models_eqv_map, models_comp_map
-
- @staticmethod
- def query_model_family():
- return "wan"
-
- @staticmethod
- def query_family_infos():
- return {"wan":(0, "Wan2.1"), "wan2_2":(1, "Wan2.2") }
@staticmethod
def get_vae_block_size(base_model_type):
diff --git a/postprocessing/mmaudio/eval_utils.py b/postprocessing/mmaudio/eval_utils.py
index 11dc654..46e0670 100644
--- a/postprocessing/mmaudio/eval_utils.py
+++ b/postprocessing/mmaudio/eval_utils.py
@@ -15,6 +15,7 @@ from .model.networks import MMAudio
from .model.sequence_config import CONFIG_16K, CONFIG_44K, SequenceConfig
from .model.utils.features_utils import FeaturesUtils
from .utils.download_utils import download_model_if_needed
+from shared.utils import files_locator as fl
log = logging.getLogger()
@@ -26,7 +27,7 @@ class ModelConfig:
vae_path: Path
bigvgan_16k_path: Optional[Path]
mode: str
- synchformer_ckpt: Path = Path('ckpts/mmaudio/synchformer_state_dict.pth')
+ synchformer_ckpt: Path = Path( fl.locate_file('mmaudio/synchformer_state_dict.pth'))
@property
def seq_cfg(self) -> SequenceConfig:
@@ -64,8 +65,8 @@ large_44k = ModelConfig(model_name='large_44k',
bigvgan_16k_path=None,
mode='44k')
large_44k_v2 = ModelConfig(model_name='large_44k_v2',
- model_path=Path('ckpts/mmaudio/mmaudio_large_44k_v2.pth'),
- vae_path=Path('ckpts/mmaudio/v1-44.pth'),
+ model_path=Path( fl.locate_file('mmaudio/mmaudio_large_44k_v2.pth')),
+ vae_path=Path(fl.locate_file('mmaudio/v1-44.pth')),
bigvgan_16k_path=None,
mode='44k')
all_model_cfg: dict[str, ModelConfig] = {
diff --git a/postprocessing/mmaudio/model/utils/features_utils.py b/postprocessing/mmaudio/model/utils/features_utils.py
index 2947c30..285e4e2 100644
--- a/postprocessing/mmaudio/model/utils/features_utils.py
+++ b/postprocessing/mmaudio/model/utils/features_utils.py
@@ -12,6 +12,7 @@ from ...ext.autoencoder import AutoEncoderModule
from ...ext.mel_converter import get_mel_converter
from ...ext.synchformer.synchformer import Synchformer
from ...model.utils.distributions import DiagonalGaussianDistribution
+from shared.utils import files_locator as fl
def patch_clip(clip_model):
@@ -31,7 +32,7 @@ def patch_clip(clip_model):
return clip_model
def get_model_config(model_name):
- with open("ckpts/DFN5B-CLIP-ViT-H-14-378/open_clip_config.json", 'r', encoding='utf-8') as f:
+ with open( fl.locate_file("DFN5B-CLIP-ViT-H-14-378/open_clip_config.json"), 'r', encoding='utf-8') as f:
return json.load(f)["model_cfg"]
class FeaturesUtils(nn.Module):
@@ -51,10 +52,10 @@ class FeaturesUtils(nn.Module):
if enable_conditions:
old_get_model_config = open_clip.factory.get_model_config
open_clip.factory.get_model_config = get_model_config
- with open("ckpts/DFN5B-CLIP-ViT-H-14-378/open_clip_config.json", 'r', encoding='utf-8') as f:
+ with open( fl.locate_file("DFN5B-CLIP-ViT-H-14-378/open_clip_config.json"), 'r', encoding='utf-8') as f:
override_preprocess = json.load(f)["preprocess_cfg"]
- self.clip_model = create_model('DFN5B-CLIP-ViT-H-14-378', pretrained='ckpts/DFN5B-CLIP-ViT-H-14-378/open_clip_pytorch_model.bin', force_preprocess_cfg= override_preprocess)
+ self.clip_model = create_model('DFN5B-CLIP-ViT-H-14-378', pretrained= fl.locate_file('DFN5B-CLIP-ViT-H-14-378/open_clip_pytorch_model.bin'), force_preprocess_cfg= override_preprocess)
open_clip.factory.get_model_config = old_get_model_config
# self.clip_model = create_model_from_pretrained('hf-hub:apple/DFN5B-CLIP-ViT-H-14-384', return_transform=False)
diff --git a/preprocessing/face_preprocessor.py b/preprocessing/face_preprocessor.py
index bdef48b..8c86a78 100644
--- a/preprocessing/face_preprocessor.py
+++ b/preprocessing/face_preprocessor.py
@@ -10,6 +10,7 @@ import PIL.ImageOps
from torchvision.transforms.functional import normalize
from typing import Union, Optional
from models.hyvideo.data_kits.face_align import AlignImage
+from shared.utils import files_locator as fl
def _img2tensor(img: np.ndarray, bgr2rgb: bool = True) -> torch.Tensor:
@@ -53,7 +54,7 @@ def _pad_to_square(img: np.ndarray, pad_color: int = 255) -> np.ndarray:
class FaceProcessor:
def __init__(self):
- self.align_instance = AlignImage("cuda", det_path="ckpts/det_align/detface.pt")
+ self.align_instance = AlignImage("cuda", det_path= fl.locate_file("det_align/detface.pt"))
self.align_instance.facedet.model.to("cpu")
diff --git a/preprocessing/matanyone/app.py b/preprocessing/matanyone/app.py
index a5d5570..443934c 100644
--- a/preprocessing/matanyone/app.py
+++ b/preprocessing/matanyone/app.py
@@ -22,6 +22,7 @@ from .matanyone.inference.inference_core import InferenceCore
from .matanyone_wrapper import matanyone
from shared.utils.audio_video import save_video, save_image
from mmgp import offload
+from shared.utils import files_locator as fl
arg_device = "cuda"
arg_sam_model_type="vit_h"
@@ -698,7 +699,7 @@ def load_unload_models(selected):
model_in_GPU = True
from .matanyone.model.matanyone import MatAnyone
# matanyone_model = MatAnyone.from_pretrained("PeiqingYang/MatAnyone")
- matanyone_model = MatAnyone.from_pretrained("ckpts/mask")
+ matanyone_model = MatAnyone.from_pretrained(fl.locate_folder("mask"))
# pipe ={"mat" : matanyone_model, "sam" :model.samcontroler.sam_controler.model }
# offload.profile(pipe)
matanyone_model = matanyone_model.to("cpu").eval()
diff --git a/preprocessing/matanyone/tools/base_segmenter.py b/preprocessing/matanyone/tools/base_segmenter.py
index 096038e..64f702d 100644
--- a/preprocessing/matanyone/tools/base_segmenter.py
+++ b/preprocessing/matanyone/tools/base_segmenter.py
@@ -8,6 +8,7 @@ from segment_anything import sam_model_registry, SamPredictor, SamAutomaticMaskG
import matplotlib.pyplot as plt
import PIL
from .mask_painter import mask_painter
+from shared.utils import files_locator as fl
class BaseSegmenter:
@@ -32,7 +33,7 @@ class BaseSegmenter:
# self.model.to(torch.float16)
# offload.save_model(self.model, "ckpts/mask/sam_vit_h_4b8939_fp16.safetensors")
- offload.load_model_data(self.model, "ckpts/mask/sam_vit_h_4b8939_fp16.safetensors")
+ offload.load_model_data(self.model, fl.locate_file("mask/sam_vit_h_4b8939_fp16.safetensors"))
self.model.to(torch.float32) # need to be optimized, if not f32 crappy precision
self.model.to(device=self.device)
self.predictor = SamPredictor(self.model)
diff --git a/wgp.py b/wgp.py
index 49d91d7..ff0a51d 100644
--- a/wgp.py
+++ b/wgp.py
@@ -29,7 +29,8 @@ from shared.utils.audio_video import extract_audio_tracks, combine_video_with_au
from shared.utils.audio_video import save_image_metadata, read_image_metadata
from shared.match_archi import match_nvidia_architecture
from shared.attention import get_attention_modes, get_supported_attention_modes
-from huggingface_hub import hf_hub_download, snapshot_download
+from huggingface_hub import hf_hub_download, snapshot_download
+from shared.utils import files_locator as fl
import torch
import gc
import traceback
@@ -63,7 +64,7 @@ AUTOSAVE_FILENAME = "queue.zip"
PROMPT_VARS_MAX = 10
target_mmgp_version = "3.6.2"
-WanGP_version = "8.993"
+WanGP_version = "8.994"
settings_version = 2.39
max_source_video_frames = 3000
prompt_enhancer_image_caption_model, prompt_enhancer_image_caption_processor, prompt_enhancer_llm_model, prompt_enhancer_llm_tokenizer = None, None, None, None
@@ -563,7 +564,7 @@ def process_prompt_and_add_tasks(state, model_choice):
if test_any_sliding_window(model_type) and image_mode == 0:
if video_length > sliding_window_size:
- if model_type in ["t2v"] and not "G" in video_prompt_type :
+ if model_type in ["t2v", "t2v_2_2"] and not "G" in video_prompt_type :
gr.Info(f"You have requested to Generate Sliding Windows with a Text to Video model. Unless you use the Video to Video feature this is useless as a t2v model doesn't see past frames and it will generate the same video in each new window.")
return ret()
full_video_length = video_length if video_source is None else video_length + sliding_window_overlap -1
@@ -1793,16 +1794,17 @@ if os.path.isfile("t2v_settings.json"):
if not os.path.isfile(server_config_filename) and os.path.isfile("gradio_config.json"):
shutil.move("gradio_config.json", server_config_filename)
-if not os.path.isdir("ckpts/umt5-xxl/"):
- os.makedirs("ckpts/umt5-xxl/")
-src_move = [ "ckpts/models_clip_open-clip-xlm-roberta-large-vit-huge-14-bf16.safetensors", "ckpts/models_t5_umt5-xxl-enc-bf16.safetensors", "ckpts/models_t5_umt5-xxl-enc-quanto_int8.safetensors" ]
-tgt_move = [ "ckpts/xlm-roberta-large/", "ckpts/umt5-xxl/", "ckpts/umt5-xxl/"]
+src_move = [ "models_clip_open-clip-xlm-roberta-large-vit-huge-14-bf16.safetensors", "models_t5_umt5-xxl-enc-bf16.safetensors", "models_t5_umt5-xxl-enc-quanto_int8.safetensors" ]
+tgt_move = [ "xlm-roberta-large", "umt5-xxl", "umt5-xxl"]
for src,tgt in zip(src_move,tgt_move):
- if os.path.isfile(src):
+ src = fl.locate_file(src)
+ tgt = fl.get_download_location(tgt)
+ if src is not None:
try:
if os.path.isfile(tgt):
shutil.remove(src)
else:
+ os.makedirs(os.path.dirname(tgt))
shutil.move(src, tgt)
except:
pass
@@ -1823,7 +1825,8 @@ if not Path(server_config_filename).is_file():
"vae_config": 0,
"profile" : profile_type.LowRAM_LowVRAM,
"preload_model_policy": [],
- "UI_theme": "default"
+ "UI_theme": "default",
+ "checkpoints_paths": fl.default_checkpoints_paths,
}
with open(server_config_filename, "w", encoding="utf-8") as writer:
@@ -1833,6 +1836,10 @@ else:
text = reader.read()
server_config = json.loads(text)
+checkpoints_paths = server_config.get("checkpoints_paths", None)
+if checkpoints_paths is None: checkpoints_paths = server_config["checkpoints_paths"] = fl.default_checkpoints_paths
+fl.set_checkpoints_paths(checkpoints_paths)
+
# Deprecated models
for path in ["wan2.1_Vace_1.3B_preview_bf16.safetensors", "sky_reels2_diffusion_forcing_1.3B_bf16.safetensors","sky_reels2_diffusion_forcing_720p_14B_bf16.safetensors",
"sky_reels2_diffusion_forcing_720p_14B_quanto_int8.safetensors", "sky_reels2_diffusion_forcing_720p_14B_quanto_fp16_int8.safetensors", "wan2.1_image2video_480p_14B_bf16.safetensors", "wan2.1_image2video_480p_14B_quanto_int8.safetensors",
@@ -1841,11 +1848,11 @@ for path in ["wan2.1_Vace_1.3B_preview_bf16.safetensors", "sky_reels2_diffusion
"wan2.1_Vace_14B_mbf16.safetensors", "wan2.1_Vace_14B_quanto_mbf16_int8.safetensors", "wan2.1_FLF2V_720p_14B_quanto_int8.safetensors", "wan2.1_FLF2V_720p_14B_bf16.safetensors", "wan2.1_FLF2V_720p_14B_fp16.safetensors", "wan2.1_Vace_1.3B_mbf16.safetensors", "wan2.1_text2video_1.3B_bf16.safetensors",
"ltxv_0.9.7_13B_dev_bf16.safetensors"
]:
- if Path(os.path.join("ckpts" , path)).is_file():
+ if fl.locate_file(path) is not None:
print(f"Removing old version of model '{path}'. A new version of this model will be downloaded next time you use it.")
- os.remove( os.path.join("ckpts" , path))
+ os.remove( fl.locate_file(path))
-for f, s in [("ckpts/Florence2/modeling_florence2.py", 127287)]:
+for f, s in [(fl.locate_file("Florence2/modeling_florence2.py"), 127287)]:
try:
if os.path.isfile(f) and os.path.getsize(f) == s:
print(f"Removing old version of model '{f}'. A new version of this model will be downloaded next time you use it.")
@@ -2050,7 +2057,6 @@ def get_model_filename(model_type, quantization ="int8", dtype_policy = "", modu
if len(stack) > 10: raise Exception(f"Circular Reference in Model {key_name} dependencies: {stack}")
return get_model_filename(URLs, quantization=quantization, dtype_policy=dtype_policy, submodel_no = submodel_no, stack = stack + [URLs])
- # choices = [ ("ckpts/" + os.path.basename(path) if path.startswith("http") else path) for path in URLs ]
choices = URLs
if len(quantization) == 0:
quantization = "bf16"
@@ -2259,7 +2265,7 @@ def init_model_def(model_type, model_def):
base_model_type = get_base_model_type(model_type)
family_handler = model_types_handlers.get(base_model_type, None)
if family_handler is None:
- raise Exception(f"Unknown model type {model_type}")
+ raise Exception(f"Unknown model type {base_model_type}")
default_model_def = family_handler.query_model_def(base_model_type, model_def)
if default_model_def is None: return model_def
default_model_def.update(model_def)
@@ -2418,13 +2424,13 @@ def save_model(model, model_type, dtype, config_file, submodel_no = 1, is_mod
saved_finetune_def = json.load(reader)
update_model_def = False
- model_filename = os.path.join("ckpts",model_filename)
+ model_filename_path = os.path.join(fl.get_download_folder(), model_filename)
quanto_dtypestr= "bf16" if dtype == torch.bfloat16 else "fp16"
if ("m" + dtypestr) in model_filename:
dtypestr = "m" + dtypestr
quanto_dtypestr = "m" + quanto_dtypestr
- if not os.path.isfile(model_filename) and (not no_fp16_main_model or dtype == torch.bfloat16):
- offload.save_model(model, model_filename, config_file_path=config_file, filter_sd=filter)
+ if fl.locate_file(model_filename) is None and (not no_fp16_main_model or dtype == torch.bfloat16):
+ offload.save_model(model, model_filename_path, config_file_path=config_file, filter_sd=filter)
print(f"New model file '{model_filename}' had been created for finetune Id '{model_type}'.")
del saved_finetune_def["model"][source_key]
del model_def[source_key]
@@ -2433,10 +2439,11 @@ def save_model(model, model_type, dtype, config_file, submodel_no = 1, is_mod
if is_module:
quanto_filename = model_filename.replace(dtypestr, "quanto_" + quanto_dtypestr + "_int8" )
+ quanto_filename_path = os.path.join(fl.get_download_folder() , quanto_filename)
if hasattr(model, "_quanto_map"):
print("unable to generate quantized module, the main model should at full 16 bits before quantization can be done")
- elif not os.path.isfile(quanto_filename):
- offload.save_model(model, quanto_filename, config_file_path=config_file, do_quantize= True, filter_sd=filter)
+ elif fl.locate_file(quanto_filename) is None:
+ offload.save_model(model, quanto_filename_path, config_file_path=config_file, do_quantize= True, filter_sd=filter)
print(f"New quantized file '{quanto_filename}' had been created for finetune Id '{model_type}'.")
if isinstance(model_def[url_key][0],dict):
model_def[url_key][0][url_dict_key].append(quanto_filename)
@@ -2473,10 +2480,11 @@ def save_quantized_model(model, model_type, model_filename, dtype, config_file,
pos = model_filename.rfind(".")
model_filename = model_filename[:pos] + "_quanto_int8" + model_filename[pos+1:]
- if os.path.isfile(model_filename):
+ if fl.locate_file(model_filename) is not None:
print(f"There isn't any model to quantize as quantized model '{model_filename}' aready exists")
else:
- offload.save_model(model, model_filename, do_quantize= True, config_file_path=config_file)
+ model_filename_path = os.path.join(fl.get_download_folder(), model_filename)
+ offload.save_model(model, model_filename_path, do_quantize= True, config_file_path=config_file)
print(f"New quantized file '{model_filename}' had been created for finetune Id '{model_type}'.")
if not model_filename in URLs:
URLs.append(model_filename)
@@ -2500,26 +2508,27 @@ def get_loras_preprocessor(transformer, model_type):
def get_local_model_filename(model_filename):
if model_filename.startswith("http"):
- local_model_filename = os.path.join("ckpts", os.path.basename(model_filename))
+ local_model_filename =os.path.basename(model_filename)
else:
local_model_filename = model_filename
+ local_model_filename = fl.locate_file(local_model_filename)
return local_model_filename
def process_files_def(repoId, sourceFolderList, fileList):
- targetRoot = "ckpts/"
+ targetRoot = fl.get_download_location()
for sourceFolder, files in zip(sourceFolderList,fileList ):
if len(files)==0:
- if not Path(targetRoot + sourceFolder).exists():
+ if fl.locate_folder(sourceFolder) is None:
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 ):
+ if fl.locate_file(sourceFolder + "/" + onefile) is None:
hf_hub_download(repo_id=repoId, filename=onefile, local_dir = targetRoot, subfolder=sourceFolder)
else:
- if not os.path.isfile(targetRoot + onefile ):
+ if fl.locate_file(onefile) is None:
hf_hub_download(repo_id=repoId, filename=onefile, local_dir = targetRoot)
def download_mmaudio():
@@ -2541,15 +2550,18 @@ def download_file(url,filename):
onefile = os.path.basename(url_parts[-1])
sourceFolder = os.path.dirname(url_parts[-1])
if len(sourceFolder) == 0:
- hf_hub_download(repo_id=repoId, filename=onefile, local_dir = "ckpts/" if len(base_dir)==0 else base_dir)
+ hf_hub_download(repo_id=repoId, filename=onefile, local_dir = fl.get_download_location() if len(base_dir)==0 else base_dir)
else:
- target_path = "ckpts/temp/" + sourceFolder
+ temp_dir_path = os.path.join(fl.get_download_location(), "temp")
+ target_path = os.path.join(temp_dir_path, sourceFolder)
if not os.path.exists(target_path):
os.makedirs(target_path)
- hf_hub_download(repo_id=repoId, filename=onefile, local_dir = "ckpts/temp/", subfolder=sourceFolder)
- shutil.move(os.path.join( "ckpts", "temp" , sourceFolder , onefile), "ckpts/" if len(base_dir)==0 else base_dir)
- shutil.rmtree("ckpts/temp")
+ hf_hub_download(repo_id=repoId, filename=onefile, local_dir = temp_dir_path, subfolder=sourceFolder)
+ shutil.move(os.path.join( target_path, onefile), fl.get_download_location() if len(base_dir)==0 else base_dir)
+ shutil.rmtree(temp_dir_path)
else:
+ from urllib.request import urlretrieve
+ from shared.utils.download import create_progress_hook
urlretrieve(url,filename, create_progress_hook(filename))
download_shared_done = False
@@ -2563,8 +2575,6 @@ def download_models(model_filename = None, model_type= None, module_type = False
- from urllib.request import urlretrieve
- from shared.utils.download import create_progress_hook
shared_def = {
"repoId" : "DeepBeepMeep/Wan2.1",
@@ -2607,12 +2617,13 @@ def download_models(model_filename = None, model_type= None, module_type = False
any_source = ("source2" if submodel_no ==2 else "source") in model_def
any_module_source = ("module_source2" if submodel_no ==2 else "module_source") in model_def
model_type_handler = model_types_handlers[base_model_type]
- local_model_filename = get_local_model_filename(model_filename)
-
+
if any_source and not module_type or any_module_source and module_type:
model_filename = None
else:
- if not os.path.isfile(local_model_filename):
+ local_model_filename = get_local_model_filename(model_filename)
+ if local_model_filename is None:
+ local_model_filename = fl.get_download_location(os.path.basename(model_filename))
url = model_filename
if not url.startswith("http"):
@@ -2621,13 +2632,13 @@ def download_models(model_filename = None, model_type= None, module_type = False
download_file(url, local_model_filename)
except Exception as e:
if os.path.isfile(local_model_filename): os.remove(local_model_filename)
- raise Exception(f"'{url}' is invalid for Model '{local_model_filename}' : {str(e)}'")
+ raise Exception(f"'{url}' is invalid for Model '{model_type}' : {str(e)}'")
if module_type: return
model_filename = None
preload_URLs = get_model_recursive_prop(model_type, "preload_URLs", return_list= True)
for url in preload_URLs:
- filename = "ckpts/" + url.split("/")[-1]
+ filename = fl.get_download_location(url.split("/")[-1])
if not os.path.isfile(filename ):
if not url.startswith("http"):
raise Exception(f"File '{filename}' to preload was not found locally and no URL was provided to download it. Please add an URL in the model definition file.")
@@ -2809,8 +2820,8 @@ def setup_prompt_enhancer(pipe, kwargs):
model_no = server_config.get("enhancer_enabled", 0)
if model_no != 0:
from transformers import ( AutoModelForCausalLM, AutoProcessor, AutoTokenizer, LlamaForCausalLM )
- prompt_enhancer_image_caption_model = AutoModelForCausalLM.from_pretrained( "ckpts/Florence2", trust_remote_code=True)
- prompt_enhancer_image_caption_processor = AutoProcessor.from_pretrained( "ckpts/Florence2", trust_remote_code=True)
+ prompt_enhancer_image_caption_model = AutoModelForCausalLM.from_pretrained(fl.locate_folder("Florence2"), trust_remote_code=True)
+ prompt_enhancer_image_caption_processor = AutoProcessor.from_pretrained(fl.locate_folder("Florence2"), trust_remote_code=True)
pipe["prompt_enhancer_image_caption_model"] = prompt_enhancer_image_caption_model
prompt_enhancer_image_caption_model._model_dtype = torch.float
# def preprocess_sd(sd, map):
@@ -2825,12 +2836,12 @@ def setup_prompt_enhancer(pipe, kwargs):
if model_no == 1:
budget = 5000
- prompt_enhancer_llm_model = offload.fast_load_transformers_model("ckpts/Llama3_2/Llama3_2_quanto_bf16_int8.safetensors")
- prompt_enhancer_llm_tokenizer = AutoTokenizer.from_pretrained("ckpts/Llama3_2")
+ prompt_enhancer_llm_model = offload.fast_load_transformers_model( fl.locate_file("Llama3_2/Llama3_2_quanto_bf16_int8.safetensors"))
+ prompt_enhancer_llm_tokenizer = AutoTokenizer.from_pretrained(fl.locate_folder("Llama3_2"))
else:
budget = 10000
- prompt_enhancer_llm_model = offload.fast_load_transformers_model("ckpts/llama-joycaption-beta-one-hf-llava/llama_joycaption_quanto_bf16_int8.safetensors")
- prompt_enhancer_llm_tokenizer = AutoTokenizer.from_pretrained("ckpts/llama-joycaption-beta-one-hf-llava")
+ prompt_enhancer_llm_model = offload.fast_load_transformers_model(fl.locate_file("llama-joycaption-beta-one-hf-llava/llama_joycaption_quanto_bf16_int8.safetensors"))
+ prompt_enhancer_llm_tokenizer = AutoTokenizer.from_pretrained(fl.locate_folder("llama-joycaption-beta-one-hf-llava"))
pipe["prompt_enhancer_llm_model"] = prompt_enhancer_llm_model
if not "budgets" in kwargs: kwargs["budgets"] = {}
kwargs["budgets"]["prompt_enhancer_llm_model"] = budget
@@ -2875,7 +2886,7 @@ def load_models(model_type, override_profile = -1):
if model_filename2 != None:
model_file_list += [model_filename2]
model_type_list += [model_type]
- module_type_list += [False]
+ module_type_list += [None]
model_submodel_no_list += [2]
for module_type in modules:
if isinstance(module_type,dict):
@@ -3012,7 +3023,11 @@ def apply_changes( state,
image_output_codec_choice = None,
audio_output_codec_choice = None,
last_resolution_choice = None,
+ checkpoints_paths = "",
):
+ checkpoints_paths = fl.default_checkpoints_paths if len(checkpoints_paths.strip()) == "" else checkpoints_paths.replace("\r", "").split("\n")
+ checkpoints_paths = [path.strip() for path in checkpoints_paths if len(path.strip()) > 0 ]
+ fl.set_checkpoints_paths(checkpoints_paths)
if args.lock_config:
return "<DIV ALIGN=CENTER>Config Locked</DIV>",*[gr.update()]*4
if gen_in_progress:
@@ -3054,6 +3069,7 @@ def apply_changes( state,
"last_advanced_choice": state["advanced"],
"last_resolution_choice": last_resolution_choice,
"last_resolution_per_group": state["last_resolution_per_group"],
+ "checkpoints_paths": checkpoints_paths,
}
if Path(server_config_filename).is_file():
@@ -3087,14 +3103,14 @@ def apply_changes( state,
transformer_quantization = server_config["transformer_quantization"]
transformer_dtype_policy = server_config["transformer_dtype_policy"]
text_encoder_quantization = server_config["text_encoder_quantization"]
- transformer_types = server_config["transformer_types"]
+ transformer_types = server_config["transformer_types"]
model_filename = get_model_filename(transformer_type, transformer_quantization, transformer_dtype_policy)
state["model_filename"] = model_filename
if "enhancer_enabled" in changes or "enhancer_mode" in changes:
reset_prompt_enhancer()
if all(change in ["attention_mode", "vae_config", "boost", "save_path", "metadata_type", "clear_file_list", "fit_canvas", "depth_anything_v2_variant",
"notification_sound_enabled", "notification_sound_volume", "mmaudio_enabled", "max_frames_multiplier", "display_stats",
- "video_output_codec", "image_output_codec", "audio_output_codec"] for change in changes ):
+ "video_output_codec", "image_output_codec", "audio_output_codec", "checkpoints_paths"] for change in changes ):
model_family = gr.Dropdown()
model_choice = gr.Dropdown()
else:
@@ -3649,28 +3665,23 @@ def get_preprocessor(process_type, inpaint_color):
if process_type=="pose":
from preprocessing.dwpose.pose import PoseBodyFaceVideoAnnotator
cfg_dict = {
- "DETECTION_MODEL": "ckpts/pose/yolox_l.onnx",
- "POSE_MODEL": "ckpts/pose/dw-ll_ucoco_384.onnx",
+ "DETECTION_MODEL": fl.locate_file("pose/yolox_l.onnx"),
+ "POSE_MODEL": fl.locate_file("pose/dw-ll_ucoco_384.onnx"),
"RESIZE_SIZE": 1024
}
anno_ins = lambda img: PoseBodyFaceVideoAnnotator(cfg_dict).forward(img)
elif process_type=="depth":
- # from preprocessing.midas.depth import DepthVideoAnnotator
- # cfg_dict = {
- # "PRETRAINED_MODEL": "ckpts/depth/dpt_hybrid-midas-501f0c75.pt"
- # }
- # anno_ins = lambda img: DepthVideoAnnotator(cfg_dict).forward(img)[0]
from preprocessing.depth_anything_v2.depth import DepthV2VideoAnnotator
if server_config.get("depth_anything_v2_variant", "vitl") == "vitl":
cfg_dict = {
- "PRETRAINED_MODEL": "ckpts/depth/depth_anything_v2_vitl.pth",
+ "PRETRAINED_MODEL": fl.locate_file("depth/depth_anything_v2_vitl.pth"),
'MODEL_VARIANT': 'vitl'
}
else:
cfg_dict = {
- "PRETRAINED_MODEL": "ckpts/depth/depth_anything_v2_vitb.pth",
+ "PRETRAINED_MODEL": fl.locate_file("depth/depth_anything_v2_vitb.pth"),
'MODEL_VARIANT': 'vitb',
}
@@ -3682,19 +3693,19 @@ def get_preprocessor(process_type, inpaint_color):
elif process_type=="canny":
from preprocessing.canny import CannyVideoAnnotator
cfg_dict = {
- "PRETRAINED_MODEL": "ckpts/scribble/netG_A_latest.pth"
+ "PRETRAINED_MODEL": fl.locate_file("scribble/netG_A_latest.pth")
}
anno_ins = lambda img: CannyVideoAnnotator(cfg_dict).forward(img)
elif process_type=="scribble":
from preprocessing.scribble import ScribbleVideoAnnotator
cfg_dict = {
- "PRETRAINED_MODEL": "ckpts/scribble/netG_A_latest.pth"
+ "PRETRAINED_MODEL": fl.locate_file("scribble/netG_A_latest.pth")
}
anno_ins = lambda img: ScribbleVideoAnnotator(cfg_dict).forward(img)
elif process_type=="flow":
from preprocessing.flow import FlowVisAnnotator
cfg_dict = {
- "PRETRAINED_MODEL": "ckpts/flow/raft-things.pth"
+ "PRETRAINED_MODEL": fl.locate_file("flow/raft-things.pth")
}
anno_ins = lambda img: FlowVisAnnotator(cfg_dict).forward(img)
elif process_type=="inpaint":
@@ -4092,10 +4103,10 @@ def perform_temporal_upsampling(sample, previous_last_frame, temporal_upsampling
if previous_last_frame != None:
sample = torch.cat([previous_last_frame, sample], dim=1)
previous_last_frame = sample[:, -1:].clone()
- sample = temporal_interpolation( os.path.join("ckpts", "flownet.pkl"), sample, exp, device=processing_device)
+ sample = temporal_interpolation( fl.locate_file("flownet.pkl"), sample, exp, device=processing_device)
sample = sample[:, 1:]
else:
- sample = temporal_interpolation( os.path.join("ckpts", "flownet.pkl"), sample, exp, device=processing_device)
+ sample = temporal_interpolation( fl.locate_file("flownet.pkl"), sample, exp, device=processing_device)
previous_last_frame = sample[:, -1:].clone()
output_fps = output_fps * 2**exp
@@ -5838,13 +5849,12 @@ def get_new_preset_msg(advanced = True):
return "Choose a Lora Preset or a Settings file in this List"
def compute_lset_choices(model_type, loras_presets):
- # top_dir = "settings"
global_list = []
if model_type is not None:
- top_dir = get_lora_dir(model_type)
+ top_dir = "profiles" # get_lora_dir(model_type)
model_def = get_model_def(model_type)
settings_dir = get_model_recursive_prop(model_type, "profiles_dir", return_list=False)
- if settings_dir is None or len(settings_dir) == 0: settings_dir = ["profiles_" + get_model_family(model_type, True)]
+ if settings_dir is None or len(settings_dir) == 0: settings_dir = [""]
for dir in settings_dir:
if len(dir) == "": continue
cur_path = os.path.join(top_dir, dir)
@@ -6081,8 +6091,7 @@ def apply_lset(state, wizard_prompt_activated, lset_name, loras_choices, loras_m
return wizard_prompt_activated, loras_choices, loras_mult_choices, prompt, get_unique_id(), gr.update(), gr.update(), gr.update()
else:
- # lset_path = os.path.join("settings", lset_name) if len(Path(lset_name).parts)>1 else os.path.join(get_lora_dir(current_model_type), lset_name)
- lset_path = os.path.join(get_lora_dir(current_model_type), lset_name)
+ lset_path = os.path.join("profiles" if len(Path(lset_name).parts)>1 else get_lora_dir(current_model_type), lset_name)
configs, _ = get_settings_from_file(state,lset_path , True, True, True, min_settings_version=2.38, merge_loras = "merge after" if len(Path(lset_name).parts)<=1 else "merge before" )
if configs == None:
@@ -6275,7 +6284,7 @@ def prepare_inputs_dict(target, inputs, model_type = None, model_filename = None
inputs["base_model_type"] = base_model_type
diffusion_forcing = base_model_type in ["sky_df_1.3B", "sky_df_14B"]
vace = test_vace_module(base_model_type)
- t2v= base_model_type in ["t2v"]
+ t2v= base_model_type in ["t2v", "t2v_2_2"]
ltxv = base_model_type in ["ltxv_13B"]
recammaster = base_model_type in ["recam_1.3B"]
phantom = base_model_type in ["phantom_1.3B", "phantom_14B"]
@@ -6309,10 +6318,8 @@ def prepare_inputs_dict(target, inputs, model_type = None, model_filename = None
if model_def.get("model_modes", None) is None:
pop += ["model_mode"]
- if not vace and not phantom and not hunyuan_video_custom:
- unsaved_params = ["keep_frames_video_guide", "mask_expand"] #"video_prompt_type",
- if base_model_type in ["t2v"]: unsaved_params = unsaved_params[1:]
- pop += unsaved_params
+ if model_def.get("guide_custom_choices", None ) is None and model_def.get("guide_preprocessing", None ) is None:
+ pop += ["keep_frames_video_guide", "mask_expand"]
if not "I" in video_prompt_type:
pop += ["remove_background_images_ref"]
@@ -7545,7 +7552,6 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non
if len(launch_loras) == 0:
launch_multis_str = ui_defaults.get("loras_multipliers","")
launch_loras = [os.path.basename(path) for path in ui_defaults.get("activated_loras",[])]
-
with gr.Row():
with gr.Column():
with gr.Column(visible=False, elem_id="image-modal-container") as modal_container:
@@ -7584,7 +7590,7 @@ def generate_video_tab(update_form = False, state_dict = None, ui_defaults = Non
cancel_lset_btn = gr.Button("Don't do it !", size="sm", min_width= 1 , visible=False)
#confirm_save_lset_btn, confirm_delete_lset_btn, save_lset_btn, delete_lset_btn, cancel_lset_btn
trigger_refresh_input_type = gr.Text(interactive= False, visible= False)
- t2v = base_model_type in ["t2v"]
+ t2v = base_model_type in ["t2v", "t2v_2_2"]
t2v_1_3B = base_model_type in ["t2v_1.3B"]
flf2v = base_model_type == "flf2v_720p"
base_model_family = get_model_family(base_model_type)
@@ -9017,6 +9023,8 @@ def generate_configuration_tab(state, blocks, header, model_family, model_choice
value=server_config.get("max_frames_multiplier", 1),
label="Increase the Max Number of Frames (needs more RAM and VRAM, usually the longer the worse the quality, needs an App restart)"
)
+ checkpoints_paths_text = "\n".join(server_config.get("checkpoints_paths", fl.default_checkpoints_paths))
+ checkpoints_paths = gr.Text(label ="Folders where Model Checkpoints are Stored. One Path per Line. First Path is Default Download Path.", value=checkpoints_paths_text,lines=3)
UI_theme_choice = gr.Dropdown(
choices=[
@@ -9263,6 +9271,7 @@ def generate_configuration_tab(state, blocks, header, model_family, model_choice
image_output_codec_choice,
audio_output_codec_choice,
resolution,
+ checkpoints_paths,
],
outputs= [msg , header, model_family, model_choice, refresh_form_trigger]
)