GiorgioV commited on
Commit
0e846c6
·
verified ·
1 Parent(s): 9135753

Update optimization.py

Browse files
Files changed (1) hide show
  1. optimization.py +9 -1
optimization.py CHANGED
@@ -79,8 +79,16 @@ 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
- 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
 
 
79
  weight_name="Lightx2v/lightx2v_I2V_14B_480p_cfg_step_distill_rank128_bf16.safetensors",
80
  adapter_name="lightx2v_2", **kwargs_lora
81
  )
82
+ kwargs_lora_gh = {}
83
+ kwargs_lora_gh["load_into_transformer_2"] = True
84
+ pipe.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.4, components=["transformer_2"])
92
  pipeline.fuse_lora(adapter_names=["lightx2v_2"], lora_scale=1., components=["transformer_2"])
93
  pipeline.unload_lora_weights()
94