Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,6 +52,34 @@ pipe = WanPipeline.from_pretrained(MODEL_ID,
|
|
| 52 |
).to('cuda')
|
| 53 |
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
for i in range(3):
|
| 56 |
gc.collect()
|
| 57 |
torch.cuda.synchronize()
|
|
|
|
| 52 |
).to('cuda')
|
| 53 |
|
| 54 |
|
| 55 |
+
|
| 56 |
+
## TEST LORA
|
| 57 |
+
|
| 58 |
+
pipe.load_lora_weights(
|
| 59 |
+
"rahul7star/wan2.2Lora",
|
| 60 |
+
weight_name="DR34ML4Y_I2V_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 |
+
"rahul7star/wan2.2Lora",
|
| 67 |
+
weight_name="DR34ML4Y_I2V_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(["lightx2v", "lightx2v_2", "high_noise_lora", "low_noise_lora"], adapter_weights=[1., 1., 1., 1.])
|
| 76 |
+
# ไฟฎๆนไบlora_scale
|
| 77 |
+
pipe.fuse_lora(adapter_names=["lightx2v", "high_noise_lora"], lora_scales=[3.0, 3.0], components=["transformer"])
|
| 78 |
+
# ไฟฎๆนไบlora_scale
|
| 79 |
+
pipe.fuse_lora(adapter_names=["lightx2v_2", "low_noise_lora"], lora_scales=[1.0, 1.0], components=["transformer_2"])
|
| 80 |
+
pipe.unload_lora_weights()
|
| 81 |
+
##
|
| 82 |
+
|
| 83 |
for i in range(3):
|
| 84 |
gc.collect()
|
| 85 |
torch.cuda.synchronize()
|