File size: 774 Bytes
962014c
ebc81de
5f091f6
 
40a35f9
ad5e19a
5f091f6
3e49366
5f091f6
 
3e49366
5f091f6
60e78ea
298cb83
032f754
ebc81de
 
298cb83
b8307a9
0d7e5a8
5f091f6
b8307a9
6505089
 
569ee0e
6505089
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import subprocess
import os
import torch

os.system("nvidia-smi")

if torch.cuda.is_available():
  device="cuda"
  print("Using GPU")
else:
  device="cpu"
  print("Using CPU")

# Clone the repository
subprocess.run(["git", "clone", "https://github.com/facefusion/facefusion", "--branch", "2.5.2", "--single-branch"], check=True)
# chande directory to face fusion to run ui
os.chdir("facefusion")

# installation
subprocess.run(["python", "install.py", "--onnxruntime", "cuda-12.2", "--skip-conda"], check=True)

# Run the ui
if device=="cuda":
    subprocess.run(["python", "run.py", "--execution-providers", "cuda"], check=True)
    subprocess.run(["nvcc", "--version"], check=True)
else:
    subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True)