Ryan-PR commited on
Commit
c314b04
·
verified ·
1 Parent(s): 23cbe99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -6,6 +6,19 @@ import gradio as gr
6
  import cv2
7
  import numpy as np
8
  from PIL import Image
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  os.makedirs("./sam2/SAM2-Video-Predictor/checkpoints/", exist_ok=True)
11
 
 
6
  import cv2
7
  import numpy as np
8
  from PIL import Image
9
+ import subprocess
10
+
11
+ def ensure_wan():
12
+ try:
13
+ import wan # noqa
14
+ print("[setup] wan already installed.")
15
+ except ImportError:
16
+ cmd = "pip install --no-build-isolation 'wan@git+https://github.com/Wan-Video/Wan2.1'"
17
+ env = dict(os.environ)
18
+ print(f"[setup] Installing wan2.1: {cmd}")
19
+ subprocess.run(cmd, shell=True, check=True, env=env)
20
+
21
+ ensure_wan()
22
 
23
  os.makedirs("./sam2/SAM2-Video-Predictor/checkpoints/", exist_ok=True)
24