Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -61,33 +61,42 @@ pipe = WanImageToVideoPipeline.from_pretrained(MODEL_ID,
|
|
| 61 |
).to('cuda')
|
| 62 |
|
| 63 |
pipe.load_lora_weights(
|
| 64 |
-
"
|
| 65 |
-
weight_name="
|
| 66 |
-
adapter_name="
|
| 67 |
)
|
|
|
|
|
|
|
|
|
|
| 68 |
pipe.load_lora_weights(
|
| 69 |
-
"
|
| 70 |
-
weight_name="
|
| 71 |
-
adapter_name="
|
| 72 |
)
|
| 73 |
|
|
|
|
|
|
|
|
|
|
| 74 |
pipe.load_lora_weights(
|
| 75 |
-
"
|
| 76 |
-
weight_name="
|
| 77 |
-
adapter_name="
|
| 78 |
-
load_into_transformer_2=True
|
| 79 |
)
|
|
|
|
|
|
|
|
|
|
| 80 |
pipe.load_lora_weights(
|
| 81 |
-
"
|
| 82 |
-
weight_name="
|
| 83 |
-
adapter_name="
|
| 84 |
-
load_into_transformer_2=True
|
| 85 |
)
|
| 86 |
|
| 87 |
|
| 88 |
-
pipe.set_adapters([
|
| 89 |
-
pipe.fuse_lora(adapter_names=["
|
| 90 |
-
pipe.fuse_lora(adapter_names=["
|
|
|
|
|
|
|
| 91 |
pipe.unload_lora_weights()
|
| 92 |
|
| 93 |
quantize_(pipe.text_encoder, Int8WeightOnlyConfig())
|
|
|
|
| 61 |
).to('cuda')
|
| 62 |
|
| 63 |
pipe.load_lora_weights(
|
| 64 |
+
"Kijai/WanVideo_comfy",
|
| 65 |
+
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 66 |
+
adapter_name="lightx2v"
|
| 67 |
)
|
| 68 |
+
|
| 69 |
+
kwargs_lora_h = {}
|
| 70 |
+
kwargs_lora_h["load_into_transformer"] = True
|
| 71 |
pipe.load_lora_weights(
|
| 72 |
+
"GiorgioV/LoRA_for_WAN_22",
|
| 73 |
+
weight_name="I2V_14B_HIGH.safetensors",
|
| 74 |
+
adapter_name="lora_h", **kwargs_lora_h
|
| 75 |
)
|
| 76 |
|
| 77 |
+
|
| 78 |
+
kwargs_lora = {}
|
| 79 |
+
kwargs_lora["load_into_transformer_2"] = True
|
| 80 |
pipe.load_lora_weights(
|
| 81 |
+
"Kijai/WanVideo_comfy",
|
| 82 |
+
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 83 |
+
adapter_name="lightx2v_2", **kwargs_lora
|
|
|
|
| 84 |
)
|
| 85 |
+
|
| 86 |
+
kwargs_lora_l = {}
|
| 87 |
+
kwargs_lora_l["load_into_transformer_2"] = True
|
| 88 |
pipe.load_lora_weights(
|
| 89 |
+
"GiorgioV/LoRA_for_WAN_22",
|
| 90 |
+
weight_name="I2V_14B_LOW.safetensors",
|
| 91 |
+
adapter_name="lora_l", **kwargs_lora_l
|
|
|
|
| 92 |
)
|
| 93 |
|
| 94 |
|
| 95 |
+
pipe.set_adapters(["lightx2v", "lora_h", "lora_gh", "lightx2v_2", "lora_l", "lora_gl"], adapter_weights=[1., 1., 1., 1., 1., 1.])
|
| 96 |
+
pipe.fuse_lora(adapter_names=["lightx2v"], lora_scale=3., components=["transformer"])
|
| 97 |
+
pipe.fuse_lora(adapter_names=["lora_h"], lora_scale=0.4, components=["transformer"])
|
| 98 |
+
pipe.fuse_lora(adapter_names=["lightx2v_2"], lora_scale=1., components=["transformer_2"])
|
| 99 |
+
pipe.fuse_lora(adapter_names=["lora_l"], lora_scale=1., components=["transformer_2"])
|
| 100 |
pipe.unload_lora_weights()
|
| 101 |
|
| 102 |
quantize_(pipe.text_encoder, Int8WeightOnlyConfig())
|