Spaces:
Paused
Paused
Update optimization.py
Browse files- optimization.py +15 -1
optimization.py
CHANGED
|
@@ -105,15 +105,29 @@ def optimize_pipeline_(pipeline: Callable[P, Any], *args: P.args, **kwargs: P.kw
|
|
| 105 |
# )
|
| 106 |
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
-
pipeline.set_adapters(["lightning", "lightning_2"], adapter_weights=[1., 1.])
|
| 113 |
|
| 114 |
|
| 115 |
pipeline.fuse_lora(adapter_names=["lightning"], lora_scale=3., components=["transformer"])
|
| 116 |
pipeline.fuse_lora(adapter_names=["lightning_2"], lora_scale=1., components=["transformer_2"])
|
|
|
|
| 117 |
|
| 118 |
pipeline.unload_lora_weights()
|
| 119 |
|
|
|
|
| 105 |
# )
|
| 106 |
|
| 107 |
|
| 108 |
+
|
| 109 |
+
pipeline.load_lora_weights(
|
| 110 |
+
#"drozbay/Wan2.2_A14B_lora_extract",
|
| 111 |
+
"deadman44/Wan2.2_T2i_T2v_LoRA",
|
| 112 |
+
#weight_name="MTVCrafter/Wan2_1_MTV-Crafter_motion_adapter_bf16.safetensors",
|
| 113 |
+
#weight_name="Skyreels/Wan2_1_Skyreels-v2-T2V-720P_LoRA_rank_64_fp16.safetensors",
|
| 114 |
+
weight_name="lora_wan2.2_myjd_Low_v01.safetensors",
|
| 115 |
+
#weight_name="Wan2.2-T2V-A14B-4steps-lora-rank64-Seko-V1.1/low_noise_model.safetensors",
|
| 116 |
+
adapter_name="lightning_22", **kwargs_lora
|
| 117 |
+
)
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
+
pipeline.set_adapters(["lightning", "lightning_2","lightning_22"], adapter_weights=[1., 1.,1.])
|
| 126 |
|
| 127 |
|
| 128 |
pipeline.fuse_lora(adapter_names=["lightning"], lora_scale=3., components=["transformer"])
|
| 129 |
pipeline.fuse_lora(adapter_names=["lightning_2"], lora_scale=1., components=["transformer_2"])
|
| 130 |
+
pipeline.fuse_lora(adapter_names=["lightning_22"], lora_scale=1., components=["transformer_2"])
|
| 131 |
|
| 132 |
pipeline.unload_lora_weights()
|
| 133 |
|