John6666 commited on
Commit
19d21b8
1 Parent(s): 26687c1

Upload 4 files

Browse files

Fix and faster download.

Files changed (4) hide show
  1. app.py +208 -148
  2. packages.txt +1 -2
  3. pre-requirements.txt +1 -0
  4. requirements.txt +39 -38
app.py CHANGED
@@ -1,149 +1,209 @@
1
- import os
2
- from sys import executable as pyexecutable
3
- import subprocess
4
- import pathlib
5
- import gc
6
-
7
- def Gitclone(URI:str,ClonePath:str = "") -> int :
8
- if(ClonePath == "") :
9
- while True:
10
- i=subprocess.run([r"git",r"clone",URI])
11
- if(i.returncode == 0 ):
12
- del i
13
- gc.collect()
14
- return 0
15
- else :
16
- del i
17
- else:
18
- while True:
19
- i=subprocess.run([r"git",r"clone",URI,ClonePath])
20
- if(i.returncode == 0 ):
21
- del i
22
- gc.collect()
23
- return 0
24
- else :
25
- del i
26
- def DownLoad(URI:str,DownloadPath:str,DownLoadFileName:str ) -> int:
27
- while (True):
28
- i=subprocess.run([r"aria2c",r"-c",r"-x" ,r"16", r"-s",r"16", r"-k" ,r"1M" ,r"-m",r"0",r"--enable-mmap=false",r"--console-log-level=error",r"-d",DownloadPath,r"-o",DownLoadFileName,URI]);
29
- if(i.returncode == 0 ):
30
- del i
31
- gc.collect()
32
- return 0
33
- else :
34
- del i
35
- user_home =pathlib.Path.home().resolve()
36
- os.chdir(str(user_home))
37
- #clone stable-diffusion-webui repo
38
- print("cloning stable-diffusion-webui repo")
39
- Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui.git",str(user_home / r"stable-diffusion-webui"))
40
- os.chdir(str(user_home / r"stable-diffusion-webui"))
41
- os.system("git reset --hard 89f9faa63388756314e8a1d96cf86bf5e0663045")
42
- #
43
-
44
- #install extensions
45
- print("installing extensions")
46
- Gitclone(r"https://huggingface.co/embed/negative",str(user_home / r"stable-diffusion-webui" / r"embeddings" / r"negative"))
47
- Gitclone(r"https://huggingface.co/embed/lora",str(user_home / r"stable-diffusion-webui" / r"models" / r"Lora" / r"positive"))
48
- DownLoad(r"https://huggingface.co/embed/upscale/resolve/main/4x-UltraSharp.pth",str(user_home / r"stable-diffusion-webui" / r"models" / r"ESRGAN") ,r"4x-UltraSharp.pth")
49
- while True:
50
- if(subprocess.run([r"wget",r"https://raw.githubusercontent.com/camenduru/stable-diffusion-webui-scripts/main/run_n_times.py",r"-O",str(user_home / r"stable-diffusion-webui" / r"scripts" / r"run_n_times.py")]).returncode == 0):
51
- break
52
- #Gitclone(r"https://github.com/deforum-art/deforum-for-automatic1111-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"deforum-for-automatic1111-webui" ))
53
- #Gitclone(r"https://github.com/BlafKing/sd-civitai-browser-plus",str(user_home / r"stable-diffusion-webui" / r"extensions"/ r"sd-civitai-browser-plus"))
54
- Gitclone(r"https://github.com/camenduru/stable-diffusion-webui-huggingface",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-huggingface"))
55
- #Gitclone(r"https://github.com/bbc-mc/sdweb-merge-board",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sdweb-merge-board"))
56
- Gitclone(r"https://github.com/etherealxx/batchlinks-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"batchlinks-webui"))
57
- Gitclone(r"https://github.com/kohya-ss/sd-webui-additional-networks",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-additional-networks"))
58
- Gitclone(r"https://github.com/Akegarasu/sd-webui-model-converter",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-model-converter"))
59
- Gitclone(r"https://github.com/hako-mikan/sd-webui-supermerger",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-supermerger"))
60
- Gitclone(r"https://github.com/bbc-mc/sdweb-merge-block-weighted-gui",str(user_home / r"stable-diffusion-webui" / r"extensions"/ r"sdweb-merge-block-weighted-gui"))
61
-
62
- #Gitclone(r"https://github.com/Mikubill/sd-webui-controlnet",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-controlnet"))
63
- #Gitclone(r"https://github.com/fkunn1326/openpose-editor",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"openpose-editor"))
64
- Gitclone(r"https://github.com/jexom/sd-webui-depth-lib",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-depth-lib"))
65
- Gitclone(r"https://github.com/hnmr293/posex",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"posex"))
66
- #Gitclone(r"https://github.com/nonnonstop/sd-webui-3d-open-pose-editor",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-3d-open-pose-editor"))
67
- #中文本地化的请解除下一行的注释
68
- #Gitclone(r"https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN.git",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-localization-zh_CN"))
69
- #Gitclone(r"https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git" , str(user_home / r"stable-diffusion-webui" / r"extensions" / r"a1111-sd-webui-tagcomplete"))
70
- Gitclone(r"https://github.com/camenduru/sd-webui-tunnels",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-tunnels"))
71
- #Gitclone(r"https://github.com/etherealxx/batchlinks-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"batchlinks-webui"))
72
- Gitclone(r"https://github.com/catppuccin/stable-diffusion-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-catppuccin"))
73
-
74
- #Gitclone(r"https://github.com/KohakuBueleaf/a1111-sd-webui-locon",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"a1111-sd-webui-locon" ))
75
- #Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-rembg"))
76
- #Gitclone(r"https://github.com/ashen-sensored/stable-diffusion-webui-two-shot",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-two-shot"))
77
- #Gitclone(r"https://github.com/camenduru/sd_webui_stealth_pnginfo",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd_webui_stealth_pnginfo"))
78
-
79
- os.chdir(user_home / r"stable-diffusion-webui")
80
-
81
- #download ControlNet models
82
- print("extensions dolwnload done .\ndownloading ControlNet models")
83
- dList =[r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors",
84
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors",
85
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny_fp16.safetensors",
86
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors",
87
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors",
88
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart_fp16.safetensors",
89
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors",
90
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors",
91
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_openpose_fp16.safetensors",
92
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_scribble_fp16.safetensors",
93
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_seg_fp16.safetensors",
94
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_softedge_fp16.safetensors",
95
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors",
96
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11f1e_sd15_tile_fp16.safetensors",
97
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_ip2p_fp16.yaml",
98
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_shuffle_fp16.yaml",
99
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_canny_fp16.yaml",
100
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1p_sd15_depth_fp16.yaml",
101
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_inpaint_fp16.yaml",
102
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_lineart_fp16.yaml",
103
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_mlsd_fp16.yaml",
104
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_normalbae_fp16.yaml",
105
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_openpose_fp16.yaml",
106
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_scribble_fp16.yaml",
107
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_seg_fp16.yaml",
108
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_softedge_fp16.yaml",
109
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15s2_lineart_anime_fp16.yaml",
110
- r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1e_sd15_tile_fp16.yaml",
111
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_style_sd14v1.pth",
112
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd14v1.pth",
113
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_seg_sd14v1.pth",
114
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_openpose_sd14v1.pth",
115
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_keypose_sd14v1.pth",
116
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd14v1.pth",
117
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd14v1.pth",
118
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd15v2.pth",
119
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd15v2.pth",
120
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd15v2.pth",
121
- r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_zoedepth_sd15v1.pth"]
122
- for i in range(0,len(dList)): DownLoad(dList[i],str(user_home / "stable-diffusion-webui" / "extensions" / "sd-webui-controlnet" / "models"),pathlib.Path(dList[i]).name)
123
- del dList
124
-
125
- #download model
126
- #you can change model download address here
127
- print("ControlNet models download done.\ndownloading model")
128
-
129
- DownLoad(r"https://huggingface.co/Yntec/DucHaitenClassicAnime768/resolve/main/duchaitenclassicanimv10VAE.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"duchaitenclassicanimv10VAE.safetensors")
130
- DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenAIart/resolve/main/DucHaitenAIart-v4.5.3.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenAIart-v4.5.3.safetensors")
131
- DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenDreamWorld/resolve/main/DucHaitenDreamWorld_v3.0.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenDreamWorld_v3.0.safetensors")
132
- DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenJourney/resolve/main/DucHaiten-Journey_v5.6.7.2.3.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaiten-Journey_v5.6.7.2.3.safetensors")
133
- DownLoad(r"https://huggingface.co/DucHaiten/DucHaiten-StyleLikeMe/resolve/main/DucHaiten-StyleLikeMe_v1.5-fp16-no-ema.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaiten-StyleLikeMe_v1.5-fp16-no-ema.safetensors")
134
- DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenSuperCute/resolve/main/DucHaitenSuperCute_v2.0.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenSuperCute_v2.0.safetensors")
135
- DownLoad(r"https://huggingface.co/Yntec/DucHaitenAnime768/resolve/main/DucHaitenAnimefp16noema.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenAnimefp16noema.safetensors")
136
-
137
- #start webui
138
-
139
- print("Done\nStarting Webui...")
140
- os.chdir(user_home / r"stable-diffusion-webui")
141
- while True:
142
- ret=subprocess.run([r"python3" ,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")])
143
- if(ret.returncode == 0 ):
144
- del ret
145
- gc.collect()
146
- else :
147
- del ret
148
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  del os ,user_home ,pyexecutable ,subprocess
 
1
+ import os
2
+ if os.environ.get("SPACES_ZERO_GPU") is not None:
3
+ import spaces
4
+ else:
5
+ class spaces:
6
+ @staticmethod
7
+ def GPU(func):
8
+ def wrapper(*args, **kwargs):
9
+ return func(*args, **kwargs)
10
+ return wrapper
11
+ from sys import executable as pyexecutable
12
+ import subprocess
13
+ import pathlib
14
+ import gc
15
+ from huggingface_hub import hf_hub_download
16
+ import re
17
+ import urllib.parse
18
+
19
+ @spaces.GPU
20
+ def fake_gpu():
21
+ pass
22
+
23
+ def split_hf_url(url: str):
24
+ try:
25
+ s = list(re.findall(r'^(?:https?://huggingface.co/)(?:(datasets)/)?(.+?/.+?)/\w+?/.+?/(?:(.+)/)?(.+?.\w+)(?:\?download=true)?$', url)[0])
26
+ if len(s) < 4: return "", "", "", ""
27
+ repo_id = s[1]
28
+ repo_type = "dataset" if s[0] == "datasets" else "model"
29
+ subfolder = urllib.parse.unquote(s[2]) if s[2] else None
30
+ filename = urllib.parse.unquote(s[3])
31
+ return repo_id, filename, subfolder, repo_type
32
+ except Exception as e:
33
+ print(e)
34
+
35
+ def download_hf_file(directory, url):
36
+ repo_id, filename, subfolder, repo_type = split_hf_url(url)
37
+ try:
38
+ if subfolder is not None: hf_hub_download(repo_id=repo_id, filename=filename, subfolder=subfolder, repo_type=repo_type, local_dir=directory)
39
+ else: hf_hub_download(repo_id=repo_id, filename=filename, repo_type=repo_type, local_dir=directory)
40
+ print(f"Downloading: {url}")
41
+ return True
42
+ except Exception as e:
43
+ print(f"Failed to download: {e}")
44
+ return False
45
+
46
+ def Gitclone(URI:str,ClonePath:str = "",HASH:str = "") -> int :
47
+ if(ClonePath == "") :
48
+ while True:
49
+ try:
50
+ user_home =pathlib.Path.home().resolve()
51
+ os.chdir(str(user_home))
52
+ except Exception:
53
+ pass
54
+ i=subprocess.run([r"git",r"clone",URI])
55
+ try:
56
+ if HASH: os.system(f"git reset --hard {HASH}")
57
+ except Exception:
58
+ pass
59
+ if(i.returncode == 0 ):
60
+ del i
61
+ gc.collect()
62
+ return 0
63
+ else :
64
+ del i
65
+ else:
66
+ while True:
67
+ i=subprocess.run([r"git",r"clone",URI,ClonePath])
68
+ try:
69
+ os.chdir(ClonePath)
70
+ if HASH: os.system(f"git reset --hard {HASH}")
71
+ user_home =pathlib.Path.home().resolve()
72
+ os.chdir(str(user_home))
73
+ except Exception:
74
+ pass
75
+ if(i.returncode == 0 ):
76
+ del i
77
+ gc.collect()
78
+ return 0
79
+ else :
80
+ del i
81
+ def DownLoad(URI:str,DownloadPath:str,DownLoadFileName:str ) -> int:
82
+ while (True):
83
+ if "huggingface.co" in URI:
84
+ success=download_hf_file(DownloadPath, URI)
85
+ if success: return 0
86
+ else:
87
+ i=subprocess.run([r"aria2c",r"-c",r"-x" ,r"16", r"-s",r"16", r"-k" ,r"1M" ,r"-m",r"0",r"--enable-mmap=false",r"--console-log-level=error",r"-d",DownloadPath,r"-o",DownLoadFileName,URI]);
88
+ if(i.returncode == 0 ):
89
+ del i
90
+ gc.collect()
91
+ return 0
92
+ else :
93
+ del i
94
+ user_home =pathlib.Path.home().resolve()
95
+ os.chdir(str(user_home))
96
+ #clone stable-diffusion-webui repo
97
+ print("cloning stable-diffusion-webui repo")
98
+ Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui.git",str(user_home / r"stable-diffusion-webui"))
99
+ #os.chdir(str(user_home / r"stable-diffusion-webui"))
100
+ #os.system("git reset --hard 89f9faa63388756314e8a1d96cf86bf5e0663045")
101
+ #
102
+
103
+ #install extensions
104
+ print("installing extensions")
105
+ Gitclone(r"https://huggingface.co/embed/negative",str(user_home / r"stable-diffusion-webui" / r"embeddings" / r"negative"))
106
+ Gitclone(r"https://huggingface.co/embed/lora",str(user_home / r"stable-diffusion-webui" / r"models" / r"Lora" / r"positive"))
107
+ DownLoad(r"https://huggingface.co/embed/upscale/resolve/main/4x-UltraSharp.pth",str(user_home / r"stable-diffusion-webui" / r"models" / r"ESRGAN") ,r"4x-UltraSharp.pth")
108
+ while True:
109
+ if(subprocess.run([r"wget",r"https://raw.githubusercontent.com/camenduru/stable-diffusion-webui-scripts/main/run_n_times.py",r"-O",str(user_home / r"stable-diffusion-webui" / r"scripts" / r"run_n_times.py")]).returncode == 0):
110
+ break
111
+ #Gitclone(r"https://github.com/deforum-art/deforum-for-automatic1111-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"deforum-for-automatic1111-webui" ))
112
+ #Gitclone(r"https://github.com/BlafKing/sd-civitai-browser-plus",str(user_home / r"stable-diffusion-webui" / r"extensions"/ r"sd-civitai-browser-plus"))
113
+ Gitclone(r"https://github.com/camenduru/stable-diffusion-webui-huggingface",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-huggingface"))
114
+ #Gitclone(r"https://github.com/bbc-mc/sdweb-merge-board",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sdweb-merge-board"))
115
+ Gitclone(r"https://github.com/etherealxx/batchlinks-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"batchlinks-webui"))
116
+ Gitclone(r"https://github.com/kohya-ss/sd-webui-additional-networks",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-additional-networks"))
117
+ Gitclone(r"https://github.com/Akegarasu/sd-webui-model-converter",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-model-converter"))
118
+ #Gitclone(r"https://github.com/hako-mikan/sd-webui-supermerger",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-supermerger"))
119
+ Gitclone(r"https://github.com/tmzint/sd-webui-supermerger",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-supermerger"))
120
+ Gitclone(r"https://github.com/bbc-mc/sdweb-merge-block-weighted-gui",str(user_home / r"stable-diffusion-webui" / r"extensions"/ r"sdweb-merge-block-weighted-gui"))
121
+
122
+ #Gitclone(r"https://github.com/Mikubill/sd-webui-controlnet",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-controlnet"))
123
+ #Gitclone(r"https://github.com/fkunn1326/openpose-editor",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"openpose-editor"))
124
+ Gitclone(r"https://github.com/jexom/sd-webui-depth-lib",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-depth-lib"))
125
+ Gitclone(r"https://github.com/hnmr293/posex",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"posex"))
126
+ #Gitclone(r"https://github.com/nonnonstop/sd-webui-3d-open-pose-editor",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-3d-open-pose-editor"))
127
+ #中文本地化的请解除下一行的注释
128
+ #Gitclone(r"https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN.git",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-localization-zh_CN"))
129
+ #Gitclone(r"https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git" , str(user_home / r"stable-diffusion-webui" / r"extensions" / r"a1111-sd-webui-tagcomplete"))
130
+ Gitclone(r"https://github.com/camenduru/sd-webui-tunnels",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd-webui-tunnels"))
131
+ #Gitclone(r"https://github.com/etherealxx/batchlinks-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"batchlinks-webui"))
132
+ Gitclone(r"https://github.com/catppuccin/stable-diffusion-webui",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-catppuccin"))
133
+
134
+ #Gitclone(r"https://github.com/KohakuBueleaf/a1111-sd-webui-locon",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"a1111-sd-webui-locon" ))
135
+ #Gitclone(r"https://github.com/AUTOMATIC1111/stable-diffusion-webui-rembg",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-rembg"))
136
+ #Gitclone(r"https://github.com/ashen-sensored/stable-diffusion-webui-two-shot",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"stable-diffusion-webui-two-shot"))
137
+ #Gitclone(r"https://github.com/camenduru/sd_webui_stealth_pnginfo",str(user_home / r"stable-diffusion-webui" / r"extensions" / r"sd_webui_stealth_pnginfo"))
138
+
139
+ os.chdir(user_home / r"stable-diffusion-webui")
140
+
141
+ #download ControlNet models
142
+ print("extensions dolwnload done .\ndownloading ControlNet models")
143
+ dList =[r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors",
144
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors",
145
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny_fp16.safetensors",
146
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors",
147
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors",
148
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart_fp16.safetensors",
149
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors",
150
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors",
151
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_openpose_fp16.safetensors",
152
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_scribble_fp16.safetensors",
153
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_seg_fp16.safetensors",
154
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_softedge_fp16.safetensors",
155
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors",
156
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11f1e_sd15_tile_fp16.safetensors",
157
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_ip2p_fp16.yaml",
158
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_shuffle_fp16.yaml",
159
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_canny_fp16.yaml",
160
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1p_sd15_depth_fp16.yaml",
161
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_inpaint_fp16.yaml",
162
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_lineart_fp16.yaml",
163
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_mlsd_fp16.yaml",
164
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_normalbae_fp16.yaml",
165
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_openpose_fp16.yaml",
166
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_scribble_fp16.yaml",
167
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_seg_fp16.yaml",
168
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_softedge_fp16.yaml",
169
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15s2_lineart_anime_fp16.yaml",
170
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1e_sd15_tile_fp16.yaml",
171
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_style_sd14v1.pth",
172
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd14v1.pth",
173
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_seg_sd14v1.pth",
174
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_openpose_sd14v1.pth",
175
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_keypose_sd14v1.pth",
176
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd14v1.pth",
177
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd14v1.pth",
178
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd15v2.pth",
179
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd15v2.pth",
180
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd15v2.pth",
181
+ r"https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_zoedepth_sd15v1.pth"]
182
+ for i in range(0,len(dList)): DownLoad(dList[i],str(user_home / "stable-diffusion-webui" / "extensions" / "sd-webui-controlnet" / "models"),pathlib.Path(dList[i]).name)
183
+ del dList
184
+
185
+ #download model
186
+ #you can change model download address here
187
+ print("ControlNet models download done.\ndownloading model")
188
+
189
+ DownLoad(r"https://huggingface.co/Yntec/DucHaitenClassicAnime768/resolve/main/duchaitenclassicanimv10VAE.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"duchaitenclassicanimv10VAE.safetensors")
190
+ DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenAIart/resolve/main/DucHaitenAIart-v4.5.3.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenAIart-v4.5.3.safetensors")
191
+ DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenDreamWorld/resolve/main/DucHaitenDreamWorld_v3.0.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenDreamWorld_v3.0.safetensors")
192
+ DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenJourney/resolve/main/DucHaiten-Journey_v5.6.7.2.3.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaiten-Journey_v5.6.7.2.3.safetensors")
193
+ DownLoad(r"https://huggingface.co/DucHaiten/DucHaiten-StyleLikeMe/resolve/main/DucHaiten-StyleLikeMe_v1.5-fp16-no-ema.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaiten-StyleLikeMe_v1.5-fp16-no-ema.safetensors")
194
+ DownLoad(r"https://huggingface.co/DucHaiten/DucHaitenSuperCute/resolve/main/DucHaitenSuperCute_v2.0.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenSuperCute_v2.0.safetensors")
195
+ DownLoad(r"https://huggingface.co/Yntec/DucHaitenAnime768/resolve/main/DucHaitenAnimefp16noema.safetensors",str(user_home / r"stable-diffusion-webui" / r"models" / r"Stable-diffusion"),r"DucHaitenAnimefp16noema.safetensors")
196
+
197
+ #start webui
198
+
199
+ print("Done\nStarting Webui...")
200
+ os.chdir(user_home / r"stable-diffusion-webui")
201
+ while True:
202
+ ret=subprocess.run([r"python3" ,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")])
203
+ if(ret.returncode == 0 ):
204
+ del ret
205
+ gc.collect()
206
+ else :
207
+ del ret
208
+
209
  del os ,user_home ,pyexecutable ,subprocess
packages.txt CHANGED
@@ -1,2 +1 @@
1
- aria2
2
- wget
 
1
+ aria2 wget
 
pre-requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ pip>=24.1
requirements.txt CHANGED
@@ -1,38 +1,39 @@
1
- torch
2
- torchvision==0.16.0
3
- torchaudio
4
- torchtext
5
- torchdata
6
- astunparse
7
- blendmodes
8
- accelerate
9
- basicsr
10
- fonts
11
- font-roboto
12
- gfpgan
13
- gradio==3.29.0
14
- numpy
15
- omegaconf
16
- opencv-contrib-python
17
- requests
18
- piexif
19
- Pillow
20
- pytorch_lightning==1.7.7
21
- realesrgan
22
- scikit-image>=0.19
23
- timm==0.4.12
24
- transformers==4.25.1
25
- einops
26
- jsonmerge
27
- clean-fid
28
- resize-right
29
- torchdiffeq
30
- kornia
31
- lark
32
- inflection
33
- GitPython
34
- torchsde
35
- safetensors
36
- psutil
37
- rich
38
- httpx==0.24.1
 
 
1
+ spaces
2
+ torch
3
+ torchvision>=0.16.0
4
+ torchaudio
5
+ torchtext
6
+ torchdata
7
+ astunparse
8
+ blendmodes
9
+ accelerate
10
+ git+https://github.com/XPixelGroup/BasicSR
11
+ git+https://github.com/TencentARC/GFPGAN
12
+ fonts
13
+ font-roboto
14
+ gradio==3.29.0
15
+ numpy
16
+ omegaconf
17
+ opencv-contrib-python
18
+ requests
19
+ piexif
20
+ Pillow
21
+ pytorch_lightning>=1.7.7
22
+ realesrgan
23
+ scikit-image>=0.19
24
+ timm>=0.4.12
25
+ transformers>=4.25.1
26
+ einops
27
+ jsonmerge
28
+ clean-fid
29
+ resize-right
30
+ torchdiffeq
31
+ kornia
32
+ lark
33
+ inflection
34
+ GitPython
35
+ git+https://github.com/google-research/torchsde
36
+ safetensors
37
+ psutil
38
+ rich
39
+ httpx>=0.24.1