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"])