Download app.py from uruguayai/fooocus_tst: direct link, hf CLI and curl.
- Browser
- Download file 753 Bytes
-
https://huggingface.co/uruguayai/fooocus_tst/resolve/main/app.py
- Command line
-
hf download hf://uruguayai/fooocus_tst/app.py
-
curl -L -o app.py https://huggingface.co/uruguayai/fooocus_tst/resolve/main/app.py
753 Bytes
| import subprocess | |
| import os | |
| def run_command(cmd): | |
| result = subprocess.run(cmd, capture_output=True, text=True) | |
| if result.returncode != 0: | |
| print(f"Error running command: {' '.join(cmd)}") | |
| print(result.stderr) | |
| else: | |
| print(result.stdout) | |
| # Install the correct version of pygit2 | |
| run_command(["pip", "install", "pygit2==1.15.1"]) | |
| # Clone the repository if it doesn't already exist | |
| repo_url = "https://github.com/lllyasviel/Fooocus.git" | |
| repo_dir = "/home/user/app/Fooocus" | |
| if not os.path.exists(repo_dir): | |
| run_command(["git", "clone", repo_url, repo_dir]) | |
| # Change to the cloned directory | |
| os.chdir(repo_dir) | |
| # Run the python script | |
| run_command(["python", "entry_with_update.py", "--share", "--always-high-vram"]) | |