diocal commited on
Commit
6295b46
Β·
verified Β·
1 Parent(s): f755c01

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -24
app.py CHANGED
@@ -1,31 +1,30 @@
 
 
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)
 
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)