Spaces:
Running
on
Zero
Running
on
Zero
Update app1.py
Browse files
app1.py
CHANGED
@@ -58,16 +58,25 @@ pipe = WanPipeline.from_pretrained(
|
|
58 |
# Notes:
|
59 |
# - We attach this LoRA only to transformer_2 (the low-noise stage for Wan2.2).
|
60 |
# - Adapter name `orbit_low` lets you adjust/enable later via set_adapters if needed.
|
61 |
-
pipe.load_lora_weights(
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
)
|
67 |
-
# Activate the adapter on transformer_2 with weight 1.0 (changeable)
|
68 |
-
pipe.set_adapters(
|
69 |
-
|
70 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
# -------------------------------------------------------------------------------
|
72 |
|
73 |
# Usual CUDA cleanup
|
@@ -88,20 +97,18 @@ optimize_pipeline_(
|
|
88 |
# ---- NEW: Load + Fuse Orbit-Shot LoRA on the LOW-NOISE stage only (transformer_2) ----
|
89 |
# Repo: ostris/wan22_i2v_14b_orbit_shot_lora
|
90 |
# File: wan22_14b_i2v_orbit_low_noise.safetensors
|
91 |
-
|
92 |
-
|
93 |
-
"
|
94 |
-
|
95 |
-
adapter_name="
|
96 |
-
|
97 |
-
)
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
components=["transformer_2"],
|
104 |
-
)
|
105 |
# -------------------------------------------------------------------------------
|
106 |
|
107 |
|
|
|
58 |
# Notes:
|
59 |
# - We attach this LoRA only to transformer_2 (the low-noise stage for Wan2.2).
|
60 |
# - Adapter name `orbit_low` lets you adjust/enable later via set_adapters if needed.
|
61 |
+
# pipe.load_lora_weights(
|
62 |
+
# "ostris/wan22_i2v_14b_orbit_shot_lora",
|
63 |
+
# weight_name="wan22_14b_i2v_orbit_low_noise.safetensors",
|
64 |
+
# adapter_name="orbit_low",
|
65 |
+
# components=["transformer_2"], # IMPORTANT: apply only to low-noise stage
|
66 |
+
# )
|
67 |
+
# # Activate the adapter on transformer_2 with weight 1.0 (changeable)
|
68 |
+
# pipe.set_adapters(
|
69 |
+
# ["orbit_low"], adapter_weights=[1.0], components=["transformer_2"]
|
70 |
+
# )
|
71 |
+
|
72 |
+
|
73 |
+
LORA_REPO_ID = "ostris/wan22_i2v_14b_orbit_shot_lora"
|
74 |
+
LORA_FILENAME = "wan22_14b_i2v_orbit_low_noise.safetensors"
|
75 |
+
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
|
80 |
# -------------------------------------------------------------------------------
|
81 |
|
82 |
# Usual CUDA cleanup
|
|
|
97 |
# ---- NEW: Load + Fuse Orbit-Shot LoRA on the LOW-NOISE stage only (transformer_2) ----
|
98 |
# Repo: ostris/wan22_i2v_14b_orbit_shot_lora
|
99 |
# File: wan22_14b_i2v_orbit_low_noise.safetensors
|
100 |
+
try:
|
101 |
+
causvid_path = hf_hub_download(repo_id=LORA_REPO_ID, filename=LORA_FILENAME)
|
102 |
+
print("✅ LoRA downloaded to:", causvid_path)
|
103 |
+
|
104 |
+
pipe.load_lora_weights(causvid_path, adapter_name="causvid_lora")
|
105 |
+
pipe.set_adapters(["causvid_lora"], adapter_weights=[0.75])
|
106 |
+
pipe.fuse_lora()
|
107 |
+
|
108 |
+
except Exception as e:
|
109 |
+
import traceback
|
110 |
+
print("❌ Error during LoRA loading:")
|
111 |
+
traceback.print_exc()
|
|
|
|
|
112 |
# -------------------------------------------------------------------------------
|
113 |
|
114 |
|