vorstcavry commited on
Commit
0110d3a
1 Parent(s): d98953a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +50 -13
app.py CHANGED
@@ -3,12 +3,14 @@ Stable Diffusion Webui Version 1.6
3
  https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.6.0
4
 
5
  """
6
- commit_id=r"5ef669de080814067961f28357256e8fe27544f4" #Version 1.3.0
7
  import os
8
  from sys import executable
9
  import subprocess
10
  import pathlib
11
  import gc
 
 
12
 
13
  def Gitclone(URI:str,ClonePath:pathlib.Path ) -> int :
14
  if pathlib.Path.exists(ClonePath):
@@ -42,9 +44,25 @@ print("cloning stable-diffusion-webui repo")
42
  Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui.git",user_home / r"stable-diffusion-webui")
43
  os.chdir(str(user_home / r"stable-diffusion-webui"))
44
  os.system("git reset --hard "+commit_id)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  #install extensions
46
  print("installing extensions")
47
- Gitclone(r"https://github.com/vorstcavry/embeddings",user_home / r"stable-diffusion-webui" / r"embeddings" / r"negative")
48
  #Gitclone(r"https://github.com/vorstcavry/lora",user_home / r"stable-diffusion-webui" / r"models" / r"Lora" / r"positive")
49
  #Gitclone(r"https://github.com/vorstcavry/Checkpoint-Model",user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion" / r"Checkpoint")
50
 
@@ -68,7 +86,7 @@ Gitclone(r"https://github.com/Mikubill/sd-webui-controlnet",user_home / r"stable
68
  #Gitclone(r"https://github.com/hnmr293/posex",user_home / r"stable-diffusion-webui" / r"extensions" / r"posex")
69
  #Gitclone(r"https://github.com/nonnonstop/sd-webui-3d-open-pose-editor",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-3d-open-pose-editor")
70
  #Gitclone(r"https://github.com/hnmr293/posex",user_home / r"stable-diffusion-webui" / r"extensions" / r"posex")
71
- Gitclone(r"https://github.com/EdithForsaken/sd-webui-cloud-inference.git",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-cloud-inference")
72
  Gitclone(r"https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git" , user_home / r"stable-diffusion-webui" / r"extensions" / r"a1111-sd-webui-tagcomplete")
73
  #Gitclone(r"https://github.com/camenduru/sd-webui-tunnels",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-tunnels")
74
  Gitclone(r"https://github.com/etherealxx/batchlinks-webui",user_home / r"stable-diffusion-webui" / r"extensions" / r"batchlinks-webui")
@@ -80,9 +98,8 @@ Gitclone(r"https://tinyurl.com/aspect-ratio-v",user_home / r"stable-diffusion-we
80
  #Gitclone(r"https://github.com/hnmr293/sd-webui-llul",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-llul")
81
  #Gitclone(r"https://github.com/IDEA-Research/DWPose",user_home / r"stable-diffusion-webui" / r"extensions" / r"DWPose")
82
  #Gitclone(r"https://github.com/Bing-su/adetailer",user_home / r"stable-diffusion-webui" / r"extensions" / r"adetailer")
 
83
 
84
-
85
- #Gitclone(r"https://github.com/NoCrypt/sd_hf_out",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd_hf_out")
86
  #Gitclone(r"https://github.com/Iyashinouta/sd-model-downloader",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-model-downloader")
87
  #Gitclone(r"https://github.com/AIrjen/OneButtonPrompt",user_home / r"stable-diffusion-webui" / r"extensions" / r"OneButtonPrompt")
88
  #Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards",user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-wildcards")
@@ -184,6 +201,8 @@ DownLoad(r"https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/mai
184
  #DownLoad(r"https://huggingface.co/vorstcavry/loraasia1/resolve/main/taiwanDollLikeness_v15.safetensors",user_home / r"stable-diffusion-webui" / r"models"/ r"lora",r"taiwanDollLikeness_v15.safetensors")
185
 
186
 
 
 
187
 
188
 
189
  #GFPGAN Model
@@ -196,12 +215,30 @@ DownLoad(r"https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv
196
  #strt Stable Diffusion Webui
197
  print("Done\nStarting Webui...")
198
  os.chdir(user_home / r"stable-diffusion-webui")
199
- gc.collect()
200
- while True:
201
- ret=subprocess.run([executable ,user_home / r"stable-diffusion-webui" / r"launch.py",r"--precision",r"full",r"--no-half",r"--no-half-vae",r"--enable-insecure-extension-access",r"--medvram",r"--skip-torch-cuda-test",r"--enable-console-prompts",r"--ui-settings-file="+str(pathlib.Path(__file__).parent /r"config.json")])
202
- if(ret.returncode == 0 ):
203
- del ret
204
- gc.collect()
205
- else :
206
- del ret
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  del os ,user_home ,pyexecutable ,subprocess
 
3
  https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.6.0
4
 
5
  """
6
+ commit_id=r"5ef669de080814067961f28357256e8fe27544f4"
7
  import os
8
  from sys import executable
9
  import subprocess
10
  import pathlib
11
  import gc
12
+ import time
13
+ import subprocess
14
 
15
  def Gitclone(URI:str,ClonePath:pathlib.Path ) -> int :
16
  if pathlib.Path.exists(ClonePath):
 
44
  Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui.git",user_home / r"stable-diffusion-webui")
45
  os.chdir(str(user_home / r"stable-diffusion-webui"))
46
  os.system("git reset --hard "+commit_id)
47
+ os.chdir(user_home / r"stable-diffusion-webui")
48
+ Gitclone(r"https://github.com/vorstcavry/ncpt_colab_timer",user_home / r"stable-diffusion-webui" / r"extensions" / r"ncpt_colab_timer")
49
+ Gitclone(r"https://github.com/vorstcavry/static",user_home / r"stable-diffusion-webui" / r"static")
50
+
51
+ def run_echo_command():
52
+ try:
53
+ start_huggingface
54
+ except NameError:
55
+ start_huggingface = int(time.time()) - 5
56
+
57
+ cmd = f"echo -n {start_huggingface} > /home/user/app/stable-diffusion-webui/static/colabTimer.txt"
58
+ subprocess.run(cmd, shell=True)
59
+
60
+ # Contoh pemanggilan fungsi run_echo_command:
61
+ run_echo_command()
62
+ os.chdir(user_home / r"stable-diffusion-webui")
63
  #install extensions
64
  print("installing extensions")
65
+ #Gitclone(r"https://github.com/vorstcavry/embeddings",user_home / r"stable-diffusion-webui" / r"embeddings" / r"negative")
66
  #Gitclone(r"https://github.com/vorstcavry/lora",user_home / r"stable-diffusion-webui" / r"models" / r"Lora" / r"positive")
67
  #Gitclone(r"https://github.com/vorstcavry/Checkpoint-Model",user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion" / r"Checkpoint")
68
 
 
86
  #Gitclone(r"https://github.com/hnmr293/posex",user_home / r"stable-diffusion-webui" / r"extensions" / r"posex")
87
  #Gitclone(r"https://github.com/nonnonstop/sd-webui-3d-open-pose-editor",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-3d-open-pose-editor")
88
  #Gitclone(r"https://github.com/hnmr293/posex",user_home / r"stable-diffusion-webui" / r"extensions" / r"posex")
89
+ Gitclone(r"https://github.com/vorstcavry/sd-webui-cloud-inference",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-cloud-inference")
90
  Gitclone(r"https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git" , user_home / r"stable-diffusion-webui" / r"extensions" / r"a1111-sd-webui-tagcomplete")
91
  #Gitclone(r"https://github.com/camenduru/sd-webui-tunnels",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-tunnels")
92
  Gitclone(r"https://github.com/etherealxx/batchlinks-webui",user_home / r"stable-diffusion-webui" / r"extensions" / r"batchlinks-webui")
 
98
  #Gitclone(r"https://github.com/hnmr293/sd-webui-llul",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-llul")
99
  #Gitclone(r"https://github.com/IDEA-Research/DWPose",user_home / r"stable-diffusion-webui" / r"extensions" / r"DWPose")
100
  #Gitclone(r"https://github.com/Bing-su/adetailer",user_home / r"stable-diffusion-webui" / r"extensions" / r"adetailer")
101
+ Gitclone(r"https://github.com/NoCrypt/sd_hf_out",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd_hf_out")
102
 
 
 
103
  #Gitclone(r"https://github.com/Iyashinouta/sd-model-downloader",user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-model-downloader")
104
  #Gitclone(r"https://github.com/AIrjen/OneButtonPrompt",user_home / r"stable-diffusion-webui" / r"extensions" / r"OneButtonPrompt")
105
  #Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards",user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-wildcards")
 
201
  #DownLoad(r"https://huggingface.co/vorstcavry/loraasia1/resolve/main/taiwanDollLikeness_v15.safetensors",user_home / r"stable-diffusion-webui" / r"models"/ r"lora",r"taiwanDollLikeness_v15.safetensors")
202
 
203
 
204
+ DownLoad(r"https://huggingface.co/vorstcavry/test/resolve/main/SD-A/ui-config.json",user_home / r"stable-diffusion-webui",r"ui-config.json")
205
+ DownLoad(r"https://huggingface.co/vorstcavry/test/resolve/main/SD-A/config.json",user_home / r"stable-diffusion-webui",r"ui-config.json")
206
 
207
 
208
  #GFPGAN Model
 
215
  #strt Stable Diffusion Webui
216
  print("Done\nStarting Webui...")
217
  os.chdir(user_home / r"stable-diffusion-webui")
218
+ import subprocess
219
+ import pathlib
220
+
221
+ user_home = pathlib.Path("/home/user") # Gantilah dengan path yang sesuai
222
+
223
+ args = [
224
+ executable,
225
+ user_home / "stable-diffusion-webui" / "launch.py",
226
+ "--precision", "full",
227
+ "--no-half",
228
+ "--no-half-vae",
229
+ "--enable-insecure-extension-access",
230
+ "--medvram",
231
+ "--skip-torch-cuda-test",
232
+ "--enable-console-prompts",
233
+ "--ui-settings-file=" + str(pathlib.Path(__file__).parent / "config.json"),
234
+ "--hf-token-out",
235
+ "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" # Gantilah dengan token yang sesuai
236
+ ]
237
+
238
+ args = [arg.as_posix() if isinstance(arg, pathlib.PosixPath) else arg for arg in args]
239
+
240
+ try:
241
+ ret = subprocess.run(args)
242
+ except Exception as e:
243
+ print("Error:", e)
244
  del os ,user_home ,pyexecutable ,subprocess