Singularity666 commited on
Commit
4af25d0
Β·
verified Β·
1 Parent(s): ead8ca2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -4,15 +4,18 @@ import subprocess
4
  import gradio as gr
5
 
6
  def setup_environment():
7
- # Install required packages
8
  subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "pygit2==1.12.2"])
9
- subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "-r", "requirements_versions.txt"])
10
 
11
  def clone_repo():
12
  # Clone the repository
13
  repo_url = "https://github.com/Cardano-max/Automated_DeFooocus.git"
14
- subprocess.check_call(["git", "clone", repo_url])
 
15
  os.chdir("Automated_DeFooocus")
 
 
 
16
 
17
  def run_fooocus(theme="dark", preset="default", advanced_args="--attention-split --always-high-vram --disable-offload-from-vram --all-in-fp16"):
18
  args = f"{advanced_args} --theme {theme}"
 
4
  import gradio as gr
5
 
6
  def setup_environment():
7
+ # Install only pygit2, which is required for cloning
8
  subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "pygit2==1.12.2"])
 
9
 
10
  def clone_repo():
11
  # Clone the repository
12
  repo_url = "https://github.com/Cardano-max/Automated_DeFooocus.git"
13
+ if not os.path.exists("Automated_DeFooocus"):
14
+ subprocess.check_call(["git", "clone", repo_url])
15
  os.chdir("Automated_DeFooocus")
16
+
17
+ # Now install the requirements from the cloned repo
18
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "-q", "-r", "requirements_versions.txt"])
19
 
20
  def run_fooocus(theme="dark", preset="default", advanced_args="--attention-split --always-high-vram --disable-offload-from-vram --all-in-fp16"):
21
  args = f"{advanced_args} --theme {theme}"