Carlos2312 commited on
Commit
b380049
·
verified ·
1 Parent(s): 3d97f09

Update setup_forge.py

Browse files
Files changed (1) hide show
  1. setup_forge.py +18 -4
setup_forge.py CHANGED
@@ -5,6 +5,7 @@ from pathlib import Path
5
  import subprocess, time, os, shlex
6
  from nenen88 import pull, say, download, clone, tempe
7
 
 
8
  xxx = "/home/studio-lab-user"
9
  zzz = Path(xxx) / "forge"
10
 
@@ -16,19 +17,20 @@ if zzz.exists():
16
 
17
  get_ipython().system("git pull origin master")
18
  get_ipython().system("git fetch --tags")
19
-
20
  else:
21
  mama = f"{xxx}/.conda/setup.css"
22
  fff = {"stdout": subprocess.DEVNULL, "stderr": subprocess.DEVNULL}
 
23
  get_ipython().system(f"rm -rf {xxx}/.zrok")
24
  get_ipython().system(f"curl -sLo {mama} https://github.com/gutris1/segsmaker/raw/main/ui/sd/asd/setup.css")
25
-
26
  gariz = """<div class="gradient-text">asd</div>"""
27
  garis = widgets.Output()
28
  b1 = widgets.Button(description='SD 1.5')
29
  b2 = widgets.Button(description='SDXL')
30
  ikuuuhhh = widgets.Button(description='Install')
31
-
32
  b1b2 = widgets.HBox([b1, b2], layout=Layout(justify_content='space-between'))
33
  sd_setup = widgets.Output()
34
  boxxx = widgets.VBox([b1b2, ikuuuhhh], layout=Layout(
@@ -46,12 +48,14 @@ else:
46
  boxxx.add_class("boxxx")
47
  selected = [None]
48
 
 
49
  def ccss(mama):
50
  with open(mama, "r") as gantung:
51
  susu = gantung.read()
52
 
53
  display(HTML(f"<style>{susu}</style>"))
54
 
 
55
  def req_list(xxx, zzz):
56
  return [
57
  f"pip install -q -r requirements.txt basicsr insightface onnxruntime-gpu",
@@ -63,7 +67,9 @@ else:
63
  f"ln -vs /tmp/lora {zzz}/models/Lora/tmp_lora",
64
  f"ln -vs /tmp/z123 {zzz}/models/z123",
65
  f"ln -vs /tmp/svd {zzz}/models/svd",
66
- f"ln -vs /tmp/controlnet {zzz}/models/ControlNet"]
 
 
67
 
68
  def sd_clone(xxx, zzz, fff):
69
  time.sleep(1)
@@ -75,10 +81,17 @@ else:
75
  subprocess.run(shlex.split(lines), **fff)
76
 
77
 
 
 
 
 
 
 
78
  def sd_1_5(xxx, zzz, fff):
79
  sd_clone(xxx, zzz, fff)
80
 
81
  extras = [
 
82
  f"https://civitai.com/api/download/models/150491 {zzz}/embeddings edgQuality.pt",
83
  f"https://huggingface.co/pantat88/ui/resolve/main/4x-UltraSharp.pth {zzz}/models/ESRGAN",
84
  f"https://huggingface.co/pantat88/ui/resolve/main/4x-AnimeSharp.pth {zzz}/models/ESRGAN",
@@ -94,6 +107,7 @@ else:
94
 
95
  for items in extras:
96
  download(items)
 
97
  get_ipython().system(f"curl -sLo {zzz}/asd/modelos.py https://huggingface.co/Carlos2312/asd/resolve/main/modelos.py")
98
  get_ipython().system(f"rm -rf {zzz}/asd/extension.txt")
99
 
 
5
  import subprocess, time, os, shlex
6
  from nenen88 import pull, say, download, clone, tempe
7
 
8
+
9
  xxx = "/home/studio-lab-user"
10
  zzz = Path(xxx) / "forge"
11
 
 
17
 
18
  get_ipython().system("git pull origin master")
19
  get_ipython().system("git fetch --tags")
20
+
21
  else:
22
  mama = f"{xxx}/.conda/setup.css"
23
  fff = {"stdout": subprocess.DEVNULL, "stderr": subprocess.DEVNULL}
24
+
25
  get_ipython().system(f"rm -rf {xxx}/.zrok")
26
  get_ipython().system(f"curl -sLo {mama} https://github.com/gutris1/segsmaker/raw/main/ui/sd/asd/setup.css")
27
+
28
  gariz = """<div class="gradient-text">asd</div>"""
29
  garis = widgets.Output()
30
  b1 = widgets.Button(description='SD 1.5')
31
  b2 = widgets.Button(description='SDXL')
32
  ikuuuhhh = widgets.Button(description='Install')
33
+
34
  b1b2 = widgets.HBox([b1, b2], layout=Layout(justify_content='space-between'))
35
  sd_setup = widgets.Output()
36
  boxxx = widgets.VBox([b1b2, ikuuuhhh], layout=Layout(
 
48
  boxxx.add_class("boxxx")
49
  selected = [None]
50
 
51
+
52
  def ccss(mama):
53
  with open(mama, "r") as gantung:
54
  susu = gantung.read()
55
 
56
  display(HTML(f"<style>{susu}</style>"))
57
 
58
+
59
  def req_list(xxx, zzz):
60
  return [
61
  f"pip install -q -r requirements.txt basicsr insightface onnxruntime-gpu",
 
67
  f"ln -vs /tmp/lora {zzz}/models/Lora/tmp_lora",
68
  f"ln -vs /tmp/z123 {zzz}/models/z123",
69
  f"ln -vs /tmp/svd {zzz}/models/svd",
70
+ f"ln -vs /tmp/controlnet {zzz}/models/ControlNet"
71
+ ]
72
+
73
 
74
  def sd_clone(xxx, zzz, fff):
75
  time.sleep(1)
 
81
  subprocess.run(shlex.split(lines), **fff)
82
 
83
 
84
+ def ext(zzz):
85
+ say("<br><b>【{red} Installing Extensions{d} 】{red}</b>")
86
+ os.chdir(f"{zzz}/extensions")
87
+ clone(f"{zzz}/asd/extension.txt")
88
+
89
+
90
  def sd_1_5(xxx, zzz, fff):
91
  sd_clone(xxx, zzz, fff)
92
 
93
  extras = [
94
+ f"https://huggingface.co/pantat88/ui/resolve/main/embeddings.zip {zzz}",
95
  f"https://civitai.com/api/download/models/150491 {zzz}/embeddings edgQuality.pt",
96
  f"https://huggingface.co/pantat88/ui/resolve/main/4x-UltraSharp.pth {zzz}/models/ESRGAN",
97
  f"https://huggingface.co/pantat88/ui/resolve/main/4x-AnimeSharp.pth {zzz}/models/ESRGAN",
 
107
 
108
  for items in extras:
109
  download(items)
110
+
111
  get_ipython().system(f"curl -sLo {zzz}/asd/modelos.py https://huggingface.co/Carlos2312/asd/resolve/main/modelos.py")
112
  get_ipython().system(f"rm -rf {zzz}/asd/extension.txt")
113