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

Update app.py

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