Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,31 +1,30 @@
|
|
|
|
|
|
1 |
|
2 |
-
|
3 |
-
|
|
|
4 |
|
5 |
-
|
6 |
-
|
7 |
-
|
|
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
"https://github.com/Diocal/swappingface",
|
12 |
-
"--single-branch"], check=True)
|
13 |
|
14 |
-
|
15 |
-
|
|
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
check=True)
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
os.environ['GRADIO_SERVER_PORT'] = '7860'
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
# Run the UI in CPU mode
|
30 |
-
subprocess.run(["python", "facefusion.py", "run",
|
31 |
-
"--execution-providers", "cpu"], check=True)
|
|
|
1 |
+
import subprocess
|
2 |
+
import os
|
3 |
|
4 |
+
# Set the device to CPU explicitly
|
5 |
+
device = "cpu"
|
6 |
+
print("Using CPU")
|
7 |
|
8 |
+
# Clone YOUR repository - URL CORRECTA
|
9 |
+
subprocess.run(["git", "clone",
|
10 |
+
"https://github.com/Diocal/swappingface",
|
11 |
+
"--single-branch"], check=True)
|
12 |
|
13 |
+
# Change directory to facefusion to run the UI
|
14 |
+
os.chdir("facefusion")
|
|
|
|
|
15 |
|
16 |
+
# Install dependencies for CPU mode
|
17 |
+
subprocess.run(["python", "install.py",
|
18 |
+
"--onnxruntime", "default", "--skip-conda"],
|
19 |
+
check=True)
|
20 |
|
21 |
+
# AGREGAR ESTAS LΓNEAS PARA HABILITAR API
|
22 |
+
os.environ['GRADIO_SERVER_NAME'] = '0.0.0.0'
|
23 |
+
os.environ['GRADIO_SERVER_PORT'] = '7860'
|
|
|
24 |
|
25 |
+
print("π Starting FaceFusion with API
|
26 |
+
enabled...")
|
|
|
27 |
|
28 |
+
# Run the UI in CPU mode
|
29 |
+
subprocess.run(["python", "facefusion.py", "run",
|
30 |
+
"--execution-providers", "cpu"], check=True)
|
|
|
|
|
|