Update launch.py
Browse files
launch.py
CHANGED
|
@@ -1,599 +1,72 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
(
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
b = ""
|
| 74 |
-
c = ""
|
| 75 |
-
d = ""
|
| 76 |
-
D = ""
|
| 77 |
-
w = ""
|
| 78 |
-
st = ""
|
| 79 |
-
ca = ""
|
| 80 |
-
t = ""
|
| 81 |
-
CS_download1 = CS_download2 = CS_download3 = CS_download4 = CS_download5 = CS_download6 = CS_download7 = CS_download8 = CS_download9 = CS_download10 = CS_download11 = CS_download12 = CS_download13 = False
|
| 82 |
-
|
| 83 |
-
CS_url1 = CS_url2 = CS_url3 = CS_url4 = CS_url5 = CS_url6 = CS_url7 = CS_url8 = CS_url9 = CS_url10 = CS_url11 = CS_url12 = CS_url13 = ""
|
| 84 |
-
|
| 85 |
-
CS_filename1 = CS_filename2 = CS_filename3 = CS_filename4 = CS_filename5 = CS_filename6 = CS_filename7 = CS_filename8 = CS_filename9 = CS_filename10 = CS_filename11 = CS_filename12 = CS_filename13 = ""
|
| 86 |
-
|
| 87 |
-
Lora_download1 = Lora_download2 = Lora_download3 = Lora_download4 = Lora_download5 = Lora_download6 = False
|
| 88 |
-
|
| 89 |
-
Lora_url1 = Lora_url2 = Lora_url3 = Lora_url4 = Lora_url5 = Lora_url6 = ""
|
| 90 |
-
|
| 91 |
-
Lora_filename1 = Lora_filename2 = Lora_filename3 = Lora_filename4 = Lora_filename5 = Lora_filename6 = ""
|
| 92 |
-
|
| 93 |
-
VAE_download1 = VAE_download2 = VAE_download3 = VAE_download4 = VAE_download5 = VAE_download6 = VAE_download7 = VAE_download8 = VAE_download9 = VAE_download10 = VAE_download11 = VAE_download12 = VAE_download13 = False
|
| 94 |
-
|
| 95 |
-
VAE_url1 = VAE_url2 = VAE_url3 = VAE_url4 = VAE_url5 = VAE_url6 = VAE_url7 = VAE_url8 = VAE_url9 = VAE_url10 = VAE_url11 = VAE_url12 = VAE_url13 = ""
|
| 96 |
-
|
| 97 |
-
VAE_filename1 = VAE_filename2 = VAE_filename3 = VAE_filename4 = VAE_filename5 = VAE_filename6 = VAE_filename7 = VAE_filename8 = VAE_filename9 = VAE_filename10 = VAE_filename11 = VAE_filename12 = VAE_filename13 = ""
|
| 98 |
-
|
| 99 |
-
embeddings_download1 = embeddings_download2 = embeddings_download3 = embeddings_download4 = embeddings_download5 = False
|
| 100 |
-
|
| 101 |
-
embeddings_url1 = embeddings_url2 = embeddings_url3 = embeddings_url4 = embeddings_url5 = ""
|
| 102 |
-
|
| 103 |
-
embeddings_filename1 = embeddings_filename2 = embeddings_filename3 = embeddings_filename4 = embeddings_filename5 = ""
|
| 104 |
-
|
| 105 |
-
# 打开并执行txt文件
|
| 106 |
-
with open('BianLiang.txt', 'r') as file:
|
| 107 |
-
code = file.read()
|
| 108 |
-
|
| 109 |
-
# 去除每行开头和结尾的空格、空行等
|
| 110 |
-
cleaned_code = '\n'.join(line.strip() for line in code.splitlines() if line.strip())
|
| 111 |
-
|
| 112 |
-
# 执行干净的代码
|
| 113 |
-
exec(cleaned_code)
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
# 安装插件
|
| 117 |
-
print ("开始安装插件...")
|
| 118 |
-
|
| 119 |
-
# 使用subprocess运行git clone命令
|
| 120 |
-
def run_git_clone(repo_url, destination):
|
| 121 |
-
subprocess.run(["git", "clone", repo_url, destination])
|
| 122 |
-
|
| 123 |
-
extensions_path = "/root/main/extensions"
|
| 124 |
-
|
| 125 |
-
extensions_to_clone = [
|
| 126 |
-
(f"https://github.com/deforum-art/deforum-for-automatic1111-{w}", f"{extensions_path}/deforum-for-automatic1111-{w}"),
|
| 127 |
-
(f"https://github.com/deforum-art/sd-{w}-deforum", f"{extensions_path}/sd-{w}-deforum"),
|
| 128 |
-
(f"https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper", f"{extensions_path}/Stable-Diffusion-Webui-Civitai-Helper"),
|
| 129 |
-
(f"https://github.com/Mikubill/{c}-{w}-controlnet", f"{extensions_path}/{c}-{w}-controlnet"),
|
| 130 |
-
(f"https://github.com/fkunn1326/openpose-editor", f"{extensions_path}/openpose-editor"),
|
| 131 |
-
(f"https://github.com/{ca}/{a}-{d}-{w}-huggingface", f"{extensions_path}/{a}-{d}-{w}-huggingface"),
|
| 132 |
-
(f"https://github.com/kohya-ss/{c}-{w}-additional-networks", f"{extensions_path}/{c}-{w}-additional-networks"),
|
| 133 |
-
(f"https://github.com/hnmr293/posex", f"{extensions_path}/posex"),
|
| 134 |
-
(f"https://github.com/nonnonstop/{c}-{w}-3d-open-pose-editor", f"{extensions_path}/{c}-{w}-3d-open-pose-editor"),
|
| 135 |
-
(f"https://github.com/{ca}/{c}-{w}-tunnels", f"{extensions_path}/{c}-{w}-tunnels"),
|
| 136 |
-
(f"https://github.com/etherealxx/batchlinks-{w}", f"{extensions_path}/batchlinks-{w}"),
|
| 137 |
-
(f"https://github.com/catppuccin/{a}-{d}-{w}", f"{extensions_path}/{a}-{d}-{w}-catppuccin"),
|
| 138 |
-
(f"https://github.com/AUTOMATIC1111/{a}-{d}-{w}-rembg", f"{extensions_path}/{a}-{d}-{w}-rembg"),
|
| 139 |
-
(f"https://github.com/ashen-sensored/{a}-{d}-{w}-two-shot.git", f"{extensions_path}/{a}-{d}-{w}-two-shot"),
|
| 140 |
-
(f"https://github.com/thomasasfk/{c}-{w}-aspect-ratio-helper", f"{extensions_path}/{c}-{w}-aspect-ratio-helper"),
|
| 141 |
-
(f"https://github.com/Bing-su/adetailer", f"{extensions_path}/adetailer"),
|
| 142 |
-
(f"https://github.com/mcmonkeyprojects/sd-dynamic-thresholding", f"{extensions_path}/{c}-dynamic-thresholding"),
|
| 143 |
-
(f"https://github.com/adieyal/{c}-dynamic-prompts", f"{extensions_path}/{c}-dynamic-prompts"),
|
| 144 |
-
(f"https://github.com/AUTOMATIC1111/{a}-{d}-{w}-wildcards", f"{extensions_path}/{a}-{d}-{w}-wildcards"),
|
| 145 |
-
(f"https://github.com/continue-revolution/{c}-{w}-segment-anything", f"{extensions_path}/{c}-{w}-segment-anything"),
|
| 146 |
-
(f"https://github.com/pkuliyi2015/multi{d}-upscaler-for-automatic1111.git", f"{extensions_path}/multi{d}-upscaler-for-automatic1111"),
|
| 147 |
-
(f"https://github.com/Physton/{c}-{w}-prompt-all-in-one", f"{extensions_path}/{c}-{w}-prompt-all-in-one"),
|
| 148 |
-
(f"https://github.com/journey-ad/{c}-{w}-bilingual-localization", f"{extensions_path}/{c}-{w}-bilingual-localization"),
|
| 149 |
-
(f"https://github.com/Bobo-1125/{c}-{w}-oldsix-prompt-dynamic", f"{extensions_path}/{c}-{w}-oldsix-prompt-dynamic"),
|
| 150 |
-
(f"https://github.com/dtlnor/{st}-localization-zh_CN", f"{extensions_path}/{st}-localization-zh_CN-main"),
|
| 151 |
-
(f"https://github.com/zanllp/sd-{w}-infinite-image-browsing", f"{extensions_path}/sd-{w}-infinite-image-browsing"),
|
| 152 |
-
(f"https://github.com/s0md3v/roop", f"{extensions_path}/roop"),
|
| 153 |
-
]
|
| 154 |
-
|
| 155 |
-
for repo_url, destination in extensions_to_clone:
|
| 156 |
-
run_git_clone(repo_url, destination)
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
# 定义一个函数来运行wget命令
|
| 160 |
-
def run_wget(url, output_path):
|
| 161 |
-
wget_command = ["wget", url, "-O", output_path]
|
| 162 |
-
subprocess.run(wget_command, check=True)
|
| 163 |
-
|
| 164 |
-
# 定义一个函数来创建文件夹(如果不存在的话)
|
| 165 |
-
def create_directory(directory):
|
| 166 |
-
mkdir_command = ["mkdir", "-p", directory]
|
| 167 |
-
subprocess.run(mkdir_command, check=True)
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
# 安装可选模块
|
| 171 |
-
print ("安装可选模块...")
|
| 172 |
-
|
| 173 |
-
# 其它基本配置
|
| 174 |
-
CONTROLNET_ = True
|
| 175 |
-
T2I_ = True
|
| 176 |
-
|
| 177 |
-
# CN
|
| 178 |
-
if CONTROLNET_:
|
| 179 |
-
os.makedirs('/root/main/extensions/control/models', exist_ok=True)
|
| 180 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors', '/root/main/extensions/control/models/control_v11e_sd15_ip2p_fp16.safetensors')
|
| 181 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors', '/root/main/extensions/control/models/control_v11e_sd15_shuffle_fp16.safetensors')
|
| 182 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_canny_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_canny_fp16.safetensors')
|
| 183 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors', '/root/main/extensions/control/models/control_v11f1p_sd15_depth_fp16.safetensors')
|
| 184 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_inpaint_fp16.safetensors')
|
| 185 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_lineart_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_lineart_fp16.safetensors')
|
| 186 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_mlsd_fp16.safetensors')
|
| 187 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_normalbae_fp16.safetensors')
|
| 188 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_openpose_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_openpose_fp16.safetensors')
|
| 189 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_scribble_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_scribble_fp16.safetensors')
|
| 190 |
-
#wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_seg_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_seg_fp16.safetensors')
|
| 191 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15_softedge_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15_softedge_fp16.safetensors')
|
| 192 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors', '/root/main/extensions/control/models/control_v11p_sd15s2_lineart_anime_fp16.safetensors')
|
| 193 |
-
#wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_tile_fp16.yaml', '/root/main/extensions/control/models/control_v11e_sd15_tile_fp16.yaml')
|
| 194 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_ip2p_fp16.yaml', '/root/main/extensions/control/models/control_v11e_sd15_ip2p_fp16.yaml')
|
| 195 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11e_sd15_shuffle_fp16.yaml', '/root/main/extensions/control/models/control_v11e_sd15_shuffle_fp16.yaml')
|
| 196 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_canny_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_canny_fp16.yaml')
|
| 197 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1p_sd15_depth_fp16.yaml', '/root/main/extensions/control/models/control_v11f1p_sd15_depth_fp16.yaml')
|
| 198 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_inpaint_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_inpaint_fp16.yaml')
|
| 199 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_lineart_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_lineart_fp16.yaml')
|
| 200 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_mlsd_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_mlsd_fp16.yaml')
|
| 201 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_normalbae_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_normalbae_fp16.yaml')
|
| 202 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_openpose_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_openpose_fp16.yaml')
|
| 203 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_scribble_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_scribble_fp16.yaml')
|
| 204 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_seg_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_seg_fp16.yaml')
|
| 205 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15_softedge_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15_softedge_fp16.yaml')
|
| 206 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11p_sd15s2_lineart_anime_fp16.yaml', '/root/main/extensions/control/models/control_v11p_sd15s2_lineart_anime_fp16.yaml')
|
| 207 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1e_sd15_tile_fp16.yaml', '/root/main/extensions/control/models')
|
| 208 |
-
|
| 209 |
-
# T2I
|
| 210 |
-
if T2I_:
|
| 211 |
-
os.makedirs('/root/main/extensions/control/models', exist_ok=True)
|
| 212 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_style_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_style_sd14v1.pth')
|
| 213 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_sketch_sd14v1.pth')
|
| 214 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_seg_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_seg_sd14v1.pth')
|
| 215 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_openpose_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_openpose_sd14v1.pth')
|
| 216 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_keypose_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_keypose_sd14v1.pth')
|
| 217 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_depth_sd14v1.pth')
|
| 218 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_color_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_color_sd14v1.pth')
|
| 219 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_canny_sd14v1.pth')
|
| 220 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd15v2.pth', '/root/main/extensions/control/models/t2iadapter_canny_sd15v2.pth')
|
| 221 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd15v2.pth', '/root/main/extensions/control/models/t2iadapter_depth_sd15v2.pth')
|
| 222 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd15v2.pth', '/root/main/extensions/control/models/t2iadapter_sketch_sd15v2.pth')
|
| 223 |
-
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_zoedepth_sd15v1.pth', '/root/main/extensions/control/models/t2iadapter_zoedepth_sd15v1.pth')
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
"""# 模型下载"""
|
| 229 |
-
|
| 230 |
-
print ("开始下载Checkpoints/safetensors等大模型")
|
| 231 |
-
# Checkpoints/safetensors等大模型下载
|
| 232 |
-
# 下载任务1
|
| 233 |
-
CS_destination_folder1 = f"/root/main/models/Stable-diffusion"
|
| 234 |
-
CS_target1 = f"{CS_destination_folder1}/{CS_filename1}"
|
| 235 |
-
|
| 236 |
-
if CS_download1:
|
| 237 |
-
os.makedirs(CS_destination_folder1, exist_ok=True)
|
| 238 |
-
response = requests.get(CS_url1)
|
| 239 |
-
with open(CS_target1, 'wb') as f:
|
| 240 |
-
f.write(response.content)
|
| 241 |
-
|
| 242 |
-
# 下载任务2
|
| 243 |
-
CS_destination_folder2 = f"/root/main/models/Stable-diffusion"
|
| 244 |
-
CS_target2 = f"{CS_destination_folder2}/{CS_filename2}"
|
| 245 |
-
|
| 246 |
-
if CS_download2:
|
| 247 |
-
os.makedirs(CS_destination_folder2, exist_ok=True)
|
| 248 |
-
response = requests.get(CS_url2)
|
| 249 |
-
with open(CS_target2, 'wb') as f:
|
| 250 |
-
f.write(response.content)
|
| 251 |
-
|
| 252 |
-
# 下载任务3
|
| 253 |
-
CS_destination_folder3 = f"/root/main/models/Stable-diffusion"
|
| 254 |
-
CS_target3 = f"{CS_destination_folder3}/{CS_filename3}"
|
| 255 |
-
|
| 256 |
-
if CS_download3:
|
| 257 |
-
os.makedirs(CS_destination_folder3, exist_ok=True)
|
| 258 |
-
response = requests.get(CS_url3)
|
| 259 |
-
with open(CS_target3, 'wb') as f:
|
| 260 |
-
f.write(response.content)
|
| 261 |
-
|
| 262 |
-
# 下载任务4
|
| 263 |
-
CS_destination_folder4 = f"/root/main/models/Stable-diffusion"
|
| 264 |
-
CS_target4 = f"{CS_destination_folder4}/{CS_filename4}"
|
| 265 |
-
|
| 266 |
-
if CS_download4:
|
| 267 |
-
os.makedirs(CS_destination_folder4, exist_ok=True)
|
| 268 |
-
response = requests.get(CS_url4)
|
| 269 |
-
with open(CS_target4, 'wb') as f:
|
| 270 |
-
f.write(response.content)
|
| 271 |
-
|
| 272 |
-
# 下载任务5
|
| 273 |
-
CS_destination_folder5 = f"/root/main/models/Stable-diffusion"
|
| 274 |
-
CS_target5 = f"{CS_destination_folder5}/{CS_filename5}"
|
| 275 |
-
|
| 276 |
-
if CS_download5:
|
| 277 |
-
os.makedirs(CS_destination_folder5, exist_ok=True)
|
| 278 |
-
response = requests.get(CS_url5)
|
| 279 |
-
with open(CS_target5, 'wb') as f:
|
| 280 |
-
f.write(response.content)
|
| 281 |
-
|
| 282 |
-
# 下载任务6
|
| 283 |
-
CS_destination_folder6 = f"/root/main/models/Stable-diffusion"
|
| 284 |
-
CS_target6 = f"{CS_destination_folder6}/{CS_filename6}"
|
| 285 |
-
|
| 286 |
-
if CS_download6:
|
| 287 |
-
os.makedirs(CS_destination_folder6, exist_ok=True)
|
| 288 |
-
response = requests.get(CS_url6)
|
| 289 |
-
with open(CS_target6, 'wb') as f:
|
| 290 |
-
f.write(response.content)
|
| 291 |
-
|
| 292 |
-
# 下载任务7
|
| 293 |
-
CS_destination_folder7 = f"/root/main/models/Stable-diffusion"
|
| 294 |
-
CS_target7 = f"{CS_destination_folder7}/{CS_filename7}"
|
| 295 |
-
|
| 296 |
-
if CS_download7:
|
| 297 |
-
os.makedirs(CS_destination_folder7, exist_ok=True)
|
| 298 |
-
response = requests.get(CS_url7)
|
| 299 |
-
with open(CS_target7, 'wb') as f:
|
| 300 |
-
f.write(response.content)
|
| 301 |
-
|
| 302 |
-
# 下载任务8
|
| 303 |
-
CS_destination_folder8 = f"/root/main/models/Stable-diffusion"
|
| 304 |
-
CS_target8 = f"{CS_destination_folder8}/{CS_filename8}"
|
| 305 |
-
|
| 306 |
-
if CS_download8:
|
| 307 |
-
os.makedirs(CS_destination_folder8, exist_ok=True)
|
| 308 |
-
response = requests.get(CS_url8)
|
| 309 |
-
with open(CS_target8, 'wb') as f:
|
| 310 |
-
f.write(response.content)
|
| 311 |
-
|
| 312 |
-
# 下载任务9
|
| 313 |
-
CS_destination_folder9 = f"/root/main/models/Stable-diffusion"
|
| 314 |
-
CS_target9 = f"{CS_destination_folder9}/{CS_filename9}"
|
| 315 |
-
|
| 316 |
-
if CS_download9:
|
| 317 |
-
os.makedirs(CS_destination_folder9, exist_ok=True)
|
| 318 |
-
response = requests.get(CS_url9)
|
| 319 |
-
with open(CS_target9, 'wb') as f:
|
| 320 |
-
f.write(response.content)
|
| 321 |
-
|
| 322 |
-
# 下载任务10
|
| 323 |
-
CS_destination_folder10 = f"/root/main/models/Stable-diffusion"
|
| 324 |
-
CS_target10 = f"{CS_destination_folder10}/{CS_filename10}"
|
| 325 |
-
|
| 326 |
-
if CS_download10:
|
| 327 |
-
os.makedirs(CS_destination_folder10, exist_ok=True)
|
| 328 |
-
response = requests.get(CS_url10)
|
| 329 |
-
with open(CS_target10, 'wb') as f:
|
| 330 |
-
f.write(response.content)
|
| 331 |
-
|
| 332 |
-
# 下载任务11
|
| 333 |
-
CS_destination_folder11 = f"/root/main/models/Stable-diffusion"
|
| 334 |
-
CS_target11 = f"{CS_destination_folder11}/{CS_filename11}"
|
| 335 |
-
|
| 336 |
-
if CS_download11:
|
| 337 |
-
os.makedirs(CS_destination_folder11, exist_ok=True)
|
| 338 |
-
response = requests.get(CS_url11)
|
| 339 |
-
with open(CS_target11, 'wb') as f:
|
| 340 |
-
f.write(response.content)
|
| 341 |
-
|
| 342 |
-
# 下载任务12
|
| 343 |
-
CS_destination_folder12 = f"/root/main/models/Stable-diffusion"
|
| 344 |
-
CS_target12 = f"{CS_destination_folder12}/{CS_filename12}"
|
| 345 |
-
|
| 346 |
-
if CS_download12:
|
| 347 |
-
os.makedirs(CS_destination_folder12, exist_ok=True)
|
| 348 |
-
response = requests.get(CS_url12)
|
| 349 |
-
with open(CS_target12, 'wb') as f:
|
| 350 |
-
f.write(response.content)
|
| 351 |
-
|
| 352 |
-
# 下载任务13
|
| 353 |
-
CS_destination_folder13 = f"/root/main/models/Stable-diffusion"
|
| 354 |
-
CS_target13 = f"{CS_destination_folder13}/{CS_filename13}"
|
| 355 |
-
|
| 356 |
-
if CS_download13:
|
| 357 |
-
os.makedirs(CS_destination_folder13, exist_ok=True)
|
| 358 |
-
response = requests.get(CS_url13)
|
| 359 |
-
with open(CS_target13, 'wb') as f:
|
| 360 |
-
f.write(response.content)
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
#Lora模型下载
|
| 364 |
-
|
| 365 |
-
print("开始下载Lora模型")
|
| 366 |
-
# Lora任务1
|
| 367 |
-
Lora_destination_folder1 = "/root/main/models/Lora"
|
| 368 |
-
Lora_target1 = os.path.join(Lora_destination_folder1, Lora_filename1)
|
| 369 |
-
|
| 370 |
-
if Lora_download1:
|
| 371 |
-
response = requests.get(Lora_url1)
|
| 372 |
-
if response.status_code == 200:
|
| 373 |
-
with open(Lora_target1, 'wb') as f:
|
| 374 |
-
f.write(response.content)
|
| 375 |
-
|
| 376 |
-
# Lora任务2
|
| 377 |
-
Lora_destination_folder2 = "/root/main/models/Lora"
|
| 378 |
-
Lora_target2 = os.path.join(Lora_destination_folder2, Lora_filename2)
|
| 379 |
-
|
| 380 |
-
if Lora_download2:
|
| 381 |
-
response = requests.get(Lora_url2)
|
| 382 |
-
if response.status_code == 200:
|
| 383 |
-
with open(Lora_target2, 'wb') as f:
|
| 384 |
-
f.write(response.content)
|
| 385 |
-
|
| 386 |
-
# Lora任务3
|
| 387 |
-
Lora_destination_folder3 = "/root/main/models/Lora"
|
| 388 |
-
Lora_target3 = os.path.join(Lora_destination_folder3, Lora_filename3)
|
| 389 |
-
|
| 390 |
-
if Lora_download3:
|
| 391 |
-
response = requests.get(Lora_url3)
|
| 392 |
-
if response.status_code == 200:
|
| 393 |
-
with open(Lora_target3, 'wb') as f:
|
| 394 |
-
f.write(response.content)
|
| 395 |
-
|
| 396 |
-
# Lora任务4
|
| 397 |
-
Lora_destination_folder4 = Lora_destination_folder3
|
| 398 |
-
Lora_target4 = os.path.join(Lora_destination_folder4, Lora_filename4)
|
| 399 |
-
|
| 400 |
-
if Lora_download4:
|
| 401 |
-
response = requests.get(Lora_url4)
|
| 402 |
-
if response.status_code == 200:
|
| 403 |
-
with open(Lora_target4, 'wb') as f:
|
| 404 |
-
f.write(response.content)
|
| 405 |
-
|
| 406 |
-
# Lora任务5
|
| 407 |
-
Lora_destination_folder5 = Lora_destination_folder3
|
| 408 |
-
Lora_target5 = os.path.join(Lora_destination_folder5, Lora_filename5)
|
| 409 |
-
|
| 410 |
-
if Lora_download5:
|
| 411 |
-
response = requests.get(Lora_url5)
|
| 412 |
-
if response.status_code == 200:
|
| 413 |
-
with open(Lora_target5, 'wb') as f:
|
| 414 |
-
f.write(response.content)
|
| 415 |
-
|
| 416 |
-
# Lora任务6
|
| 417 |
-
Lora_destination_folder6 = Lora_destination_folder3
|
| 418 |
-
Lora_target6 = os.path.join(Lora_destination_folder6, Lora_filename6)
|
| 419 |
-
|
| 420 |
-
if Lora_download6:
|
| 421 |
-
response = requests.get(Lora_url6)
|
| 422 |
-
if response.status_code == 200:
|
| 423 |
-
with open(Lora_target6, 'wb') as f:
|
| 424 |
-
f.write(response.content)
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
# VAE下载
|
| 428 |
-
|
| 429 |
-
print ("开始下载VAE模型")
|
| 430 |
-
# VAE任务1
|
| 431 |
-
VAE_destination_folder1 = "/root/main/models/VAE"
|
| 432 |
-
VAE_target1 = f"{VAE_destination_folder1}/{VAE_filename1}"
|
| 433 |
-
|
| 434 |
-
if VAE_download1:
|
| 435 |
-
response = requests.get(VAE_url1)
|
| 436 |
-
with open(VAE_target1, 'wb') as file:
|
| 437 |
-
file.write(response.content)
|
| 438 |
-
|
| 439 |
-
# VAE任务2
|
| 440 |
-
VAE_destination_folder2 = "/root/main/models/VAE"
|
| 441 |
-
VAE_target2 = f"{VAE_destination_folder2}/{VAE_filename2}"
|
| 442 |
-
|
| 443 |
-
if VAE_download2:
|
| 444 |
-
response = requests.get(VAE_url2)
|
| 445 |
-
with open(VAE_target2, 'wb') as file:
|
| 446 |
-
file.write(response.content)
|
| 447 |
-
|
| 448 |
-
# VAE��务3
|
| 449 |
-
VAE_destination_folder3 = "/root/main/models/VAE"
|
| 450 |
-
VAE_target3 = f"{VAE_destination_folder3}/{VAE_filename3}"
|
| 451 |
-
|
| 452 |
-
if VAE_download3:
|
| 453 |
-
response = requests.get(VAE_url3)
|
| 454 |
-
with open(VAE_target3, 'wb') as file:
|
| 455 |
-
file.write(response.content)
|
| 456 |
-
|
| 457 |
-
# VAE任务4
|
| 458 |
-
VAE_destination_folder4 = "/root/main/models/VAE"
|
| 459 |
-
VAE_target4 = f"{VAE_destination_folder4}/{VAE_filename4}"
|
| 460 |
-
|
| 461 |
-
if VAE_download4:
|
| 462 |
-
response = requests.get(VAE_url4)
|
| 463 |
-
with open(VAE_target4, 'wb') as file:
|
| 464 |
-
file.write(response.content)
|
| 465 |
-
|
| 466 |
-
# VAE任务5
|
| 467 |
-
VAE_destination_folder5 = "/root/main/models/VAE"
|
| 468 |
-
VAE_target5 = f"{VAE_destination_folder5}/{VAE_filename5}"
|
| 469 |
-
|
| 470 |
-
if VAE_download5:
|
| 471 |
-
response = requests.get(VAE_url5)
|
| 472 |
-
with open(VAE_target5, 'wb') as file:
|
| 473 |
-
file.write(response.content)
|
| 474 |
-
|
| 475 |
-
# VAE任务6
|
| 476 |
-
VAE_destination_folder6 = "/root/main/models/VAE"
|
| 477 |
-
VAE_target6 = f"{VAE_destination_folder6}/{VAE_filename6}"
|
| 478 |
-
|
| 479 |
-
if VAE_download6:
|
| 480 |
-
response = requests.get(VAE_url6)
|
| 481 |
-
with open(VAE_target6, 'wb') as file:
|
| 482 |
-
file.write(response.content)
|
| 483 |
-
|
| 484 |
-
# VAE任务7
|
| 485 |
-
VAE_destination_folder7 = "/root/main/models/VAE"
|
| 486 |
-
VAE_target7 = f"{VAE_destination_folder7}/{VAE_filename7}"
|
| 487 |
-
|
| 488 |
-
if VAE_download7:
|
| 489 |
-
response = requests.get(VAE_url7)
|
| 490 |
-
with open(VAE_target7, 'wb') as file:
|
| 491 |
-
file.write(response.content)
|
| 492 |
-
|
| 493 |
-
# VAE任务8
|
| 494 |
-
VAE_destination_folder8 = "/root/main/models/VAE"
|
| 495 |
-
VAE_target8 = f"{VAE_destination_folder8}/{VAE_filename8}"
|
| 496 |
-
|
| 497 |
-
if VAE_download8:
|
| 498 |
-
response = requests.get(VAE_url8)
|
| 499 |
-
with open(VAE_target8, 'wb') as file:
|
| 500 |
-
file.write(response.content)
|
| 501 |
-
|
| 502 |
-
# VAE任务9
|
| 503 |
-
VAE_destination_folder9 = "/root/main/models/VAE"
|
| 504 |
-
VAE_target9 = f"{VAE_destination_folder9}/{VAE_filename9}"
|
| 505 |
-
|
| 506 |
-
if VAE_download9:
|
| 507 |
-
response = requests.get(VAE_url9)
|
| 508 |
-
with open(VAE_target9, 'wb') as file:
|
| 509 |
-
file.write(response.content)
|
| 510 |
-
|
| 511 |
-
# VAE任务10
|
| 512 |
-
VAE_destination_folder10 = "/root/main/models/VAE"
|
| 513 |
-
VAE_target10 = f"{VAE_destination_folder10}/{VAE_filename10}"
|
| 514 |
-
|
| 515 |
-
if VAE_download10:
|
| 516 |
-
response = requests.get(VAE_url10)
|
| 517 |
-
with open(VAE_target10, 'wb') as file:
|
| 518 |
-
file.write(response.content)
|
| 519 |
-
|
| 520 |
-
# VAE任务11
|
| 521 |
-
VAE_destination_folder11 = "/root/main/models/VAE"
|
| 522 |
-
VAE_target11 = f"{VAE_destination_folder11}/{VAE_filename11}"
|
| 523 |
-
|
| 524 |
-
if VAE_download11:
|
| 525 |
-
response = requests.get(VAE_url11)
|
| 526 |
-
with open(VAE_target11, 'wb') as file:
|
| 527 |
-
file.write(response.content)
|
| 528 |
-
|
| 529 |
-
# VAE任务12
|
| 530 |
-
VAE_destination_folder12 = "/root/main/models/VAE"
|
| 531 |
-
VAE_target12 = f"{VAE_destination_folder12}/{VAE_filename12}"
|
| 532 |
-
|
| 533 |
-
if VAE_download12:
|
| 534 |
-
response = requests.get(VAE_url12)
|
| 535 |
-
with open(VAE_target12, 'wb') as file:
|
| 536 |
-
file.write(response.content)
|
| 537 |
-
|
| 538 |
-
# VAE任务13
|
| 539 |
-
VAE_destination_folder13 = "/root/main/models/VAE"
|
| 540 |
-
VAE_target13 = f"{VAE_destination_folder13}/{VAE_filename13}"
|
| 541 |
-
|
| 542 |
-
if VAE_download13:
|
| 543 |
-
response = requests.get(VAE_url13)
|
| 544 |
-
with open(VAE_target13, 'wb') as file:
|
| 545 |
-
file.write(response.content)
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
# embeddings模型下载
|
| 549 |
-
|
| 550 |
-
print ("开始下载embeddings模型")
|
| 551 |
-
# 下载任务1
|
| 552 |
-
embeddings_destination_folder1 = "/root/main/embeddings"
|
| 553 |
-
embeddings_target1 = f'{embeddings_destination_folder1}/{embeddings_filename1}'
|
| 554 |
-
|
| 555 |
-
if embeddings_download1:
|
| 556 |
-
os.makedirs(embeddings_destination_folder1, exist_ok=True)
|
| 557 |
-
response = requests.get(embeddings_url1)
|
| 558 |
-
with open(embeddings_target1, 'wb') as file:
|
| 559 |
-
file.write(response.content)
|
| 560 |
-
|
| 561 |
-
# 下载任务2
|
| 562 |
-
embeddings_destination_folder2 = "/root/main/embeddings"
|
| 563 |
-
embeddings_target2 = f'{embeddings_destination_folder2}/{embeddings_filename2}'
|
| 564 |
-
|
| 565 |
-
if embeddings_download2:
|
| 566 |
-
os.makedirs(embeddings_destination_folder2, exist_ok=True)
|
| 567 |
-
response = requests.get(embeddings_url2)
|
| 568 |
-
with open(embeddings_target2, 'wb') as file:
|
| 569 |
-
file.write(response.content)
|
| 570 |
-
|
| 571 |
-
# 下载任务3
|
| 572 |
-
embeddings_destination_folder3 = "/root/main/embeddings"
|
| 573 |
-
embeddings_target3 = f'{embeddings_destination_folder3}/{embeddings_filename3}'
|
| 574 |
-
|
| 575 |
-
if embeddings_download3:
|
| 576 |
-
os.makedirs(embeddings_destination_folder3, exist_ok=True)
|
| 577 |
-
response = requests.get(embeddings_url3)
|
| 578 |
-
with open(embeddings_target3, 'wb') as file:
|
| 579 |
-
file.write(response.content)
|
| 580 |
-
|
| 581 |
-
# 下载任务4
|
| 582 |
-
embeddings_destination_folder4 = "/root/main/embeddings"
|
| 583 |
-
embeddings_target4 = f'{embeddings_destination_folder4}/{embeddings_filename4}'
|
| 584 |
-
|
| 585 |
-
if embeddings_download4:
|
| 586 |
-
os.makedirs(embeddings_destination_folder4, exist_ok=True)
|
| 587 |
-
response = requests.get(embeddings_url4)
|
| 588 |
-
with open(embeddings_target4, 'wb') as file:
|
| 589 |
-
file.write(response.content)
|
| 590 |
-
|
| 591 |
-
# 下载任务5
|
| 592 |
-
embeddings_destination_folder5 = "/root/main/embeddings"
|
| 593 |
-
embeddings_target5 = f'{embeddings_destination_folder5}/{embeddings_filename5}'
|
| 594 |
-
|
| 595 |
-
if embeddings_download5:
|
| 596 |
-
os.makedirs(embeddings_destination_folder5, exist_ok=True)
|
| 597 |
-
response = requests.get(embeddings_url5)
|
| 598 |
-
with open(embeddings_target5, 'wb') as file:
|
| 599 |
-
file.write(response.content)
|
|
|
|
| 1 |
+
from modules import launch_utils
|
| 2 |
+
|
| 3 |
+
args = launch_utils.args
|
| 4 |
+
python = launch_utils.python
|
| 5 |
+
git = launch_utils.git
|
| 6 |
+
index_url = launch_utils.index_url
|
| 7 |
+
dir_repos = launch_utils.dir_repos
|
| 8 |
+
|
| 9 |
+
commit_hash = launch_utils.commit_hash
|
| 10 |
+
git_tag = launch_utils.git_tag
|
| 11 |
+
|
| 12 |
+
run = launch_utils.run
|
| 13 |
+
is_installed = launch_utils.is_installed
|
| 14 |
+
repo_dir = launch_utils.repo_dir
|
| 15 |
+
|
| 16 |
+
run_pip = launch_utils.run_pip
|
| 17 |
+
check_run_python = launch_utils.check_run_python
|
| 18 |
+
git_clone = launch_utils.git_clone
|
| 19 |
+
git_pull_recursive = launch_utils.git_pull_recursive
|
| 20 |
+
list_extensions = launch_utils.list_extensions
|
| 21 |
+
run_extension_installer = launch_utils.run_extension_installer
|
| 22 |
+
prepare_environment = launch_utils.prepare_environment
|
| 23 |
+
configure_for_tests = launch_utils.configure_for_tests
|
| 24 |
+
start = launch_utils.start
|
| 25 |
+
|
| 26 |
+
ngrok_use = True
|
| 27 |
+
|
| 28 |
+
#ngrok穿透
|
| 29 |
+
ngrokTokenFile='/etc/main/Authtoken.txt' # 非必填 存放ngrokToken的文件的路径
|
| 30 |
+
|
| 31 |
+
def ngrok_start(ngrokTokenFile: str, port: int, address_name: str, should_run: bool):
|
| 32 |
+
if not should_run:
|
| 33 |
+
print('Skipping ngrok start')
|
| 34 |
+
return
|
| 35 |
+
if Path(ngrokTokenFile).exists():
|
| 36 |
+
with open(ngrokTokenFile, encoding="utf-8") as nkfile:
|
| 37 |
+
ngrokToken = nkfile.readline()
|
| 38 |
+
print('use nrgok')
|
| 39 |
+
from pyngrok import conf, ngrok
|
| 40 |
+
conf.get_default().auth_token = ngrokToken
|
| 41 |
+
conf.get_default().monitor_thread = False
|
| 42 |
+
ssh_tunnels = ngrok.get_tunnels(conf.get_default())
|
| 43 |
+
if len(ssh_tunnels) == 0:
|
| 44 |
+
ssh_tunnel = ngrok.connect(port, bind_tls=True)
|
| 45 |
+
print(f'{address_name}:' + ssh_tunnel.public_url)
|
| 46 |
+
else:
|
| 47 |
+
print(f'{address_name}:' + ssh_tunnels[0].public_url)
|
| 48 |
+
else:
|
| 49 |
+
print('skip start ngrok')
|
| 50 |
+
|
| 51 |
+
def main():
|
| 52 |
+
if args.dump_sysinfo:
|
| 53 |
+
filename = launch_utils.dump_sysinfo()
|
| 54 |
+
|
| 55 |
+
print(f"Sysinfo saved as {filename}. Exiting...")
|
| 56 |
+
|
| 57 |
+
exit(0)
|
| 58 |
+
|
| 59 |
+
launch_utils.startup_timer.record("initial startup")
|
| 60 |
+
|
| 61 |
+
with launch_utils.startup_timer.subcategory("prepare environment"):
|
| 62 |
+
if not args.skip_prepare_environment:
|
| 63 |
+
prepare_environment()
|
| 64 |
+
|
| 65 |
+
if args.test_server:
|
| 66 |
+
configure_for_tests()
|
| 67 |
+
|
| 68 |
+
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