QuintW commited on
Commit
d847810
1 Parent(s): 78db0f1

update met chatgpt hulp

Browse files
Files changed (1) hide show
  1. app.py +32 -13
app.py CHANGED
@@ -1,17 +1,36 @@
1
  import os
2
- os.chdir(f"/home/user/app")
3
- os.system(f"git clone -b v2.6 https://github.com/camenduru/stable-diffusion-webui /home/user/app/stable-diffusion-webui")
4
- os.chdir(f"/home/user/app/stable-diffusion-webui")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  os.system(f"git lfs install")
6
  os.system(f"git reset --hard")
7
- os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch_v2.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
8
- os.system(f"sed -i -e '253,258d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
9
- os.system(f"sed -i -e '186,228d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
10
- os.system(f"sed -i -e '171,178d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
11
- os.system(f"sed -i -e '108,113d' /home/user/app/stable-diffusion-webui/modules/ui_settings.py")
12
- os.system(f"sed -i -e '225,227d' /home/user/app/stable-diffusion-webui/modules/ui_loadsave.py")
13
- os.system(f"sed -i -e '214,217d' /home/user/app/stable-diffusion-webui/modules/ui_loadsave.py")
14
- os.system(f"rm -rfv /home/user/app/stable-diffusion-webui/scripts/")
15
- os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/counterfeit-xl/resolve/main/counterfeitxl_v10.safetensors -d /home/user/app/stable-diffusion-webui/models/Stable-diffusion -o counterfeitxl_v10.safetensors")
16
  # os.system(f"python launch.py --api --cors-allow-origins=* --xformers --theme dark --gradio-queue --ui-settings-file /home/user/app/shared-config_v2.json --ui-config-file /home/user/app/shared-ui-config_v2.json")
17
- os.system(f"python launch.py --api --cors-allow-origins=* --theme dark --gradio-queue --ui-settings-file /home/user/app/shared-config_v2.json --ui-config-file /home/user/app/shared-ui-config_v2.json")
 
 
1
  import os
2
+
3
+ # Initial clone
4
+ initial_repo_path = "/home/user/app/stable-diffusion-webui"
5
+ initial_repo_url = "https://github.com/camenduru/stable-diffusion-webui"
6
+ initial_branch = "v2.6"
7
+ os.chdir("/home/user/app")
8
+ os.system(f"git clone -b {initial_branch} {initial_repo_url} {initial_repo_path}")
9
+
10
+ # Change directory to the cloned repository
11
+ os.chdir(initial_repo_path)
12
+
13
+ # Perform a git pull to update the repository
14
+ os.system("git pull")
15
+
16
+ # Clone the Controlnet extension
17
+ controlnet_repo_url = "https://github.com/Mikubill/sd-webui-controlnet"
18
+ os.system(f"git clone {controlnet_repo_url} {initial_repo_path}/controlnet")
19
+
20
+ # Continue with the rest of your setup...
21
+ os.chdir(initial_repo_path)
22
+
23
  os.system(f"git lfs install")
24
  os.system(f"git reset --hard")
25
+ os.system(f"sed -i -e '/demo:/r /home/user/app/header_patch_v2.py' modules/ui.py")
26
+ os.system(f"sed -i -e '253,258d' modules/ui_settings.py")
27
+ os.system(f"sed -i -e '186,228d' modules/ui_settings.py")
28
+ os.system(f"sed -i -e '171,178d' modules/ui_settings.py")
29
+ os.system(f"sed -i -e '108,113d' modules/ui_settings.py")
30
+ os.system(f"sed -i -e '225,227d' modules/ui_loadsave.py")
31
+ os.system(f"sed -i -e '214,217d' modules/ui_loadsave.py")
32
+ os.system(f"rm -rfv scripts/")
33
+ os.system(f"aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/ckpt/counterfeit-xl/resolve/main/counterfeitxl_v10.safetensors -d models/Stable-diffusion -o counterfeitxl_v10.safetensors")
34
  # os.system(f"python launch.py --api --cors-allow-origins=* --xformers --theme dark --gradio-queue --ui-settings-file /home/user/app/shared-config_v2.json --ui-config-file /home/user/app/shared-ui-config_v2.json")
35
+ os.system(f"python launch.py --api --cors-allow-origins=* --theme dark --gradio-queue --ui-settings-file /home/user/app/shared-config_v2.json --ui-config-file /home/user/app/shared-ui-config_v2.json")
36
+ This script first performs the initial clone of the stable-diffusion-webui repository, updates it