diocal commited on
Commit
f755c01
Β·
verified Β·
1 Parent(s): 6d42cb8

Update app.py

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