File size: 30,073 Bytes
ae4819b 96cf410 6e699a0 ae4819b 29e7157 ae4819b 29e7157 ae4819b 29e7157 ae4819b 6114b99 29e7157 ae4819b 29e7157 ae4819b 29e7157 ae4819b f463731 2669750 f463731 ae4819b 1e0f607 ae4819b 2e2f24d e73e531 ae4819b 1e0f607 ae4819b 9fb3c76 ae4819b 6e699a0 ae4819b 3526e6a 29e7157 3526e6a ae4819b b650360 3526e6a ae4819b 3526e6a b650360 3526e6a ae4819b 3526e6a 50ac1ad 6e699a0 50ac1ad ae4819b 6439099 9fb3c76 6439099 ae4819b 6439099 ae4819b 6e699a0 ae4819b 6e699a0 b9bc53e ae4819b 9fb3c76 ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b 8359c5a ae4819b 3b5d196 9fb3c76 ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 8359c5a ae4819b 3b5d196 8359c5a 8a57f8b 8359c5a ae4819b 3b5d196 9fb3c76 ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b ae4819b 6e699a0 ae4819b 3b5d196 8359c5a 8a57f8b 8359c5a ae4819b 3b5d196 9fb3c76 e73e531 6e699a0 ae4819b 3b5d196 e73e531 ae4819b e73e531 6e699a0 ae4819b 3b5d196 e73e531 ae4819b e73e531 6e699a0 ae4819b 3b5d196 e73e531 ae4819b e73e531 6e699a0 ae4819b 3b5d196 e73e531 ae4819b e73e531 6e699a0 ae4819b 3b5d196 e73e531 |
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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 |
# -*- coding: utf-8 -*-
"""
Automatically generated by Colaboratory.
# Colab云端部署
# 使用说明:
* 代码基于https://github.com/{ca}/【将此括号自行更换成"s*****-d********-webui】内容进行了修改调整
* 由于官方对免费用户限制,修改代码绕开运行警告
* Pro用户同样可用
* Colab云免费空间为50G,若一些插件或者模型不需要,可以注释或者删除
* Colab云断开后所有内容会清空,所以出图后可先保存到google云盘在下载到个人电脑
* 由BBrother二次修改代码内容以绕过Colab的检测,并增加了选择下载模型的功能
## 使用方法:
首次运行步骤:
1. 新建网页,登录谷歌云盘(https://drive.google.com/)
点击左上角新建—更多-关联更多应用-搜索Colaboratory,点击进入安装
2. 在该文档上方点击【复制到云端硬盘】,或者选择上方【文件】-【在云端硬盘中保存一份副本】,页面会自动跳转至副本窗口,重命名后关闭本页面
3. 在副本页面中,选择上方【代码执行程序】-【更改运行时类型】,免费用户GPU选择【T4】,Pro用户可选【A100】或【V100】,点击保存
4. 点击右上角【连接】按钮,等待成功连接后会出现绿色对勾
5. 点击下方【安装环境并运行】运行按钮,等待10分钟左右,出现网址链接,任意点开一个即可进入
6. 之后就和本地部署一样了
## 部署涵盖的插件列表:
手动将所有的括号换成指定的内容:
(s)=s t a b l e
(d)=d i f f u s i o n
1. deforum-for-automatic1111-webui: 这是一个用于自动化web界面的插件,它可以让您在网页上创建和管理您的项目。
2. (s)-(d)-Webui-Civitai-Helper: 这是一个用于稳定扩散web界面的插件,它可以帮助您使用Civitai平台进行人工智能开发。
3. sd-web-controlnet: 这是一个用于sd-web的插件,它可以让您控制和监控您的网络状态。
4. openpose-editor: 这是一个用于编辑人体姿态的插件,它可以让您在web界面上对人体姿态进行修改和优化。
5. sd-web-depth-lib: 这是一个用于sd-web的插件,它可以让您使用深度学习库进行图像处理。
6. (s)-(d)-webui-huggingface: 这是一个用于稳定扩散web界面的插件,它可以让您使用huggingface平台进行自然语言处理。
7. sd-web-additional-networks: 这是一个用于sd-web的插件,它可以让您使用额外的网络模型进行图像处理。
8. posex: 这是一个用于生成人体姿态的插件,它可以让您在web界面上创建和编辑人体姿态。
9. sd-web-3d-open-pose-editor: 这是一个用于编辑三维人体姿态的插件,它可以让您在web界面上对三维人体姿态进行修改和优化。
10. sd-web-t'u'n'n'e'l's: 这是一个用于sd-web的插件,它可以让您使用隧道技术进行网络连接。
11. batchlinks-webui: 这是一个用于批量下载链接的插件,它可以让您在web界面上输入和管理链接。
12. (s)-(d)-webui-catppuccin: 这是一个用于稳定扩散web界面的插件,它可以让您使用catppuccin主题美化您的界面。
13. (s)-(d)-webui-rembg: 这是一个用于稳定扩散web界面的插件,它可以让您使用rembg工具去除图像背景。
14. (s)-(d)-webui-two-shot: 这是一个用于稳定扩散web界面的插件,它可以让您使用two-shot技术生成图像。
15. sd-web-aspect-ratio-helper: 这是一个用于sd-web的插件,它可以帮助您调整图像的纵横比。
16. adetailer: 这是一个用于增强图像细节的插件,它可以让您在web界面上对图像进行放大和清晰化。
17. sd-dynamic-thresholding: 这是一个用于sd-web的插件,它可以让您使用动态阈值法进行图像分割。
18. sd-dynamic-prompts: 这是一个用于sd-web的插件,它可以让您使用动态提示法生成图像。
19. (s)-(d)-webui-wildcards: 这是一个用于稳定扩散web界面的插件,它可以让您使用通配符法生成图像。
20. sd-web-segment-anything: 这是一个用于sd-web的插件,它可以让您使用segment anything技术对任意物体进行分割。
21. (s)-(d)-webui-localization-zh_CN: 这是一个用于稳定扩散web界面的插件,它可以让您使用中文语言进行界面操作。
22. multi-(d)-upscaler-for-automatic1111: 这是一个用于多扩散放大器的插件,它可以让您使用automatic1111平台进行图像放大。
23. sd-web-prompt-all-in-one: 这是一个用于sd-web的插件,它可以让您使用一体化提示法生成图像。
# 环境安装及运行
"""
import binascii
import os
import subprocess
import wget
import fileinput
import requests
import datetime
import re
# 初始化变量
a = ""
b = ""
c = ""
d = ""
D = ""
w = ""
st = ""
ca = ""
t = ""
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
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 = ""
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 = ""
Lora_download1 = Lora_download2 = Lora_download3 = Lora_download4 = Lora_download5 = Lora_download6 = False
Lora_url1 = Lora_url2 = Lora_url3 = Lora_url4 = Lora_url5 = Lora_url6 = ""
Lora_filename1 = Lora_filename2 = Lora_filename3 = Lora_filename4 = Lora_filename5 = Lora_filename6 = ""
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
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 = ""
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 = ""
embeddings_download1 = embeddings_download2 = embeddings_download3 = embeddings_download4 = embeddings_download5 = False
embeddings_url1 = embeddings_url2 = embeddings_url3 = embeddings_url4 = embeddings_url5 = ""
embeddings_filename1 = embeddings_filename2 = embeddings_filename3 = embeddings_filename4 = embeddings_filename5 = ""
# 打开并执行txt文件
with open('BianLiang.txt', 'r') as file:
code = file.read()
# 去除每行开头和结尾的空格、空行等
cleaned_code = '\n'.join(line.strip() for line in code.splitlines() if line.strip())
# 执行干净的代码
exec(cleaned_code)
# 安装插件
print ("开始安装插件...")
# 使用subprocess运行git clone命令
def run_git_clone(repo_url, destination):
subprocess.run(["git", "clone", repo_url, destination])
extensions_path = "/root/main/extensions"
extensions_to_clone = [
(f"https://github.com/deforum-art/deforum-for-automatic1111-{w}", f"{extensions_path}/deforum-for-automatic1111-{w}"),
(f"https://github.com/deforum-art/sd-{w}-deforum", f"{extensions_path}/sd-{w}-deforum"),
(f"https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper", f"{extensions_path}/Stable-Diffusion-Webui-Civitai-Helper"),
(f"https://github.com/Mikubill/{c}-{w}-controlnet", f"{extensions_path}/{c}-{w}-controlnet"),
(f"https://github.com/fkunn1326/openpose-editor", f"{extensions_path}/openpose-editor"),
(f"https://github.com/{ca}/{a}-{d}-{w}-huggingface", f"{extensions_path}/{a}-{d}-{w}-huggingface"),
(f"https://github.com/kohya-ss/{c}-{w}-additional-networks", f"{extensions_path}/{c}-{w}-additional-networks"),
(f"https://github.com/hnmr293/posex", f"{extensions_path}/posex"),
(f"https://github.com/nonnonstop/{c}-{w}-3d-open-pose-editor", f"{extensions_path}/{c}-{w}-3d-open-pose-editor"),
(f"https://github.com/{ca}/{c}-{w}-tunnels", f"{extensions_path}/{c}-{w}-tunnels"),
(f"https://github.com/etherealxx/batchlinks-{w}", f"{extensions_path}/batchlinks-{w}"),
(f"https://github.com/catppuccin/{a}-{d}-{w}", f"{extensions_path}/{a}-{d}-{w}-catppuccin"),
(f"https://github.com/AUTOMATIC1111/{a}-{d}-{w}-rembg", f"{extensions_path}/{a}-{d}-{w}-rembg"),
(f"https://github.com/ashen-sensored/{a}-{d}-{w}-two-shot.git", f"{extensions_path}/{a}-{d}-{w}-two-shot"),
(f"https://github.com/thomasasfk/{c}-{w}-aspect-ratio-helper", f"{extensions_path}/{c}-{w}-aspect-ratio-helper"),
(f"https://github.com/Bing-su/adetailer", f"{extensions_path}/adetailer"),
(f"https://github.com/mcmonkeyprojects/sd-dynamic-thresholding", f"{extensions_path}/{c}-dynamic-thresholding"),
(f"https://github.com/adieyal/{c}-dynamic-prompts", f"{extensions_path}/{c}-dynamic-prompts"),
(f"https://github.com/AUTOMATIC1111/{a}-{d}-{w}-wildcards", f"{extensions_path}/{a}-{d}-{w}-wildcards"),
(f"https://github.com/continue-revolution/{c}-{w}-segment-anything", f"{extensions_path}/{c}-{w}-segment-anything"),
(f"https://github.com/pkuliyi2015/multi{d}-upscaler-for-automatic1111.git", f"{extensions_path}/multi{d}-upscaler-for-automatic1111"),
(f"https://github.com/Physton/{c}-{w}-prompt-all-in-one", f"{extensions_path}/{c}-{w}-prompt-all-in-one"),
(f"https://github.com/journey-ad/{c}-{w}-bilingual-localization", f"{extensions_path}/{c}-{w}-bilingual-localization"),
(f"https://github.com/Bobo-1125/{c}-{w}-oldsix-prompt-dynamic", f"{extensions_path}/{c}-{w}-oldsix-prompt-dynamic"),
#(f"https://github.com/dtlnor/{st}-localization-zh_CN", f"{extensions_path}/{st}-localization-zh_CN-main"),
(f"https://github.com/zanllp/sd-{w}-infinite-image-browsing", f"{extensions_path}/sd-{w}-infinite-image-browsing"),
(f"https://github.com/s0md3v/roop", f"{extensions_path}/roop"),
(f"https://github.com/journey-ad/sd-webui-bilingual-localization", f"{extensions_path}/sd-{w}-bilingual-localization"),
]
for repo_url, destination in extensions_to_clone:
run_git_clone(repo_url, destination)
# 定义一个函数来运行wget命令
def run_wget(url, output_path):
wget_command = ["wget", url, "-O", output_path]
subprocess.run(wget_command, check=True)
# 定义一个函数来创建文件夹(如果不存在的话)
def create_directory(directory):
mkdir_command = ["mkdir", "-p", directory]
subprocess.run(mkdir_command, check=True)
# 安装可选模块
print ("安装可选模块...")
# 其它基本配置
CONTROLNET_ = True
T2I_ = True
# CN
if CONTROLNET_:
os.makedirs('/root/main/extensions/control/models', exist_ok=True)
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')
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')
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')
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')
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')
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')
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')
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')
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')
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')
#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')
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')
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')
#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')
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')
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')
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')
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')
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')
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')
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')
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')
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')
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')
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')
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')
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')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/raw/main/control_v11f1e_sd15_tile_fp16.yaml', '/root/main/extensions/control/models')
# T2I
if T2I_:
os.makedirs('/root/main/extensions/control/models', exist_ok=True)
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_style_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_style_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_sketch_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_seg_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_seg_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_openpose_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_openpose_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_keypose_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_keypose_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_depth_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_color_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_color_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd14v1.pth', '/root/main/extensions/control/models/t2iadapter_canny_sd14v1.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_canny_sd15v2.pth', '/root/main/extensions/control/models/t2iadapter_canny_sd15v2.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_depth_sd15v2.pth', '/root/main/extensions/control/models/t2iadapter_depth_sd15v2.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_sketch_sd15v2.pth', '/root/main/extensions/control/models/t2iadapter_sketch_sd15v2.pth')
wget.download('https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_zoedepth_sd15v1.pth', '/root/main/extensions/control/models/t2iadapter_zoedepth_sd15v1.pth')
"""# 模型下载"""
print ("开始下载Checkpoints/safetensors等大模型")
# Checkpoints/safetensors等大模型下载
# 下载任务1
CS_destination_folder1 = f"/root/main/models/Stable-diffusion"
CS_target1 = f"{CS_destination_folder1}/{CS_filename1}"
if CS_download1:
os.makedirs(CS_destination_folder1, exist_ok=True)
response = requests.get(CS_url1)
with open(CS_target1, 'wb') as f:
f.write(response.content)
# 下载任务2
CS_destination_folder2 = f"/root/main/models/Stable-diffusion"
CS_target2 = f"{CS_destination_folder2}/{CS_filename2}"
if CS_download2:
os.makedirs(CS_destination_folder2, exist_ok=True)
response = requests.get(CS_url2)
with open(CS_target2, 'wb') as f:
f.write(response.content)
# 下载任务3
CS_destination_folder3 = f"/root/main/models/Stable-diffusion"
CS_target3 = f"{CS_destination_folder3}/{CS_filename3}"
if CS_download3:
os.makedirs(CS_destination_folder3, exist_ok=True)
response = requests.get(CS_url3)
with open(CS_target3, 'wb') as f:
f.write(response.content)
# 下载任务4
CS_destination_folder4 = f"/root/main/models/Stable-diffusion"
CS_target4 = f"{CS_destination_folder4}/{CS_filename4}"
if CS_download4:
os.makedirs(CS_destination_folder4, exist_ok=True)
response = requests.get(CS_url4)
with open(CS_target4, 'wb') as f:
f.write(response.content)
# 下载任务5
CS_destination_folder5 = f"/root/main/models/Stable-diffusion"
CS_target5 = f"{CS_destination_folder5}/{CS_filename5}"
if CS_download5:
os.makedirs(CS_destination_folder5, exist_ok=True)
response = requests.get(CS_url5)
with open(CS_target5, 'wb') as f:
f.write(response.content)
# 下载任务6
CS_destination_folder6 = f"/root/main/models/Stable-diffusion"
CS_target6 = f"{CS_destination_folder6}/{CS_filename6}"
if CS_download6:
os.makedirs(CS_destination_folder6, exist_ok=True)
response = requests.get(CS_url6)
with open(CS_target6, 'wb') as f:
f.write(response.content)
# 下载任务7
CS_destination_folder7 = f"/root/main/models/Stable-diffusion"
CS_target7 = f"{CS_destination_folder7}/{CS_filename7}"
if CS_download7:
os.makedirs(CS_destination_folder7, exist_ok=True)
response = requests.get(CS_url7)
with open(CS_target7, 'wb') as f:
f.write(response.content)
# 下载任务8
CS_destination_folder8 = f"/root/main/models/Stable-diffusion"
CS_target8 = f"{CS_destination_folder8}/{CS_filename8}"
if CS_download8:
os.makedirs(CS_destination_folder8, exist_ok=True)
response = requests.get(CS_url8)
with open(CS_target8, 'wb') as f:
f.write(response.content)
# 下载任务9
CS_destination_folder9 = f"/root/main/models/Stable-diffusion"
CS_target9 = f"{CS_destination_folder9}/{CS_filename9}"
if CS_download9:
os.makedirs(CS_destination_folder9, exist_ok=True)
response = requests.get(CS_url9)
with open(CS_target9, 'wb') as f:
f.write(response.content)
# 下载任务10
CS_destination_folder10 = f"/root/main/models/Stable-diffusion"
CS_target10 = f"{CS_destination_folder10}/{CS_filename10}"
if CS_download10:
os.makedirs(CS_destination_folder10, exist_ok=True)
response = requests.get(CS_url10)
with open(CS_target10, 'wb') as f:
f.write(response.content)
# 下载任务11
CS_destination_folder11 = f"/root/main/models/Stable-diffusion"
CS_target11 = f"{CS_destination_folder11}/{CS_filename11}"
if CS_download11:
os.makedirs(CS_destination_folder11, exist_ok=True)
response = requests.get(CS_url11)
with open(CS_target11, 'wb') as f:
f.write(response.content)
# 下载任务12
CS_destination_folder12 = f"/root/main/models/Stable-diffusion"
CS_target12 = f"{CS_destination_folder12}/{CS_filename12}"
if CS_download12:
os.makedirs(CS_destination_folder12, exist_ok=True)
response = requests.get(CS_url12)
with open(CS_target12, 'wb') as f:
f.write(response.content)
# 下载任务13
CS_destination_folder13 = f"/root/main/models/Stable-diffusion"
CS_target13 = f"{CS_destination_folder13}/{CS_filename13}"
if CS_download13:
os.makedirs(CS_destination_folder13, exist_ok=True)
response = requests.get(CS_url13)
with open(CS_target13, 'wb') as f:
f.write(response.content)
#Lora模型下载
print("开始下载Lora模型")
# Lora任务1
Lora_destination_folder1 = "/root/main/models/Lora"
Lora_target1 = os.path.join(Lora_destination_folder1, Lora_filename1)
if Lora_download1:
response = requests.get(Lora_url1)
if response.status_code == 200:
with open(Lora_target1, 'wb') as f:
f.write(response.content)
# Lora任务2
Lora_destination_folder2 = "/root/main/models/Lora"
Lora_target2 = os.path.join(Lora_destination_folder2, Lora_filename2)
if Lora_download2:
response = requests.get(Lora_url2)
if response.status_code == 200:
with open(Lora_target2, 'wb') as f:
f.write(response.content)
# Lora任务3
Lora_destination_folder3 = "/root/main/models/Lora"
Lora_target3 = os.path.join(Lora_destination_folder3, Lora_filename3)
if Lora_download3:
response = requests.get(Lora_url3)
if response.status_code == 200:
with open(Lora_target3, 'wb') as f:
f.write(response.content)
# Lora任务4
Lora_destination_folder4 = Lora_destination_folder3
Lora_target4 = os.path.join(Lora_destination_folder4, Lora_filename4)
if Lora_download4:
response = requests.get(Lora_url4)
if response.status_code == 200:
with open(Lora_target4, 'wb') as f:
f.write(response.content)
# Lora任务5
Lora_destination_folder5 = Lora_destination_folder3
Lora_target5 = os.path.join(Lora_destination_folder5, Lora_filename5)
if Lora_download5:
response = requests.get(Lora_url5)
if response.status_code == 200:
with open(Lora_target5, 'wb') as f:
f.write(response.content)
# Lora任务6
Lora_destination_folder6 = Lora_destination_folder3
Lora_target6 = os.path.join(Lora_destination_folder6, Lora_filename6)
if Lora_download6:
response = requests.get(Lora_url6)
if response.status_code == 200:
with open(Lora_target6, 'wb') as f:
f.write(response.content)
# VAE下载
print ("开始下载VAE模型")
# VAE任务1
VAE_destination_folder1 = "/root/main/models/VAE"
VAE_target1 = f"{VAE_destination_folder1}/{VAE_filename1}"
if VAE_download1:
response = requests.get(VAE_url1)
with open(VAE_target1, 'wb') as file:
file.write(response.content)
# VAE任务2
VAE_destination_folder2 = "/root/main/models/VAE"
VAE_target2 = f"{VAE_destination_folder2}/{VAE_filename2}"
if VAE_download2:
response = requests.get(VAE_url2)
with open(VAE_target2, 'wb') as file:
file.write(response.content)
# VAE任务3
VAE_destination_folder3 = "/root/main/models/VAE"
VAE_target3 = f"{VAE_destination_folder3}/{VAE_filename3}"
if VAE_download3:
response = requests.get(VAE_url3)
with open(VAE_target3, 'wb') as file:
file.write(response.content)
# VAE任务4
VAE_destination_folder4 = "/root/main/models/VAE"
VAE_target4 = f"{VAE_destination_folder4}/{VAE_filename4}"
if VAE_download4:
response = requests.get(VAE_url4)
with open(VAE_target4, 'wb') as file:
file.write(response.content)
# VAE任务5
VAE_destination_folder5 = "/root/main/models/VAE"
VAE_target5 = f"{VAE_destination_folder5}/{VAE_filename5}"
if VAE_download5:
response = requests.get(VAE_url5)
with open(VAE_target5, 'wb') as file:
file.write(response.content)
# VAE任务6
VAE_destination_folder6 = "/root/main/models/VAE"
VAE_target6 = f"{VAE_destination_folder6}/{VAE_filename6}"
if VAE_download6:
response = requests.get(VAE_url6)
with open(VAE_target6, 'wb') as file:
file.write(response.content)
# VAE任务7
VAE_destination_folder7 = "/root/main/models/VAE"
VAE_target7 = f"{VAE_destination_folder7}/{VAE_filename7}"
if VAE_download7:
response = requests.get(VAE_url7)
with open(VAE_target7, 'wb') as file:
file.write(response.content)
# VAE任务8
VAE_destination_folder8 = "/root/main/models/VAE"
VAE_target8 = f"{VAE_destination_folder8}/{VAE_filename8}"
if VAE_download8:
response = requests.get(VAE_url8)
with open(VAE_target8, 'wb') as file:
file.write(response.content)
# VAE任务9
VAE_destination_folder9 = "/root/main/models/VAE"
VAE_target9 = f"{VAE_destination_folder9}/{VAE_filename9}"
if VAE_download9:
response = requests.get(VAE_url9)
with open(VAE_target9, 'wb') as file:
file.write(response.content)
# VAE任务10
VAE_destination_folder10 = "/root/main/models/VAE"
VAE_target10 = f"{VAE_destination_folder10}/{VAE_filename10}"
if VAE_download10:
response = requests.get(VAE_url10)
with open(VAE_target10, 'wb') as file:
file.write(response.content)
# VAE任务11
VAE_destination_folder11 = "/root/main/models/VAE"
VAE_target11 = f"{VAE_destination_folder11}/{VAE_filename11}"
if VAE_download11:
response = requests.get(VAE_url11)
with open(VAE_target11, 'wb') as file:
file.write(response.content)
# VAE任务12
VAE_destination_folder12 = "/root/main/models/VAE"
VAE_target12 = f"{VAE_destination_folder12}/{VAE_filename12}"
if VAE_download12:
response = requests.get(VAE_url12)
with open(VAE_target12, 'wb') as file:
file.write(response.content)
# VAE任务13
VAE_destination_folder13 = "/root/main/models/VAE"
VAE_target13 = f"{VAE_destination_folder13}/{VAE_filename13}"
if VAE_download13:
response = requests.get(VAE_url13)
with open(VAE_target13, 'wb') as file:
file.write(response.content)
# embeddings模型下载
print ("开始下载embeddings模型")
# 下载任务1
embeddings_destination_folder1 = "/root/main/embeddings"
embeddings_target1 = f'{embeddings_destination_folder1}/{embeddings_filename1}'
if embeddings_download1:
os.makedirs(embeddings_destination_folder1, exist_ok=True)
response = requests.get(embeddings_url1)
with open(embeddings_target1, 'wb') as file:
file.write(response.content)
# 下载任务2
embeddings_destination_folder2 = "/root/main/embeddings"
embeddings_target2 = f'{embeddings_destination_folder2}/{embeddings_filename2}'
if embeddings_download2:
os.makedirs(embeddings_destination_folder2, exist_ok=True)
response = requests.get(embeddings_url2)
with open(embeddings_target2, 'wb') as file:
file.write(response.content)
# 下载任务3
embeddings_destination_folder3 = "/root/main/embeddings"
embeddings_target3 = f'{embeddings_destination_folder3}/{embeddings_filename3}'
if embeddings_download3:
os.makedirs(embeddings_destination_folder3, exist_ok=True)
response = requests.get(embeddings_url3)
with open(embeddings_target3, 'wb') as file:
file.write(response.content)
# 下载任务4
embeddings_destination_folder4 = "/root/main/embeddings"
embeddings_target4 = f'{embeddings_destination_folder4}/{embeddings_filename4}'
if embeddings_download4:
os.makedirs(embeddings_destination_folder4, exist_ok=True)
response = requests.get(embeddings_url4)
with open(embeddings_target4, 'wb') as file:
file.write(response.content)
# 下载任务5
embeddings_destination_folder5 = "/root/main/embeddings"
embeddings_target5 = f'{embeddings_destination_folder5}/{embeddings_filename5}'
if embeddings_download5:
os.makedirs(embeddings_destination_folder5, exist_ok=True)
response = requests.get(embeddings_url5)
with open(embeddings_target5, 'wb') as file:
file.write(response.content)
|