Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
7d3e4a8
1
Parent(s):
0de16d8
Trying to get the lora to load properly
Browse files
app.py
CHANGED
@@ -33,21 +33,18 @@ pipe = WanImageToVideoPipeline.from_pretrained(
|
|
33 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=8.0)
|
34 |
pipe.to("cuda")
|
35 |
|
36 |
-
|
37 |
-
lora_weights = []
|
38 |
-
# Load and fuse the single merged FusionX LoRA
|
39 |
-
|
40 |
try:
|
41 |
-
# Load CausVid LoRA (strength 1.0 as per FusionX)
|
42 |
lora_path = hf_hub_download(
|
43 |
repo_id=LORA_REPO_ID,
|
44 |
filename=LORA_FILENAME,
|
45 |
subfolder=LORA_SUBFOLDER
|
46 |
)
|
|
|
47 |
pipe.load_lora_weights(lora_path, adapter_name="fusionx")
|
48 |
-
|
49 |
-
|
50 |
-
print("✅ FusionX LoRA loaded
|
51 |
except Exception as e:
|
52 |
print(f"⚠️ FusionX LoRA not loaded: {e}")
|
53 |
|
|
|
33 |
pipe.scheduler = UniPCMultistepScheduler.from_config(pipe.scheduler.config, flow_shift=8.0)
|
34 |
pipe.to("cuda")
|
35 |
|
36 |
+
# Load the single merged FusionX LoRA
|
|
|
|
|
|
|
37 |
try:
|
|
|
38 |
lora_path = hf_hub_download(
|
39 |
repo_id=LORA_REPO_ID,
|
40 |
filename=LORA_FILENAME,
|
41 |
subfolder=LORA_SUBFOLDER
|
42 |
)
|
43 |
+
# Load the LoRA weights into the transformer model component
|
44 |
pipe.load_lora_weights(lora_path, adapter_name="fusionx")
|
45 |
+
# Set the adapter to be active
|
46 |
+
pipe.set_adapters(["fusionx"])
|
47 |
+
print("✅ FusionX LoRA loaded and activated. Use the slider to control its strength.")
|
48 |
except Exception as e:
|
49 |
print(f"⚠️ FusionX LoRA not loaded: {e}")
|
50 |
|