rahul7star commited on
Commit
ee536e4
·
verified ·
1 Parent(s): 4fa9b7a

Update optimization.py

Browse files
Files changed (1) hide show
  1. optimization.py +5 -60
optimization.py CHANGED
@@ -43,79 +43,24 @@ def optimize_pipeline_(pipeline: Callable[P, Any], *args: P.args, **kwargs: P.kw
43
  @spaces.GPU(duration=1500)
44
  def compile_transformer():
45
 
46
- # pipeline.load_lora_weights(
47
- # "Kijai/WanVideo_comfy",
48
- # weight_name="Lightx2v/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank128_bf16.safetensors",
49
- # adapter_name="lightning"
50
- # )
51
- # kwargs_lora = {}
52
- # kwargs_lora["load_into_transformer_2"] = True
53
- # pipeline.load_lora_weights(
54
- # "Kijai/WanVideo_comfy",
55
- # weight_name="Lightx2v/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank128_bf16.safetensors",
56
- # #weight_name="Wan22-Lightning/Wan2.2-Lightning_T2V-A14B-4steps-lora_LOW_fp16.safetensors",
57
- # adapter_name="lightning_2", **kwargs_lora
58
- # )
59
- # pipeline.set_adapters(["lightning", "lightning_2"], adapter_weights=[1., 1.])
60
-
61
-
62
- # pipeline.fuse_lora(adapter_names=["lightning"], lora_scale=3., components=["transformer"])
63
- # pipeline.fuse_lora(adapter_names=["lightning_2"], lora_scale=1., components=["transformer_2"])
64
- # pipeline.unload_lora_weights()
65
-
66
-
67
-
68
  pipeline.load_lora_weights(
69
  "Kijai/WanVideo_comfy",
70
- #weight_name="LoRAs/Wan22_Lightx2v/Wan_2_2_I2V_A14B_HIGH_lightx2v_4step_lora_v1030_rank_64_bf16.safetensors",
71
- weight_name="Lightx2v/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank128_bf16.safetensors",
72
  adapter_name="lightning"
73
  )
74
  kwargs_lora = {}
75
  kwargs_lora["load_into_transformer_2"] = True
76
- # pipeline.load_lora_weights(
77
- # #"drozbay/Wan2.2_A14B_lora_extract",
78
- # "Kijai/WanVideo_comfy",
79
- # #weight_name="MTVCrafter/Wan2_1_MTV-Crafter_motion_adapter_bf16.safetensors",
80
- # #weight_name="Skyreels/Wan2_1_Skyreels-v2-T2V-720P_LoRA_rank_64_fp16.safetensors",
81
- # #weight_name="Pusa/Wan21_PusaV1_LoRA_14B_rank512_bf16.safetensors",
82
- # weight_name="Wan22-Lightning/Wan2.2-Lightning_T2V-A14B-4steps-lora_LOW_fp16.safetensors",
83
- # adapter_name="lightning_2", **kwargs_lora
84
- # )
85
-
86
-
87
-
88
  pipeline.load_lora_weights(
89
- #"drozbay/Wan2.2_A14B_lora_extract",
90
- "lightx2v/Wan2.2-Lightning",
91
- #weight_name="MTVCrafter/Wan2_1_MTV-Crafter_motion_adapter_bf16.safetensors",
92
- #weight_name="Skyreels/Wan2_1_Skyreels-v2-T2V-720P_LoRA_rank_64_fp16.safetensors",
93
- weight_name="Wan2.2-T2V-A14B-4steps-lora-rank64-Seko-V1/low_noise_model.safetensors",
94
- #weight_name="Wan2.2-T2V-A14B-4steps-lora-rank64-Seko-V1.1/low_noise_model.safetensors",
95
  adapter_name="lightning_2", **kwargs_lora
96
  )
97
-
98
- # pipeline.load_lora_weights(
99
- # #"drozbay/Wan2.2_A14B_lora_extract",
100
- # "ostris/wan22_i2v_14b_orbit_shot_lora",
101
- # #weight_name="MTVCrafter/Wan2_1_MTV-Crafter_motion_adapter_bf16.safetensors",
102
- # #weight_name="Skyreels/Wan2_1_Skyreels-v2-T2V-720P_LoRA_rank_64_fp16.safetensors",
103
- # weight_name="wan22_14b_i2v_orbit_low_noise.safetensors",
104
- # #weight_name="Wan2.2-T2V-A14B-4steps-lora-rank64-Seko-V1.1/low_noise_model.safetensors",
105
- # adapter_name="lightning_200", **kwargs_lora
106
- # )
107
-
108
-
109
-
110
-
111
-
112
-
113
- pipeline.set_adapters(["lightning", "lightning_2"], adapter_weights=[1.5, 1.])
114
 
115
 
116
  pipeline.fuse_lora(adapter_names=["lightning"], lora_scale=3., components=["transformer"])
117
  pipeline.fuse_lora(adapter_names=["lightning_2"], lora_scale=1., components=["transformer_2"])
118
-
119
  pipeline.unload_lora_weights()
120
 
121
  with capture_component_call(pipeline, 'transformer') as call:
 
43
  @spaces.GPU(duration=1500)
44
  def compile_transformer():
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  pipeline.load_lora_weights(
47
  "Kijai/WanVideo_comfy",
48
+ weight_name="Lightx2v/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank128_bf16.safetensors",
 
49
  adapter_name="lightning"
50
  )
51
  kwargs_lora = {}
52
  kwargs_lora["load_into_transformer_2"] = True
 
 
 
 
 
 
 
 
 
 
 
 
53
  pipeline.load_lora_weights(
54
+ "Kijai/WanVideo_comfy",
55
+ weight_name="Lightx2v/lightx2v_T2V_14B_cfg_step_distill_v2_lora_rank128_bf16.safetensors",
56
+ #weight_name="Wan22-Lightning/Wan2.2-Lightning_T2V-A14B-4steps-lora_LOW_fp16.safetensors",
 
 
 
57
  adapter_name="lightning_2", **kwargs_lora
58
  )
59
+ pipeline.set_adapters(["lightning", "lightning_2"], adapter_weights=[1., 1.])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
 
62
  pipeline.fuse_lora(adapter_names=["lightning"], lora_scale=3., components=["transformer"])
63
  pipeline.fuse_lora(adapter_names=["lightning_2"], lora_scale=1., components=["transformer_2"])
 
64
  pipeline.unload_lora_weights()
65
 
66
  with capture_component_call(pipeline, 'transformer') as call: