Spaces:
Running
on
Zero
Running
on
Zero
pipeline -> pipe
Browse files
app.py
CHANGED
|
@@ -48,29 +48,29 @@ pipe = WanImageToVideoPipeline.from_pretrained(MODEL_ID,
|
|
| 48 |
torch_dtype=torch.bfloat16,
|
| 49 |
).to('cuda')
|
| 50 |
|
| 51 |
-
|
| 52 |
"Kijai/WanVideo_comfy",
|
| 53 |
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 54 |
adapter_name="lightx2v"
|
| 55 |
)
|
| 56 |
kwargs_lora = {}
|
| 57 |
kwargs_lora["load_into_transformer_2"] = True
|
| 58 |
-
|
| 59 |
"Kijai/WanVideo_comfy",
|
| 60 |
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 61 |
adapter_name="lightx2v_2", **kwargs_lora
|
| 62 |
)
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
|
| 68 |
-
quantize_(
|
| 69 |
-
quantize_(
|
| 70 |
-
quantize_(
|
| 71 |
|
| 72 |
-
aoti.aoti_blocks_load(
|
| 73 |
-
aoti.aoti_blocks_load(
|
| 74 |
|
| 75 |
|
| 76 |
default_prompt_i2v = "make this image come alive, cinematic motion, smooth animation"
|
|
|
|
| 48 |
torch_dtype=torch.bfloat16,
|
| 49 |
).to('cuda')
|
| 50 |
|
| 51 |
+
pipe.load_lora_weights(
|
| 52 |
"Kijai/WanVideo_comfy",
|
| 53 |
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 54 |
adapter_name="lightx2v"
|
| 55 |
)
|
| 56 |
kwargs_lora = {}
|
| 57 |
kwargs_lora["load_into_transformer_2"] = True
|
| 58 |
+
pipe.load_lora_weights(
|
| 59 |
"Kijai/WanVideo_comfy",
|
| 60 |
weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
|
| 61 |
adapter_name="lightx2v_2", **kwargs_lora
|
| 62 |
)
|
| 63 |
+
pipe.set_adapters(["lightx2v", "lightx2v_2"], adapter_weights=[1., 1.])
|
| 64 |
+
pipe.fuse_lora(adapter_names=["lightx2v"], lora_scale=3., components=["transformer"])
|
| 65 |
+
pipe.fuse_lora(adapter_names=["lightx2v_2"], lora_scale=1., components=["transformer_2"])
|
| 66 |
+
pipe.unload_lora_weights()
|
| 67 |
|
| 68 |
+
quantize_(pipe.text_encoder, Int8WeightOnlyConfig())
|
| 69 |
+
quantize_(pipe.transformer, Float8DynamicActivationFloat8WeightConfig())
|
| 70 |
+
quantize_(pipe.transformer_2, Float8DynamicActivationFloat8WeightConfig())
|
| 71 |
|
| 72 |
+
aoti.aoti_blocks_load(pipe.transformer, 'zerogpu-aoti/Wan2', variant='fp8da')
|
| 73 |
+
aoti.aoti_blocks_load(pipe.transformer_2, 'zerogpu-aoti/Wan2', variant='fp8da')
|
| 74 |
|
| 75 |
|
| 76 |
default_prompt_i2v = "make this image come alive, cinematic motion, smooth animation"
|