Update v2_3.py
Browse files
v2_3.py
CHANGED
|
@@ -79,6 +79,29 @@ w = ""
|
|
| 79 |
st = ""
|
| 80 |
ca = ""
|
| 81 |
t = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
# 打开并执行txt文件
|
| 84 |
with open('BianLiang.txt', 'r') as file:
|
|
@@ -290,21 +313,13 @@ if os.path.exists(shared_file_path):
|
|
| 290 |
print(line.replace('["sd_model_checkpoint"]', '["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"]'), end='')
|
| 291 |
|
| 292 |
|
| 293 |
-
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
|
| 294 |
-
|
| 295 |
-
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 = ""
|
| 296 |
-
|
| 297 |
-
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 = ""
|
| 298 |
-
|
| 299 |
|
| 300 |
"""# 模型下载"""
|
| 301 |
|
| 302 |
print ("开始下载Checkpoints/safetensors等大模型")
|
| 303 |
# Checkpoints/safetensors等大模型下载
|
| 304 |
# 下载任务1
|
| 305 |
-
CS_url1 = "https://civitai.com/api/download/models/17701"
|
| 306 |
CS_destination_folder1 = f"/bushu/ui/models/Stable-diffusion"
|
| 307 |
-
CS_filename1 = "anypastelAnythingV45_anypastelAnythingV45.safetensors"
|
| 308 |
CS_target1 = f"{CS_destination_folder1}/{CS_filename1}"
|
| 309 |
|
| 310 |
if CS_download1:
|
|
@@ -314,9 +329,7 @@ if CS_download1:
|
|
| 314 |
f.write(response.content)
|
| 315 |
|
| 316 |
# 下载任务2
|
| 317 |
-
CS_url2 = "https://civitai.com/api/download/models/26633?type=Model&format=PickleTensor&size=full&fp=fp16"
|
| 318 |
CS_destination_folder2 = f"/bushu/ui/models/Stable-diffusion"
|
| 319 |
-
CS_filename2 = "07CounterfeitV2503_10.ckpt"
|
| 320 |
CS_target2 = f"{CS_destination_folder2}/{CS_filename2}"
|
| 321 |
|
| 322 |
if CS_download2:
|
|
@@ -326,9 +339,7 @@ if CS_download2:
|
|
| 326 |
f.write(response.content)
|
| 327 |
|
| 328 |
# 下载任务3
|
| 329 |
-
CS_url3 = "https://civitai.com/api/download/models/90854"
|
| 330 |
CS_destination_folder3 = f"/bushu/ui/models/Stable-diffusion"
|
| 331 |
-
CS_filename3 = "AnythingV5Ink.safetensors"
|
| 332 |
CS_target3 = f"{CS_destination_folder3}/{CS_filename3}"
|
| 333 |
|
| 334 |
if CS_download3:
|
|
@@ -338,9 +349,7 @@ if CS_download3:
|
|
| 338 |
f.write(response.content)
|
| 339 |
|
| 340 |
# 下载任务4
|
| 341 |
-
CS_url4 = "https://civitai.com/api/download/models/57618"
|
| 342 |
CS_destination_folder4 = f"/bushu/ui/models/Stable-diffusion"
|
| 343 |
-
CS_filename4 = "CounterfeitV30_v30.safetensors"
|
| 344 |
CS_target4 = f"{CS_destination_folder4}/{CS_filename4}"
|
| 345 |
|
| 346 |
if CS_download4:
|
|
@@ -350,9 +359,7 @@ if CS_download4:
|
|
| 350 |
f.write(response.content)
|
| 351 |
|
| 352 |
# 下载任务5
|
| 353 |
-
CS_url5 = "https://civitai.com/api/download/models/1356"
|
| 354 |
CS_destination_folder5 = f"/bushu/ui/models/Stable-diffusion"
|
| 355 |
-
CS_filename5 = "dreamlike10_10.ckpt"
|
| 356 |
CS_target5 = f"{CS_destination_folder5}/{CS_filename5}"
|
| 357 |
|
| 358 |
if CS_download5:
|
|
@@ -362,9 +369,7 @@ if CS_download5:
|
|
| 362 |
f.write(response.content)
|
| 363 |
|
| 364 |
# 下载任务6
|
| 365 |
-
CS_url6 = "https://civitai.com/api/download/models/17233"
|
| 366 |
CS_destination_folder6 = f"/bushu/ui/models/Stable-diffusion"
|
| 367 |
-
CS_filename6 = "abyssorangemix3AOM3_aom3a1b.safetensors"
|
| 368 |
CS_target6 = f"{CS_destination_folder6}/{CS_filename6}"
|
| 369 |
|
| 370 |
if CS_download6:
|
|
@@ -374,9 +379,7 @@ if CS_download6:
|
|
| 374 |
f.write(response.content)
|
| 375 |
|
| 376 |
# 下载任务7
|
| 377 |
-
CS_url7 = ""
|
| 378 |
CS_destination_folder7 = f"/bushu/ui/models/Stable-diffusion"
|
| 379 |
-
CS_filename7 = ""
|
| 380 |
CS_target7 = f"{CS_destination_folder7}/{CS_filename7}"
|
| 381 |
|
| 382 |
if CS_download7:
|
|
@@ -386,9 +389,7 @@ if CS_download7:
|
|
| 386 |
f.write(response.content)
|
| 387 |
|
| 388 |
# 下载任务8
|
| 389 |
-
CS_url8 = ""
|
| 390 |
CS_destination_folder8 = f"/bushu/ui/models/Stable-diffusion"
|
| 391 |
-
CS_filename8 = ""
|
| 392 |
CS_target8 = f"{CS_destination_folder8}/{CS_filename8}"
|
| 393 |
|
| 394 |
if CS_download8:
|
|
@@ -398,9 +399,7 @@ if CS_download8:
|
|
| 398 |
f.write(response.content)
|
| 399 |
|
| 400 |
# 下载任务9
|
| 401 |
-
CS_url9 = ""
|
| 402 |
CS_destination_folder9 = f"/bushu/ui/models/Stable-diffusion"
|
| 403 |
-
CS_filename9 = ""
|
| 404 |
CS_target9 = f"{CS_destination_folder9}/{CS_filename9}"
|
| 405 |
|
| 406 |
if CS_download9:
|
|
@@ -410,9 +409,7 @@ if CS_download9:
|
|
| 410 |
f.write(response.content)
|
| 411 |
|
| 412 |
# 下载任务10
|
| 413 |
-
CS_url10 = ""
|
| 414 |
CS_destination_folder10 = f"/bushu/ui/models/Stable-diffusion"
|
| 415 |
-
CS_filename10 = ""
|
| 416 |
CS_target10 = f"{CS_destination_folder10}/{CS_filename10}"
|
| 417 |
|
| 418 |
if CS_download10:
|
|
@@ -422,9 +419,7 @@ if CS_download10:
|
|
| 422 |
f.write(response.content)
|
| 423 |
|
| 424 |
# 下载任务11
|
| 425 |
-
CS_url11 = ""
|
| 426 |
CS_destination_folder11 = f"/bushu/ui/models/Stable-diffusion"
|
| 427 |
-
CS_filename11 = ""
|
| 428 |
CS_target11 = f"{CS_destination_folder11}/{CS_filename11}"
|
| 429 |
|
| 430 |
if CS_download11:
|
|
@@ -434,9 +429,7 @@ if CS_download11:
|
|
| 434 |
f.write(response.content)
|
| 435 |
|
| 436 |
# 下载任务12
|
| 437 |
-
CS_url12 = ""
|
| 438 |
CS_destination_folder12 = f"/bushu/ui/models/Stable-diffusion"
|
| 439 |
-
CS_filename12 = ""
|
| 440 |
CS_target12 = f"{CS_destination_folder12}/{CS_filename12}"
|
| 441 |
|
| 442 |
if CS_download12:
|
|
@@ -446,9 +439,7 @@ if CS_download12:
|
|
| 446 |
f.write(response.content)
|
| 447 |
|
| 448 |
# 下载任务13
|
| 449 |
-
CS_url13 = ""
|
| 450 |
CS_destination_folder13 = f"/bushu/ui/models/Stable-diffusion"
|
| 451 |
-
CS_filename13 = ""
|
| 452 |
CS_target13 = f"{CS_destination_folder13}/{CS_filename13}"
|
| 453 |
|
| 454 |
if CS_download13:
|
|
@@ -458,20 +449,11 @@ if CS_download13:
|
|
| 458 |
f.write(response.content)
|
| 459 |
|
| 460 |
|
| 461 |
-
|
| 462 |
#Lora模型下载
|
| 463 |
|
| 464 |
-
Lora_download1 = Lora_download2 = Lora_download3 = Lora_download4 = Lora_download5 = Lora_download6 = False
|
| 465 |
-
|
| 466 |
-
Lora_url1 = Lora_url2 = Lora_url3 = Lora_url4 = Lora_url5 = Lora_url6 = ""
|
| 467 |
-
|
| 468 |
-
Lora_filename1 = Lora_filename2 = Lora_filename3 = Lora_filename4 = Lora_filename5 = Lora_filename6 = ""
|
| 469 |
-
|
| 470 |
print("开始下载Lora模型")
|
| 471 |
# Lora任务1
|
| 472 |
-
Lora_url1 = "https://civitai.com/api/download/models/64842"
|
| 473 |
Lora_destination_folder1 = "/bushu/ui/models/Lora"
|
| 474 |
-
Lora_filename1 = "arona_puranalora_v1.safetensors"
|
| 475 |
Lora_target1 = os.path.join(Lora_destination_folder1, Lora_filename1)
|
| 476 |
|
| 477 |
if Lora_download1:
|
|
@@ -481,9 +463,7 @@ if Lora_download1:
|
|
| 481 |
f.write(response.content)
|
| 482 |
|
| 483 |
# Lora任务2
|
| 484 |
-
Lora_url2 = "https://liblibai-online.liblibai.ai/web/model/25e9f1fa5137b2517b46c0a07f068e7328d5bd28744255d476c40e3ce61abed4.safetensors?attname=Xian-T%E6%89%8B%E9%83%A8%E4%BF%AE%E5%A4%8Dlora%EF%BC%88%E4%B8%8D%E7%94%A8controlnet%E4%B9%9F%E4%B8%8D%E5%9D%8F%E6%89%8B%E4%BA%86%EF%BC%89_v3.0.safetensors"
|
| 485 |
Lora_destination_folder2 = "/bushu/ui/models/Lora"
|
| 486 |
-
Lora_filename2 = "Xian-T\u624B\u90E8\u4FEE\u590Dlora\uFF08\u4E0D%E7%94%A8controlnet%E4%B4%9B%E4%B8%8D%E5%9D%8F%E6%89%8B%E4%BA%86\uFF09_v3.0.safetensors"
|
| 487 |
Lora_target2 = os.path.join(Lora_destination_folder2, Lora_filename2)
|
| 488 |
|
| 489 |
if Lora_download2:
|
|
@@ -493,9 +473,7 @@ if Lora_download2:
|
|
| 493 |
f.write(response.content)
|
| 494 |
|
| 495 |
# Lora任务3
|
| 496 |
-
Lora_url3 = "https://civitai.com/api/download/models/52900"
|
| 497 |
Lora_destination_folder3 = "/bushu/ui/models/Lora"
|
| 498 |
-
Lora_filename3 = "cailaiarona-000007.safetensors"
|
| 499 |
Lora_target3 = os.path.join(Lora_destination_folder3, Lora_filename3)
|
| 500 |
|
| 501 |
if Lora_download3:
|
|
@@ -505,9 +483,7 @@ if Lora_download3:
|
|
| 505 |
f.write(response.content)
|
| 506 |
|
| 507 |
# Lora任务4
|
| 508 |
-
Lora_url4 = "https://civitai.com/api/download/models/9409"
|
| 509 |
Lora_destination_folder4 = Lora_destination_folder3
|
| 510 |
-
Lora_filename4 = "chara-arona-v1.safetensors"
|
| 511 |
Lora_target4 = os.path.join(Lora_destination_folder4, Lora_filename4)
|
| 512 |
|
| 513 |
if Lora_download4:
|
|
@@ -517,9 +493,7 @@ if Lora_download4:
|
|
| 517 |
f.write(response.content)
|
| 518 |
|
| 519 |
# Lora任务5
|
| 520 |
-
Lora_url5 = ""
|
| 521 |
Lora_destination_folder5 = Lora_destination_folder3
|
| 522 |
-
Lora_filename5 = ""
|
| 523 |
Lora_target5 = os.path.join(Lora_destination_folder5, Lora_filename5)
|
| 524 |
|
| 525 |
if Lora_download5:
|
|
@@ -529,9 +503,7 @@ if Lora_download5:
|
|
| 529 |
f.write(response.content)
|
| 530 |
|
| 531 |
# Lora任务6
|
| 532 |
-
Lora_url6 = ""
|
| 533 |
Lora_destination_folder6 = Lora_destination_folder3
|
| 534 |
-
Lora_filename6 = ""
|
| 535 |
Lora_target6 = os.path.join(Lora_destination_folder6, Lora_filename6)
|
| 536 |
|
| 537 |
if Lora_download6:
|
|
@@ -541,21 +513,11 @@ if Lora_download6:
|
|
| 541 |
f.write(response.content)
|
| 542 |
|
| 543 |
|
| 544 |
-
|
| 545 |
-
|
| 546 |
# VAE下载
|
| 547 |
|
| 548 |
-
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
|
| 549 |
-
|
| 550 |
-
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 = ""
|
| 551 |
-
|
| 552 |
-
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 = ""
|
| 553 |
-
|
| 554 |
print ("开始下载VAE模型")
|
| 555 |
# VAE任务1
|
| 556 |
-
VAE_url1 = "https://civitai.com/api/download/models/25986"
|
| 557 |
VAE_destination_folder1 = "/bushu/ui/models/VAE"
|
| 558 |
-
VAE_filename1 = "anypastelAnythingV45_anypastelAnythingV45.zip"
|
| 559 |
VAE_target1 = f"{VAE_destination_folder1}/{VAE_filename1}"
|
| 560 |
|
| 561 |
if VAE_download1:
|
|
@@ -564,9 +526,7 @@ if VAE_download1:
|
|
| 564 |
file.write(response.content)
|
| 565 |
|
| 566 |
# VAE任务2
|
| 567 |
-
VAE_url2 = "https://civitai.com/api/download/models/64133"
|
| 568 |
VAE_destination_folder2 = "/bushu/ui/models/VAE"
|
| 569 |
-
VAE_filename2 = "counterfeit.pt"
|
| 570 |
VAE_target2 = f"{VAE_destination_folder2}/{VAE_filename2}"
|
| 571 |
|
| 572 |
if VAE_download2:
|
|
@@ -575,9 +535,7 @@ if VAE_download2:
|
|
| 575 |
file.write(response.content)
|
| 576 |
|
| 577 |
# VAE任务3
|
| 578 |
-
VAE_url3 = "https://civitai.com/api/download/models/80869?type=Model&format=Other"
|
| 579 |
VAE_destination_folder3 = "/bushu/ui/models/VAE"
|
| 580 |
-
VAE_filename3 = "vaeFtMse840000Ema_v100.safetensors"
|
| 581 |
VAE_target3 = f"{VAE_destination_folder3}/{VAE_filename3}"
|
| 582 |
|
| 583 |
if VAE_download3:
|
|
@@ -586,9 +544,7 @@ if VAE_download3:
|
|
| 586 |
file.write(response.content)
|
| 587 |
|
| 588 |
# VAE任务4
|
| 589 |
-
VAE_url4 = "https://huggingface.co/admruul/anything-v3.0/resolve/main/Anything-V3.0.vae.pt"
|
| 590 |
VAE_destination_folder4 = "/bushu/ui/models/VAE"
|
| 591 |
-
VAE_filename4 = "Anything-V3.0.pt"
|
| 592 |
VAE_target4 = f"{VAE_destination_folder4}/{VAE_filename4}"
|
| 593 |
|
| 594 |
if VAE_download4:
|
|
@@ -597,9 +553,7 @@ if VAE_download4:
|
|
| 597 |
file.write(response.content)
|
| 598 |
|
| 599 |
# VAE任务5
|
| 600 |
-
VAE_url5 = "https://civitai.com/api/download/models/131654?type=Model&format=SafeTensor"
|
| 601 |
VAE_destination_folder5 = "/bushu/ui/models/VAE"
|
| 602 |
-
VAE_filename5 = "anythingKlF8Anime2VaeFtMse840000_klF8Anime2.safetensors"
|
| 603 |
VAE_target5 = f"{VAE_destination_folder5}/{VAE_filename5}"
|
| 604 |
|
| 605 |
if VAE_download5:
|
|
@@ -608,9 +562,7 @@ if VAE_download5:
|
|
| 608 |
file.write(response.content)
|
| 609 |
|
| 610 |
# VAE任务6
|
| 611 |
-
VAE_url6 = "https://civitai.com/api/download/models/88156?type=Model&format=Other"
|
| 612 |
VAE_destination_folder6 = "/bushu/ui/models/VAE"
|
| 613 |
-
VAE_filename6 = "ClearVAE.2.3.pt"
|
| 614 |
VAE_target6 = f"{VAE_destination_folder6}/{VAE_filename6}"
|
| 615 |
|
| 616 |
if VAE_download6:
|
|
@@ -619,9 +571,7 @@ if VAE_download6:
|
|
| 619 |
file.write(response.content)
|
| 620 |
|
| 621 |
# VAE任务7
|
| 622 |
-
VAE_url7 = "https://civitai.com/api/download/models/121354?type=Model&format=Other"
|
| 623 |
VAE_destination_folder7 = "/bushu/ui/models/VAE"
|
| 624 |
-
VAE_filename7 = "orangemix_v1.pt"
|
| 625 |
VAE_target7 = f"{VAE_destination_folder7}/{VAE_filename7}"
|
| 626 |
|
| 627 |
if VAE_download7:
|
|
@@ -630,9 +580,7 @@ if VAE_download7:
|
|
| 630 |
file.write(response.content)
|
| 631 |
|
| 632 |
# VAE任务8
|
| 633 |
-
VAE_url8 = "https://civitai.com/api/download/models/28569?type=Model&format=Other"
|
| 634 |
VAE_destination_folder8 = "/bushu/ui/models/VAE"
|
| 635 |
-
VAE_filename8 = "klF8Anime2_klF8Anime2VAE.pt"
|
| 636 |
VAE_target8 = f"{VAE_destination_folder8}/{VAE_filename8}"
|
| 637 |
|
| 638 |
if VAE_download8:
|
|
@@ -641,9 +589,7 @@ if VAE_download8:
|
|
| 641 |
file.write(response.content)
|
| 642 |
|
| 643 |
# VAE任务9
|
| 644 |
-
VAE_url9 = ""
|
| 645 |
VAE_destination_folder9 = "/bushu/ui/models/VAE"
|
| 646 |
-
VAE_filename9 = ""
|
| 647 |
VAE_target9 = f"{VAE_destination_folder9}/{VAE_filename9}"
|
| 648 |
|
| 649 |
if VAE_download9:
|
|
@@ -652,9 +598,7 @@ if VAE_download9:
|
|
| 652 |
file.write(response.content)
|
| 653 |
|
| 654 |
# VAE任务10
|
| 655 |
-
VAE_url10 = ""
|
| 656 |
VAE_destination_folder10 = "/bushu/ui/models/VAE"
|
| 657 |
-
VAE_filename10 = ""
|
| 658 |
VAE_target10 = f"{VAE_destination_folder10}/{VAE_filename10}"
|
| 659 |
|
| 660 |
if VAE_download10:
|
|
@@ -663,9 +607,7 @@ if VAE_download10:
|
|
| 663 |
file.write(response.content)
|
| 664 |
|
| 665 |
# VAE任务11
|
| 666 |
-
VAE_url11 = ""
|
| 667 |
VAE_destination_folder11 = "/bushu/ui/models/VAE"
|
| 668 |
-
VAE_filename11 = ""
|
| 669 |
VAE_target11 = f"{VAE_destination_folder11}/{VAE_filename11}"
|
| 670 |
|
| 671 |
if VAE_download11:
|
|
@@ -674,9 +616,7 @@ if VAE_download11:
|
|
| 674 |
file.write(response.content)
|
| 675 |
|
| 676 |
# VAE任务12
|
| 677 |
-
VAE_url12 = ""
|
| 678 |
VAE_destination_folder12 = "/bushu/ui/models/VAE"
|
| 679 |
-
VAE_filename12 = ""
|
| 680 |
VAE_target12 = f"{VAE_destination_folder12}/{VAE_filename12}"
|
| 681 |
|
| 682 |
if VAE_download12:
|
|
@@ -685,9 +625,7 @@ if VAE_download12:
|
|
| 685 |
file.write(response.content)
|
| 686 |
|
| 687 |
# VAE任务13
|
| 688 |
-
VAE_url13 = ""
|
| 689 |
VAE_destination_folder13 = "/bushu/ui/models/VAE"
|
| 690 |
-
VAE_filename13 = ""
|
| 691 |
VAE_target13 = f"{VAE_destination_folder13}/{VAE_filename13}"
|
| 692 |
|
| 693 |
if VAE_download13:
|
|
@@ -696,68 +634,58 @@ if VAE_download13:
|
|
| 696 |
file.write(response.content)
|
| 697 |
|
| 698 |
|
| 699 |
-
|
| 700 |
# embeddings模型下载
|
| 701 |
|
| 702 |
-
embeddings_download1 = embeddings_download2 = embeddings_download3 = embeddings_download4 = embeddings_download5 = False
|
| 703 |
-
|
| 704 |
-
embeddings_url1 = embeddings_url2 = embeddings_url3 = embeddings_url4 = embeddings_url5 = ""
|
| 705 |
-
|
| 706 |
-
embeddings_filename1 = embeddings_filename2 = embeddings_filename3 = embeddings_filename4 = embeddings_filename5 = ""
|
| 707 |
-
|
| 708 |
print ("开始下载embeddings模型")
|
| 709 |
-
#
|
| 710 |
-
def download_file(url, destination_folder, filename):
|
| 711 |
-
os.makedirs(destination_folder, exist_ok=True)
|
| 712 |
-
response = requests.get(url)
|
| 713 |
-
with open(os.path.join(destination_folder, filename), 'wb') as file:
|
| 714 |
-
file.write(response.content)
|
| 715 |
-
|
| 716 |
-
# _下载任务1_
|
| 717 |
-
embeddings_url1 = "https://civitai.com/api/download/models/125849"
|
| 718 |
embeddings_destination_folder1 = "/bushu/ui/embeddings"
|
| 719 |
-
embeddings_filename1 = "bad-hands-5.pt"
|
| 720 |
embeddings_target1 = f'{embeddings_destination_folder1}/{embeddings_filename1}'
|
| 721 |
|
| 722 |
if embeddings_download1:
|
| 723 |
-
|
|
|
|
|
|
|
|
|
|
| 724 |
|
| 725 |
-
#
|
| 726 |
-
embeddings_url2 = ""
|
| 727 |
embeddings_destination_folder2 = "/bushu/ui/embeddings"
|
| 728 |
-
embeddings_filename2 = ""
|
| 729 |
embeddings_target2 = f'{embeddings_destination_folder2}/{embeddings_filename2}'
|
| 730 |
|
| 731 |
if embeddings_download2:
|
| 732 |
-
|
|
|
|
|
|
|
|
|
|
| 733 |
|
| 734 |
-
#
|
| 735 |
-
embeddings_url3 = ""
|
| 736 |
embeddings_destination_folder3 = "/bushu/ui/embeddings"
|
| 737 |
-
embeddings_filename3 = ""
|
| 738 |
embeddings_target3 = f'{embeddings_destination_folder3}/{embeddings_filename3}'
|
| 739 |
|
| 740 |
if embeddings_download3:
|
| 741 |
-
|
|
|
|
|
|
|
|
|
|
| 742 |
|
| 743 |
-
#
|
| 744 |
-
embeddings_url4 = ""
|
| 745 |
embeddings_destination_folder4 = "/bushu/ui/embeddings"
|
| 746 |
-
embeddings_filename4 = ""
|
| 747 |
embeddings_target4 = f'{embeddings_destination_folder4}/{embeddings_filename4}'
|
| 748 |
|
| 749 |
if embeddings_download4:
|
| 750 |
-
|
|
|
|
|
|
|
|
|
|
| 751 |
|
| 752 |
-
#
|
| 753 |
-
embeddings_url5 = ""
|
| 754 |
embeddings_destination_folder5 = "/bushu/ui/embeddings"
|
| 755 |
-
embeddings_filename5 = ""
|
| 756 |
embeddings_target5 = f'{embeddings_destination_folder5}/{embeddings_filename5}'
|
| 757 |
|
| 758 |
if embeddings_download5:
|
| 759 |
-
|
| 760 |
-
|
|
|
|
|
|
|
| 761 |
|
| 762 |
|
| 763 |
print ("开始安装依赖")
|
|
|
|
| 79 |
st = ""
|
| 80 |
ca = ""
|
| 81 |
t = ""
|
| 82 |
+
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
|
| 83 |
+
|
| 84 |
+
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 = ""
|
| 85 |
+
|
| 86 |
+
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 = ""
|
| 87 |
+
|
| 88 |
+
Lora_download1 = Lora_download2 = Lora_download3 = Lora_download4 = Lora_download5 = Lora_download6 = False
|
| 89 |
+
|
| 90 |
+
Lora_url1 = Lora_url2 = Lora_url3 = Lora_url4 = Lora_url5 = Lora_url6 = ""
|
| 91 |
+
|
| 92 |
+
Lora_filename1 = Lora_filename2 = Lora_filename3 = Lora_filename4 = Lora_filename5 = Lora_filename6 = ""
|
| 93 |
+
|
| 94 |
+
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
|
| 95 |
+
|
| 96 |
+
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 = ""
|
| 97 |
+
|
| 98 |
+
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 = ""
|
| 99 |
+
|
| 100 |
+
embeddings_download1 = embeddings_download2 = embeddings_download3 = embeddings_download4 = embeddings_download5 = False
|
| 101 |
+
|
| 102 |
+
embeddings_url1 = embeddings_url2 = embeddings_url3 = embeddings_url4 = embeddings_url5 = ""
|
| 103 |
+
|
| 104 |
+
embeddings_filename1 = embeddings_filename2 = embeddings_filename3 = embeddings_filename4 = embeddings_filename5 = ""
|
| 105 |
|
| 106 |
# 打开并执行txt文件
|
| 107 |
with open('BianLiang.txt', 'r') as file:
|
|
|
|
| 313 |
print(line.replace('["sd_model_checkpoint"]', '["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"]'), end='')
|
| 314 |
|
| 315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
|
| 317 |
"""# 模型下载"""
|
| 318 |
|
| 319 |
print ("开始下载Checkpoints/safetensors等大模型")
|
| 320 |
# Checkpoints/safetensors等大模型下载
|
| 321 |
# 下载任务1
|
|
|
|
| 322 |
CS_destination_folder1 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 323 |
CS_target1 = f"{CS_destination_folder1}/{CS_filename1}"
|
| 324 |
|
| 325 |
if CS_download1:
|
|
|
|
| 329 |
f.write(response.content)
|
| 330 |
|
| 331 |
# 下载任务2
|
|
|
|
| 332 |
CS_destination_folder2 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 333 |
CS_target2 = f"{CS_destination_folder2}/{CS_filename2}"
|
| 334 |
|
| 335 |
if CS_download2:
|
|
|
|
| 339 |
f.write(response.content)
|
| 340 |
|
| 341 |
# 下载任务3
|
|
|
|
| 342 |
CS_destination_folder3 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 343 |
CS_target3 = f"{CS_destination_folder3}/{CS_filename3}"
|
| 344 |
|
| 345 |
if CS_download3:
|
|
|
|
| 349 |
f.write(response.content)
|
| 350 |
|
| 351 |
# 下载任务4
|
|
|
|
| 352 |
CS_destination_folder4 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 353 |
CS_target4 = f"{CS_destination_folder4}/{CS_filename4}"
|
| 354 |
|
| 355 |
if CS_download4:
|
|
|
|
| 359 |
f.write(response.content)
|
| 360 |
|
| 361 |
# 下载任务5
|
|
|
|
| 362 |
CS_destination_folder5 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 363 |
CS_target5 = f"{CS_destination_folder5}/{CS_filename5}"
|
| 364 |
|
| 365 |
if CS_download5:
|
|
|
|
| 369 |
f.write(response.content)
|
| 370 |
|
| 371 |
# 下载任务6
|
|
|
|
| 372 |
CS_destination_folder6 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 373 |
CS_target6 = f"{CS_destination_folder6}/{CS_filename6}"
|
| 374 |
|
| 375 |
if CS_download6:
|
|
|
|
| 379 |
f.write(response.content)
|
| 380 |
|
| 381 |
# 下载任务7
|
|
|
|
| 382 |
CS_destination_folder7 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 383 |
CS_target7 = f"{CS_destination_folder7}/{CS_filename7}"
|
| 384 |
|
| 385 |
if CS_download7:
|
|
|
|
| 389 |
f.write(response.content)
|
| 390 |
|
| 391 |
# 下载任务8
|
|
|
|
| 392 |
CS_destination_folder8 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 393 |
CS_target8 = f"{CS_destination_folder8}/{CS_filename8}"
|
| 394 |
|
| 395 |
if CS_download8:
|
|
|
|
| 399 |
f.write(response.content)
|
| 400 |
|
| 401 |
# 下载任务9
|
|
|
|
| 402 |
CS_destination_folder9 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 403 |
CS_target9 = f"{CS_destination_folder9}/{CS_filename9}"
|
| 404 |
|
| 405 |
if CS_download9:
|
|
|
|
| 409 |
f.write(response.content)
|
| 410 |
|
| 411 |
# 下载任务10
|
|
|
|
| 412 |
CS_destination_folder10 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 413 |
CS_target10 = f"{CS_destination_folder10}/{CS_filename10}"
|
| 414 |
|
| 415 |
if CS_download10:
|
|
|
|
| 419 |
f.write(response.content)
|
| 420 |
|
| 421 |
# 下载任务11
|
|
|
|
| 422 |
CS_destination_folder11 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 423 |
CS_target11 = f"{CS_destination_folder11}/{CS_filename11}"
|
| 424 |
|
| 425 |
if CS_download11:
|
|
|
|
| 429 |
f.write(response.content)
|
| 430 |
|
| 431 |
# 下载任务12
|
|
|
|
| 432 |
CS_destination_folder12 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 433 |
CS_target12 = f"{CS_destination_folder12}/{CS_filename12}"
|
| 434 |
|
| 435 |
if CS_download12:
|
|
|
|
| 439 |
f.write(response.content)
|
| 440 |
|
| 441 |
# 下载任务13
|
|
|
|
| 442 |
CS_destination_folder13 = f"/bushu/ui/models/Stable-diffusion"
|
|
|
|
| 443 |
CS_target13 = f"{CS_destination_folder13}/{CS_filename13}"
|
| 444 |
|
| 445 |
if CS_download13:
|
|
|
|
| 449 |
f.write(response.content)
|
| 450 |
|
| 451 |
|
|
|
|
| 452 |
#Lora模型下载
|
| 453 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 454 |
print("开始下载Lora模型")
|
| 455 |
# Lora任务1
|
|
|
|
| 456 |
Lora_destination_folder1 = "/bushu/ui/models/Lora"
|
|
|
|
| 457 |
Lora_target1 = os.path.join(Lora_destination_folder1, Lora_filename1)
|
| 458 |
|
| 459 |
if Lora_download1:
|
|
|
|
| 463 |
f.write(response.content)
|
| 464 |
|
| 465 |
# Lora任务2
|
|
|
|
| 466 |
Lora_destination_folder2 = "/bushu/ui/models/Lora"
|
|
|
|
| 467 |
Lora_target2 = os.path.join(Lora_destination_folder2, Lora_filename2)
|
| 468 |
|
| 469 |
if Lora_download2:
|
|
|
|
| 473 |
f.write(response.content)
|
| 474 |
|
| 475 |
# Lora任务3
|
|
|
|
| 476 |
Lora_destination_folder3 = "/bushu/ui/models/Lora"
|
|
|
|
| 477 |
Lora_target3 = os.path.join(Lora_destination_folder3, Lora_filename3)
|
| 478 |
|
| 479 |
if Lora_download3:
|
|
|
|
| 483 |
f.write(response.content)
|
| 484 |
|
| 485 |
# Lora任务4
|
|
|
|
| 486 |
Lora_destination_folder4 = Lora_destination_folder3
|
|
|
|
| 487 |
Lora_target4 = os.path.join(Lora_destination_folder4, Lora_filename4)
|
| 488 |
|
| 489 |
if Lora_download4:
|
|
|
|
| 493 |
f.write(response.content)
|
| 494 |
|
| 495 |
# Lora任务5
|
|
|
|
| 496 |
Lora_destination_folder5 = Lora_destination_folder3
|
|
|
|
| 497 |
Lora_target5 = os.path.join(Lora_destination_folder5, Lora_filename5)
|
| 498 |
|
| 499 |
if Lora_download5:
|
|
|
|
| 503 |
f.write(response.content)
|
| 504 |
|
| 505 |
# Lora任务6
|
|
|
|
| 506 |
Lora_destination_folder6 = Lora_destination_folder3
|
|
|
|
| 507 |
Lora_target6 = os.path.join(Lora_destination_folder6, Lora_filename6)
|
| 508 |
|
| 509 |
if Lora_download6:
|
|
|
|
| 513 |
f.write(response.content)
|
| 514 |
|
| 515 |
|
|
|
|
|
|
|
| 516 |
# VAE下载
|
| 517 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 518 |
print ("开始下载VAE模型")
|
| 519 |
# VAE任务1
|
|
|
|
| 520 |
VAE_destination_folder1 = "/bushu/ui/models/VAE"
|
|
|
|
| 521 |
VAE_target1 = f"{VAE_destination_folder1}/{VAE_filename1}"
|
| 522 |
|
| 523 |
if VAE_download1:
|
|
|
|
| 526 |
file.write(response.content)
|
| 527 |
|
| 528 |
# VAE任务2
|
|
|
|
| 529 |
VAE_destination_folder2 = "/bushu/ui/models/VAE"
|
|
|
|
| 530 |
VAE_target2 = f"{VAE_destination_folder2}/{VAE_filename2}"
|
| 531 |
|
| 532 |
if VAE_download2:
|
|
|
|
| 535 |
file.write(response.content)
|
| 536 |
|
| 537 |
# VAE任务3
|
|
|
|
| 538 |
VAE_destination_folder3 = "/bushu/ui/models/VAE"
|
|
|
|
| 539 |
VAE_target3 = f"{VAE_destination_folder3}/{VAE_filename3}"
|
| 540 |
|
| 541 |
if VAE_download3:
|
|
|
|
| 544 |
file.write(response.content)
|
| 545 |
|
| 546 |
# VAE任务4
|
|
|
|
| 547 |
VAE_destination_folder4 = "/bushu/ui/models/VAE"
|
|
|
|
| 548 |
VAE_target4 = f"{VAE_destination_folder4}/{VAE_filename4}"
|
| 549 |
|
| 550 |
if VAE_download4:
|
|
|
|
| 553 |
file.write(response.content)
|
| 554 |
|
| 555 |
# VAE任务5
|
|
|
|
| 556 |
VAE_destination_folder5 = "/bushu/ui/models/VAE"
|
|
|
|
| 557 |
VAE_target5 = f"{VAE_destination_folder5}/{VAE_filename5}"
|
| 558 |
|
| 559 |
if VAE_download5:
|
|
|
|
| 562 |
file.write(response.content)
|
| 563 |
|
| 564 |
# VAE任务6
|
|
|
|
| 565 |
VAE_destination_folder6 = "/bushu/ui/models/VAE"
|
|
|
|
| 566 |
VAE_target6 = f"{VAE_destination_folder6}/{VAE_filename6}"
|
| 567 |
|
| 568 |
if VAE_download6:
|
|
|
|
| 571 |
file.write(response.content)
|
| 572 |
|
| 573 |
# VAE任务7
|
|
|
|
| 574 |
VAE_destination_folder7 = "/bushu/ui/models/VAE"
|
|
|
|
| 575 |
VAE_target7 = f"{VAE_destination_folder7}/{VAE_filename7}"
|
| 576 |
|
| 577 |
if VAE_download7:
|
|
|
|
| 580 |
file.write(response.content)
|
| 581 |
|
| 582 |
# VAE任务8
|
|
|
|
| 583 |
VAE_destination_folder8 = "/bushu/ui/models/VAE"
|
|
|
|
| 584 |
VAE_target8 = f"{VAE_destination_folder8}/{VAE_filename8}"
|
| 585 |
|
| 586 |
if VAE_download8:
|
|
|
|
| 589 |
file.write(response.content)
|
| 590 |
|
| 591 |
# VAE任务9
|
|
|
|
| 592 |
VAE_destination_folder9 = "/bushu/ui/models/VAE"
|
|
|
|
| 593 |
VAE_target9 = f"{VAE_destination_folder9}/{VAE_filename9}"
|
| 594 |
|
| 595 |
if VAE_download9:
|
|
|
|
| 598 |
file.write(response.content)
|
| 599 |
|
| 600 |
# VAE任务10
|
|
|
|
| 601 |
VAE_destination_folder10 = "/bushu/ui/models/VAE"
|
|
|
|
| 602 |
VAE_target10 = f"{VAE_destination_folder10}/{VAE_filename10}"
|
| 603 |
|
| 604 |
if VAE_download10:
|
|
|
|
| 607 |
file.write(response.content)
|
| 608 |
|
| 609 |
# VAE任务11
|
|
|
|
| 610 |
VAE_destination_folder11 = "/bushu/ui/models/VAE"
|
|
|
|
| 611 |
VAE_target11 = f"{VAE_destination_folder11}/{VAE_filename11}"
|
| 612 |
|
| 613 |
if VAE_download11:
|
|
|
|
| 616 |
file.write(response.content)
|
| 617 |
|
| 618 |
# VAE任务12
|
|
|
|
| 619 |
VAE_destination_folder12 = "/bushu/ui/models/VAE"
|
|
|
|
| 620 |
VAE_target12 = f"{VAE_destination_folder12}/{VAE_filename12}"
|
| 621 |
|
| 622 |
if VAE_download12:
|
|
|
|
| 625 |
file.write(response.content)
|
| 626 |
|
| 627 |
# VAE任务13
|
|
|
|
| 628 |
VAE_destination_folder13 = "/bushu/ui/models/VAE"
|
|
|
|
| 629 |
VAE_target13 = f"{VAE_destination_folder13}/{VAE_filename13}"
|
| 630 |
|
| 631 |
if VAE_download13:
|
|
|
|
| 634 |
file.write(response.content)
|
| 635 |
|
| 636 |
|
|
|
|
| 637 |
# embeddings模型下载
|
| 638 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 639 |
print ("开始下载embeddings模型")
|
| 640 |
+
# 下载任务1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 641 |
embeddings_destination_folder1 = "/bushu/ui/embeddings"
|
|
|
|
| 642 |
embeddings_target1 = f'{embeddings_destination_folder1}/{embeddings_filename1}'
|
| 643 |
|
| 644 |
if embeddings_download1:
|
| 645 |
+
os.makedirs(embeddings_destination_folder1, exist_ok=True)
|
| 646 |
+
response = requests.get(embeddings_url1)
|
| 647 |
+
with open(embeddings_target1, 'wb') as file:
|
| 648 |
+
file.write(response.content)
|
| 649 |
|
| 650 |
+
# 下载任务2
|
|
|
|
| 651 |
embeddings_destination_folder2 = "/bushu/ui/embeddings"
|
|
|
|
| 652 |
embeddings_target2 = f'{embeddings_destination_folder2}/{embeddings_filename2}'
|
| 653 |
|
| 654 |
if embeddings_download2:
|
| 655 |
+
os.makedirs(embeddings_destination_folder2, exist_ok=True)
|
| 656 |
+
response = requests.get(embeddings_url2)
|
| 657 |
+
with open(embeddings_target2, 'wb') as file:
|
| 658 |
+
file.write(response.content)
|
| 659 |
|
| 660 |
+
# 下载任务3
|
|
|
|
| 661 |
embeddings_destination_folder3 = "/bushu/ui/embeddings"
|
|
|
|
| 662 |
embeddings_target3 = f'{embeddings_destination_folder3}/{embeddings_filename3}'
|
| 663 |
|
| 664 |
if embeddings_download3:
|
| 665 |
+
os.makedirs(embeddings_destination_folder3, exist_ok=True)
|
| 666 |
+
response = requests.get(embeddings_url3)
|
| 667 |
+
with open(embeddings_target3, 'wb') as file:
|
| 668 |
+
file.write(response.content)
|
| 669 |
|
| 670 |
+
# 下载任务4
|
|
|
|
| 671 |
embeddings_destination_folder4 = "/bushu/ui/embeddings"
|
|
|
|
| 672 |
embeddings_target4 = f'{embeddings_destination_folder4}/{embeddings_filename4}'
|
| 673 |
|
| 674 |
if embeddings_download4:
|
| 675 |
+
os.makedirs(embeddings_destination_folder4, exist_ok=True)
|
| 676 |
+
response = requests.get(embeddings_url4)
|
| 677 |
+
with open(embeddings_target4, 'wb') as file:
|
| 678 |
+
file.write(response.content)
|
| 679 |
|
| 680 |
+
# 下载任务5
|
|
|
|
| 681 |
embeddings_destination_folder5 = "/bushu/ui/embeddings"
|
|
|
|
| 682 |
embeddings_target5 = f'{embeddings_destination_folder5}/{embeddings_filename5}'
|
| 683 |
|
| 684 |
if embeddings_download5:
|
| 685 |
+
os.makedirs(embeddings_destination_folder5, exist_ok=True)
|
| 686 |
+
response = requests.get(embeddings_url5)
|
| 687 |
+
with open(embeddings_target5, 'wb') as file:
|
| 688 |
+
file.write(response.content)
|
| 689 |
|
| 690 |
|
| 691 |
print ("开始安装依赖")
|