Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,23 @@ from huggingface_hub import snapshot_download
|
|
5 |
from diffsynth import ModelManager, WanVideoPusaPipeline, save_video
|
6 |
import spaces
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# Constants
|
9 |
WAN_SUBFOLDER = "Wan2.1-T2V-14B"
|
10 |
MODEL_REPO_ID = "RaphaelLiu/PusaV1"
|
|
|
5 |
from diffsynth import ModelManager, WanVideoPusaPipeline, save_video
|
6 |
import spaces
|
7 |
|
8 |
+
import subprocess
|
9 |
+
import os
|
10 |
+
import sys
|
11 |
+
|
12 |
+
# Install PusaV1 locally if not already installed
|
13 |
+
PUSA_PATH = os.path.abspath("./PusaV1")
|
14 |
+
if PUSA_PATH not in sys.path:
|
15 |
+
sys.path.insert(0, PUSA_PATH)
|
16 |
+
|
17 |
+
if not os.path.exists(os.path.join(PUSA_PATH, "diffsynth")):
|
18 |
+
raise RuntimeError("PusaV1 folder is missing or incorrectly placed.")
|
19 |
+
|
20 |
+
setup_file = os.path.join(PUSA_PATH, "setup.py")
|
21 |
+
if os.path.exists(setup_file):
|
22 |
+
subprocess.run([sys.executable, setup_file, "install"], check=False)
|
23 |
+
|
24 |
+
|
25 |
# Constants
|
26 |
WAN_SUBFOLDER = "Wan2.1-T2V-14B"
|
27 |
MODEL_REPO_ID = "RaphaelLiu/PusaV1"
|