Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -55,30 +55,34 @@ pipe = WanPipeline.from_pretrained(MODEL_ID,
|
|
| 55 |
|
| 56 |
# ## TEST LORA
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
#
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
#
|
| 77 |
-
|
| 78 |
-
#
|
| 79 |
-
|
| 80 |
-
|
| 81 |
# ##
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
for i in range(3):
|
| 84 |
gc.collect()
|
|
|
|
| 55 |
|
| 56 |
# ## TEST LORA
|
| 57 |
|
| 58 |
+
pipe.load_lora_weights(
|
| 59 |
+
"wangkanai/wan22-fp8-loras-nsfw",
|
| 60 |
+
weight_name="loras/wan/wan22-action-doggystyle-t2v-14b-high.safetensors",
|
| 61 |
+
adapter_name="high_noise_lora",
|
| 62 |
+
token=os.environ.get("HF_TOKEN")
|
| 63 |
+
)
|
| 64 |
+
# ๆฐๅข๏ผๅ ่ฝฝไฝ ๆไพ็low noise LoRA
|
| 65 |
+
pipe.load_lora_weights(
|
| 66 |
+
"wangkanai/wan22-fp8-loras-nsfw",
|
| 67 |
+
weight_name="loras/wan/wan22-action-doggystyle-t2v-14b-low.safetensors",
|
| 68 |
+
adapter_name="low_noise_lora",
|
| 69 |
+
token=os.environ.get("HF_TOKEN"),
|
| 70 |
+
load_into_transformer_2=True
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
pipe.set_adapters(["lightning", "lightning_2", "high_noise_lora", "low_noise_lora"], adapter_weights=[1., 1., 1., 1.])
|
| 76 |
+
# ไฟฎๆนไบlora_scale
|
| 77 |
+
pipe.fuse_lora(adapter_names=["lightning", "high_noise_lora"], lora_scales=[3.0, 3.0], components=["transformer"])
|
| 78 |
+
# ไฟฎๆนไบlora_scale
|
| 79 |
+
pipe.fuse_lora(adapter_names=["lightning_2", "low_noise_lora"], lora_scales=[1.0, 1.0], components=["transformer_2"])
|
| 80 |
+
pipe.unload_lora_weights()
|
| 81 |
# ##
|
| 82 |
+
# ## TEST LORA ENDS
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
|
| 86 |
|
| 87 |
for i in range(3):
|
| 88 |
gc.collect()
|