Nick088 commited on
Commit
3e49366
β€’
1 Parent(s): 6d8a6da

Update facefusion from 2.4.1 to 2.50

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -3,18 +3,20 @@ import os
3
  import torch
4
 
5
  if torch.cuda.is_available():
 
6
  print("Using GPU")
7
  else:
 
8
  print("Using CPU")
9
 
10
  # Clone the repository
11
- subprocess.run(["git", "clone", "https://github.com/facefusion/facefusion", "--branch", "2.4.1", "--single-branch"], check=True)
12
 
13
  # chande directory to face fusion to run ui
14
  os.chdir("facefusion")
15
 
16
  # installation
17
- subprocess.run(["python", "install.py", "--onnxruntime", "cuda-11.8", "--skip-venv"], check=True)
18
 
19
  # Run the ui
20
- subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True)
 
3
  import torch
4
 
5
  if torch.cuda.is_available():
6
+ device="cuda"
7
  print("Using GPU")
8
  else:
9
+ device="cpu"
10
  print("Using CPU")
11
 
12
  # Clone the repository
13
+ subprocess.run(["git", "clone", "https://github.com/facefusion/facefusion", "--branch", "2.5.0", "--single-branch"], check=True)
14
 
15
  # chande directory to face fusion to run ui
16
  os.chdir("facefusion")
17
 
18
  # installation
19
+ subprocess.run(["python", "install.py", "--onnxruntime", "cuda-11.8", "--skip-cuda"], check=True)
20
 
21
  # Run the ui
22
+ subprocess.run(["python", "run.py", "--execution-providers", "cpu", {"cuda" if device=="cuda" else None}], check=True)