|
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) |
|
|
|
|
|
run_command(["pip", "install", "pygit2==1.15.1"]) |
|
|
|
|
|
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]) |
|
|
|
|
|
os.chdir(repo_dir) |
|
|
|
|
|
run_command(["python", "entry_with_update.py", "--share", "--always-high-vram"]) |
|
|