Spaces:
Running
on
Zero
Running
on
Zero
Update optimization.py
Browse files- optimization.py +1 -9
optimization.py
CHANGED
|
@@ -79,16 +79,8 @@ def optimize_pipeline_(pipeline: Callable[P, Any], *args: P.args, **kwargs: P.kw
|
|
| 79 |
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 80 |
adapter_name="lightx2v_2", **kwargs_lora
|
| 81 |
)
|
| 82 |
-
|
| 83 |
-
kwargs_lora_gh["load_into_transformer_2"] = True
|
| 84 |
-
pipeline.load_lora_weights(
|
| 85 |
-
"GiorgioV/LoRA_for_WAN_22",
|
| 86 |
-
weight_name="LoRA_GH.safetensors",
|
| 87 |
-
adapter_name="lora_gh", **kwargs_lora_gh
|
| 88 |
-
)
|
| 89 |
-
pipeline.set_adapters(["lightx2v", "lightx2v_2", "lora_gh"], adapter_weights=[1., 1., 1.])
|
| 90 |
pipeline.fuse_lora(adapter_names=["lightx2v"], lora_scale=3., components=["transformer"])
|
| 91 |
-
pipeline.fuse_lora(adapter_names=["lora_gh"], lora_scale=0.2, components=["transformer_2"])
|
| 92 |
pipeline.fuse_lora(adapter_names=["lightx2v_2"], lora_scale=1., components=["transformer_2"])
|
| 93 |
pipeline.unload_lora_weights()
|
| 94 |
|
|
|
|
| 79 |
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 80 |
adapter_name="lightx2v_2", **kwargs_lora
|
| 81 |
)
|
| 82 |
+
pipeline.set_adapters(["lightx2v", "lightx2v_2"], adapter_weights=[1., 1.])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
pipeline.fuse_lora(adapter_names=["lightx2v"], lora_scale=3., components=["transformer"])
|
|
|
|
| 84 |
pipeline.fuse_lora(adapter_names=["lightx2v_2"], lora_scale=1., components=["transformer_2"])
|
| 85 |
pipeline.unload_lora_weights()
|
| 86 |
|