Spaces:
Runtime error
Runtime error
Download app.py from LULDev/FaceFusion: direct link, hf CLI and curl.
- Browser
- Download file 703 Bytes
-
https://huggingface.co/spaces/LULDev/FaceFusion/resolve/70518d9a1aa0c02523cf4629cd44c1b0c3f19404/app.py
- Command line
-
hf download hf://spaces/LULDev/FaceFusion@70518d9a1aa0c02523cf4629cd44c1b0c3f19404/app.py
-
curl -L -o app.py https://huggingface.co/spaces/LULDev/FaceFusion/resolve/70518d9a1aa0c02523cf4629cd44c1b0c3f19404/app.py
703 Bytes
| import subprocess | |
| import os | |
| import torch | |
| 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.0", "--single-branch"], check=True) | |
| # chande directory to face fusion to run ui | |
| os.chdir("facefusion") | |
| # installation | |
| subprocess.run(["python", "install.py", "--onnxruntime", "cuda-11.8", "--skip-conda"], check=True) | |
| # Run the ui | |
| if device=="cuda": | |
| subprocess.run(["python", "run.py", "--execution-providers", "cpu"], check=True) | |
| else: | |
| subprocess.run(["python", "run.py", "--execution-providers", "cpu", "cuda"], check=True) |