BBrother commited on
Commit
8359c5a
1 Parent(s): a3931c2

Update v2_3.py

Browse files
Files changed (1) hide show
  1. v2_3.py +146 -56
v2_3.py CHANGED
@@ -65,6 +65,7 @@ import os
65
  import subprocess
66
  import wget
67
  import fileinput
 
68
 
69
  # 初始化变量
70
  a = ""
@@ -325,7 +326,10 @@ CS_filename1 = "anypastelAnythingV45_anypastelAnythingV45.safetensors"
325
  CS_target1 = f"{CS_destination_folder1}/{CS_filename1}"
326
 
327
  if CS_download_task1:
328
- subprocess.run(["curl", "-o", CS_target1, CS_url1])
 
 
 
329
 
330
  # 下载任务2
331
  CS_download_task2 = False
@@ -335,7 +339,10 @@ CS_filename2 = "07CounterfeitV2503_10.ckpt"
335
  CS_target2 = f"{CS_destination_folder2}/{CS_filename2}"
336
 
337
  if CS_download_task2:
338
- subprocess.run(["curl", "-o", CS_target2, CS_url2])
 
 
 
339
 
340
  # 下载任务3
341
  CS_download_task3 = True
@@ -345,7 +352,10 @@ CS_filename3 = "AnythingV5Ink.safetensors"
345
  CS_target3 = f"{CS_destination_folder3}/{CS_filename3}"
346
 
347
  if CS_download_task3:
348
- subprocess.run(["curl", "-o", CS_target3, CS_url3])
 
 
 
349
 
350
  # 下载任务4
351
  CS_download_task4 = False
@@ -355,7 +365,10 @@ CS_filename4 = "CounterfeitV30_v30.safetensors"
355
  CS_target4 = f"{CS_destination_folder4}/{CS_filename4}"
356
 
357
  if CS_download_task4:
358
- subprocess.run(["curl", "-o", CS_target4, CS_url4])
 
 
 
359
 
360
  # 下载任务5
361
  CS_download_task5 = False
@@ -365,7 +378,10 @@ CS_filename5 = "dreamlike10_10.ckpt"
365
  CS_target5 = f"{CS_destination_folder5}/{CS_filename5}"
366
 
367
  if CS_download_task5:
368
- subprocess.run(["curl", "-o", CS_target5, CS_url5])
 
 
 
369
 
370
  # 下载任务6
371
  CS_download_task6 = True
@@ -375,77 +391,102 @@ CS_filename6 = "abyssorangemix3AOM3_aom3a1b.safetensors"
375
  CS_target6 = f"{CS_destination_folder6}/{CS_filename6}"
376
 
377
  if CS_download_task6:
378
- subprocess.run(["curl", "-o", CS_target6, CS_url6])
 
 
 
379
 
380
  # 下载任务7
381
  CS_download_task7 = False
382
  CS_url7 = ""
383
  CS_destination_folder7 = f"/content/ui/models/Stable-Diffusion"
384
  CS_filename7 = ""
385
- CS_target7 = f"{CS_destination_folder6}/{CS_filename6}"
386
 
387
  if CS_download_task7:
388
- subprocess.run(["curl", "-o", CS_target7, CS_url7])
 
 
 
389
 
390
  # 下载任务8
391
  CS_download_task8 = False
392
  CS_url8 = ""
393
  CS_destination_folder8 = f"/content/ui/models/Stable-Diffusion"
394
  CS_filename8 = ""
395
- CS_target8 = f"{CS_destination_folder6}/{CS_filename6}"
396
 
397
  if CS_download_task8:
398
- subprocess.run(["curl", "-o", CS_target8, CS_url8])
 
 
 
399
 
400
  # 下载任务9
401
  CS_download_task9 = False
402
  CS_url9 = ""
403
  CS_destination_folder9 = f"/content/ui/models/Stable-Diffusion"
404
  CS_filename9 = ""
405
- CS_target9 = f"{CS_destination_folder6}/{CS_filename6}"
406
 
407
  if CS_download_task9:
408
- subprocess.run(["curl", "-o", CS_target9, CS_url9])
 
 
 
409
 
410
  # 下载任务10
411
  CS_download_task10 = False
412
  CS_url10 = ""
413
  CS_destination_folder10 = f"/content/ui/models/Stable-Diffusion"
414
  CS_filename10 = ""
415
- CS_target10 = f"{CS_destination_folder6}/{CS_filename6}"
416
 
417
  if CS_download_task10:
418
- subprocess.run(["curl", "-o", CS_target10, CS_url10])
 
 
 
419
 
420
  # 下载任务11
421
  CS_download_task11 = False
422
  CS_url11 = ""
423
  CS_destination_folder11 = f"/content/ui/models/Stable-Diffusion"
424
  CS_filename11 = ""
425
- CS_target11 = f"{CS_destination_folder6}/{CS_filename6}"
426
 
427
  if CS_download_task11:
428
- subprocess.run(["curl", "-o", CS_target11, CS_url11])
 
 
 
429
 
430
  # 下载任务12
431
  CS_download_task12 = False
432
  CS_url12 = ""
433
  CS_destination_folder12 = f"/content/ui/models/Stable-Diffusion"
434
  CS_filename12 = ""
435
- CS_target12 = f"{CS_destination_folder6}/{CS_filename6}"
436
 
437
  if CS_download_task12:
438
- subprocess.run(["curl", "-o", CS_target12, CS_url12])
 
 
 
439
 
440
  # 下载任务13
441
  CS_download_task13 = False
442
  CS_url13 = ""
443
  CS_destination_folder13 = f"/content/ui/models/Stable-Diffusion"
444
  CS_filename13 = ""
445
- CS_target13 = f"{CS_destination_folder6}/{CS_filename6}"
446
 
447
  if CS_download_task13:
448
- subprocess.run(["curl", "-o", CS_target13, CS_url13])
 
 
 
 
449
 
450
 
451
  #Lora模型下载
@@ -454,60 +495,79 @@ Lora_download_task1 = True
454
  Lora_url1 = "https://civitai.com/api/download/models/64842"
455
  Lora_destination_folder1 = "/content/ui/models/Lora"
456
  Lora_filename1 = "arona_puranalora_v1.safetensors"
457
- Lora_target1 = f"{Lora_destination_folder1}/{Lora_filename1}"
458
 
459
  if Lora_download_task1:
460
- subprocess.run(["wget", Lora_url1, "-O", Lora_target1])
 
 
 
461
 
462
  # Lora任务2
463
  Lora_download_task2 = False
464
  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"
465
  Lora_destination_folder2 = "/content/ui/models/Lora"
466
- Lora_filename2 = "Xian-T\u624B\u90E8\u4FEE\u590Dlora\uFF08\u4E0D%E7%94%A8controlnet\u4E5F%E4%B8%8D%E5%9D%8F%E6%89%8B%E4%BA%86\uFF09_v3.0.safetensors"
467
- Lora_target2 = f"{Lora_destination_folder2}/{Lora_filename2}"
468
 
469
  if Lora_download_task2:
470
- subprocess.run(["wget", Lora_url2, "-O", Lora_target2])
 
 
 
471
 
472
  # Lora任务3
473
  Lora_download_task3 = True
474
  Lora_url3 = "https://civitai.com/api/download/models/52900"
475
  Lora_destination_folder3 = "/content/ui/models/Lora"
476
  Lora_filename3 = "cailaiarona-000007.safetensors"
477
- Lora_target3 = f"{Lora_destination_folder3}/{Lora_filename3}"
478
 
479
  if Lora_download_task3:
480
- subprocess.run(["wget", Lora_url3, "-O", Lora_target3])
 
 
 
481
 
482
  # Lora任务4
483
  Lora_download_task4 = True
484
  Lora_url4 = "https://civitai.com/api/download/models/9409"
485
  Lora_destination_folder4 = Lora_destination_folder3
486
  Lora_filename4 = "chara-arona-v1.safetensors"
487
- Lora_target4 = f"{Lora_destination_folder4}/{Lora_filename4}"
488
 
489
  if Lora_download_task4:
490
- subprocess.run(["wget", Lora_url4, "-O", Lora_target4])
 
 
 
491
 
492
  # Lora任务5
493
  Lora_download_task5 = False
494
  Lora_url5 = ""
495
  Lora_destination_folder5 = Lora_destination_folder3
496
  Lora_filename5 = ""
497
- Lora_target5 = f"{Lora_destination_folder5}/{Lora_filename5}"
498
 
499
  if Lora_download_task5:
500
- subprocess.run(["wget", Lora_url5, "-O", Lora_target5])
 
 
 
501
 
502
  # Lora任务6
503
  Lora_download_task6 = False
504
  Lora_url6 = ""
505
  Lora_destination_folder6 = Lora_destination_folder3
506
  Lora_filename6 = ""
507
- Lora_target6 = f"{Lora_destination_folder6}/{Lora_filename6}"
508
 
509
  if Lora_download_task6:
510
- subprocess.run(["wget", Lora_url6, "-O", Lora_target6])
 
 
 
 
511
 
512
  # VAE下载
513
  # VAE任务1
@@ -518,7 +578,9 @@ VAE_filename1 = "anypastelAnythingV45_anypastelAnythingV45.zip"
518
  VAE_target1 = f"{VAE_destination_folder1}/{VAE_filename1}"
519
 
520
  if VAE_download_task1:
521
- subprocess.run(["wget", VAE_url1, "-O", VAE_target1])
 
 
522
 
523
  # VAE任务2
524
  VAE_download_task2 = True
@@ -528,7 +590,9 @@ VAE_filename2 = "counterfeit.vae.pt"
528
  VAE_target2 = f"{VAE_destination_folder2}/{VAE_filename2}"
529
 
530
  if VAE_download_task2:
531
- subprocess.run(["wget", VAE_url2, "-O", VAE_target2])
 
 
532
 
533
  # VAE任务3
534
  VAE_download_task3 = True
@@ -538,7 +602,9 @@ VAE_filename3 = "vaeFtMse840000Ema_v100.safetensors"
538
  VAE_target3 = f"{VAE_destination_folder3}/{VAE_filename3}"
539
 
540
  if VAE_download_task3:
541
- subprocess.run(["wget", VAE_url3, "-O", VAE_target3])
 
 
542
 
543
  # VAE任务4
544
  VAE_download_task4 = False
@@ -548,7 +614,9 @@ VAE_filename4 = "Anything-V3.0.vae.pt"
548
  VAE_target4 = f"{VAE_destination_folder4}/{VAE_filename4}"
549
 
550
  if VAE_download_task4:
551
- subprocess.run(["wget", VAE_url4, "-O", VAE_target4])
 
 
552
 
553
  # VAE任务5
554
  VAE_download_task5 = True
@@ -558,7 +626,9 @@ VAE_filename5 = "anythingKlF8Anime2VaeFtMse840000_klF8Anime2.safetensors"
558
  VAE_target5 = f"{VAE_destination_folder5}/{VAE_filename5}"
559
 
560
  if VAE_download_task5:
561
- subprocess.run(["wget", VAE_url5, "-O", VAE_target5])
 
 
562
 
563
  # VAE任务6
564
  VAE_download_task6 = True
@@ -568,7 +638,9 @@ VAE_filename6 = "ClearVAE.2.3.vae.pt"
568
  VAE_target6 = f"{VAE_destination_folder6}/{VAE_filename6}"
569
 
570
  if VAE_download_task6:
571
- subprocess.run(["wget", VAE_url6, "-O", VAE_target6])
 
 
572
 
573
  # VAE任务7
574
  VAE_download_task7 = True
@@ -578,7 +650,9 @@ VAE_filename7 = "orangemix_v1.pt"
578
  VAE_target7 = f"{VAE_destination_folder7}/{VAE_filename7}"
579
 
580
  if VAE_download_task7:
581
- subprocess.run(["wget", VAE_url7, "-O", VAE_target7])
 
 
582
 
583
  # VAE任务8
584
  VAE_download_task8 = True
@@ -588,7 +662,9 @@ VAE_filename8 = "klF8Anime2_klF8Anime2VAE.pt"
588
  VAE_target8 = f"{VAE_destination_folder8}/{VAE_filename8}"
589
 
590
  if VAE_download_task8:
591
- subprocess.run(["wget", VAE_url8, "-O", VAE_target8])
 
 
592
 
593
  # VAE任务9
594
  VAE_download_task9 = False
@@ -598,7 +674,9 @@ VAE_filename9 = ""
598
  VAE_target9 = f"{VAE_destination_folder9}/{VAE_filename9}"
599
 
600
  if VAE_download_task9:
601
- subprocess.run(["wget", VAE_url9, "-O", VAE_target9])
 
 
602
 
603
  # VAE任务10
604
  VAE_download_task10 = False
@@ -608,7 +686,9 @@ VAE_filename10 = ""
608
  VAE_target10 = f"{VAE_destination_folder10}/{VAE_filename10}"
609
 
610
  if VAE_download_task10:
611
- subprocess.run(["wget", VAE_url10, "-O", VAE_target10])
 
 
612
 
613
  # VAE任务11
614
  VAE_download_task11 = False
@@ -618,7 +698,9 @@ VAE_filename11 = ""
618
  VAE_target11 = f"{VAE_destination_folder11}/{VAE_filename11}"
619
 
620
  if VAE_download_task11:
621
- subprocess.run(["wget", VAE_url11, "-O", VAE_target11])
 
 
622
 
623
  # VAE任务12
624
  VAE_download_task12 = False
@@ -628,7 +710,9 @@ VAE_filename12 = ""
628
  VAE_target12 = f"{VAE_destination_folder12}/{VAE_filename12}"
629
 
630
  if VAE_download_task12:
631
- subprocess.run(["wget", VAE_url12, "-O", VAE_target12])
 
 
632
 
633
  # VAE任务13
634
  VAE_download_task13 = False
@@ -638,11 +722,20 @@ VAE_filename13 = ""
638
  VAE_target13 = f"{VAE_destination_folder13}/{VAE_filename13}"
639
 
640
  if VAE_download_task13:
641
- subprocess.run(["wget", VAE_url13, "-O", VAE_target13])
 
 
 
642
 
643
 
644
  # embeddings模型下载
645
- # 任务1
 
 
 
 
 
 
646
  # _下载任务1_
647
  embeddings_download_task1 = True #@param {type:"boolean"}
648
  embeddings_url1 = "https://civitai.com/api/download/models/125849"
@@ -651,9 +744,8 @@ embeddings_filename1 = "bad-hands-5.pt"
651
  embeddings_target1 = f'{embeddings_destination_folder1}/{embeddings_filename1}'
652
 
653
  if embeddings_download_task1:
654
- subprocess.run(['wget', '-O', embeddings_target1, embeddings_url1])
655
 
656
- # 任务2
657
  # _下载任务2_
658
  embeddings_download_task2 = False #@param {type:"boolean"}
659
  embeddings_url2 = ""
@@ -662,9 +754,8 @@ embeddings_filename2 = ""
662
  embeddings_target2 = f'{embeddings_destination_folder2}/{embeddings_filename2}'
663
 
664
  if embeddings_download_task2:
665
- subprocess.run(['wget', '-O', embeddings_target2, embeddings_url2])
666
 
667
- # 任务3
668
  # _下载任务3_
669
  embeddings_download_task3 = False #@param {type:"boolean"}
670
  embeddings_url3 = ""
@@ -673,9 +764,8 @@ embeddings_filename3 = ""
673
  embeddings_target3 = f'{embeddings_destination_folder3}/{embeddings_filename3}'
674
 
675
  if embeddings_download_task3:
676
- subprocess.run(['wget', '-O', embeddings_target3, embeddings_url3])
677
 
678
- # 任务4
679
  # _下载任务4_
680
  embeddings_download_task4 = False #@param {type:"boolean"}
681
  embeddings_url4 = ""
@@ -684,9 +774,8 @@ embeddings_filename4 = ""
684
  embeddings_target4 = f'{embeddings_destination_folder4}/{embeddings_filename4}'
685
 
686
  if embeddings_download_task4:
687
- subprocess.run(['wget', '-O', embeddings_target4, embeddings_url4])
688
 
689
- # 任务5
690
  # _下载任务5_
691
  embeddings_download_task5 = False #@param {type:"boolean"}
692
  embeddings_url5 = ""
@@ -695,7 +784,8 @@ embeddings_filename5 = ""
695
  embeddings_target5 = f'{embeddings_destination_folder5}/{embeddings_filename5}'
696
 
697
  if embeddings_download_task5:
698
- subprocess.run(['wget', '-O', embeddings_target5, embeddings_url5])
 
699
 
700
 
701
 
 
65
  import subprocess
66
  import wget
67
  import fileinput
68
+ import requests
69
 
70
  # 初始化变量
71
  a = ""
 
326
  CS_target1 = f"{CS_destination_folder1}/{CS_filename1}"
327
 
328
  if CS_download_task1:
329
+ os.makedirs(CS_destination_folder1, exist_ok=True)
330
+ response = requests.get(CS_url1)
331
+ with open(CS_target1, 'wb') as f:
332
+ f.write(response.content)
333
 
334
  # 下载任务2
335
  CS_download_task2 = False
 
339
  CS_target2 = f"{CS_destination_folder2}/{CS_filename2}"
340
 
341
  if CS_download_task2:
342
+ os.makedirs(CS_destination_folder2, exist_ok=True)
343
+ response = requests.get(CS_url2)
344
+ with open(CS_target2, 'wb') as f:
345
+ f.write(response.content)
346
 
347
  # 下载任务3
348
  CS_download_task3 = True
 
352
  CS_target3 = f"{CS_destination_folder3}/{CS_filename3}"
353
 
354
  if CS_download_task3:
355
+ os.makedirs(CS_destination_folder3, exist_ok=True)
356
+ response = requests.get(CS_url3)
357
+ with open(CS_target3, 'wb') as f:
358
+ f.write(response.content)
359
 
360
  # 下载任务4
361
  CS_download_task4 = False
 
365
  CS_target4 = f"{CS_destination_folder4}/{CS_filename4}"
366
 
367
  if CS_download_task4:
368
+ os.makedirs(CS_destination_folder4, exist_ok=True)
369
+ response = requests.get(CS_url4)
370
+ with open(CS_target4, 'wb') as f:
371
+ f.write(response.content)
372
 
373
  # 下载任务5
374
  CS_download_task5 = False
 
378
  CS_target5 = f"{CS_destination_folder5}/{CS_filename5}"
379
 
380
  if CS_download_task5:
381
+ os.makedirs(CS_destination_folder5, exist_ok=True)
382
+ response = requests.get(CS_url5)
383
+ with open(CS_target5, 'wb') as f:
384
+ f.write(response.content)
385
 
386
  # 下载任务6
387
  CS_download_task6 = True
 
391
  CS_target6 = f"{CS_destination_folder6}/{CS_filename6}"
392
 
393
  if CS_download_task6:
394
+ os.makedirs(CS_destination_folder6, exist_ok=True)
395
+ response = requests.get(CS_url6)
396
+ with open(CS_target6, 'wb') as f:
397
+ f.write(response.content)
398
 
399
  # 下载任务7
400
  CS_download_task7 = False
401
  CS_url7 = ""
402
  CS_destination_folder7 = f"/content/ui/models/Stable-Diffusion"
403
  CS_filename7 = ""
404
+ CS_target7 = f"{CS_destination_folder7}/{CS_filename7}"
405
 
406
  if CS_download_task7:
407
+ os.makedirs(CS_destination_folder7, exist_ok=True)
408
+ response = requests.get(CS_url7)
409
+ with open(CS_target7, 'wb') as f:
410
+ f.write(response.content)
411
 
412
  # 下载任务8
413
  CS_download_task8 = False
414
  CS_url8 = ""
415
  CS_destination_folder8 = f"/content/ui/models/Stable-Diffusion"
416
  CS_filename8 = ""
417
+ CS_target8 = f"{CS_destination_folder8}/{CS_filename8}"
418
 
419
  if CS_download_task8:
420
+ os.makedirs(CS_destination_folder8, exist_ok=True)
421
+ response = requests.get(CS_url8)
422
+ with open(CS_target8, 'wb') as f:
423
+ f.write(response.content)
424
 
425
  # 下载任务9
426
  CS_download_task9 = False
427
  CS_url9 = ""
428
  CS_destination_folder9 = f"/content/ui/models/Stable-Diffusion"
429
  CS_filename9 = ""
430
+ CS_target9 = f"{CS_destination_folder9}/{CS_filename9}"
431
 
432
  if CS_download_task9:
433
+ os.makedirs(CS_destination_folder9, exist_ok=True)
434
+ response = requests.get(CS_url9)
435
+ with open(CS_target9, 'wb') as f:
436
+ f.write(response.content)
437
 
438
  # 下载任务10
439
  CS_download_task10 = False
440
  CS_url10 = ""
441
  CS_destination_folder10 = f"/content/ui/models/Stable-Diffusion"
442
  CS_filename10 = ""
443
+ CS_target10 = f"{CS_destination_folder10}/{CS_filename10}"
444
 
445
  if CS_download_task10:
446
+ os.makedirs(CS_destination_folder10, exist_ok=True)
447
+ response = requests.get(CS_url10)
448
+ with open(CS_target10, 'wb') as f:
449
+ f.write(response.content)
450
 
451
  # 下载任务11
452
  CS_download_task11 = False
453
  CS_url11 = ""
454
  CS_destination_folder11 = f"/content/ui/models/Stable-Diffusion"
455
  CS_filename11 = ""
456
+ CS_target11 = f"{CS_destination_folder11}/{CS_filename11}"
457
 
458
  if CS_download_task11:
459
+ os.makedirs(CS_destination_folder11, exist_ok=True)
460
+ response = requests.get(CS_url11)
461
+ with open(CS_target11, 'wb') as f:
462
+ f.write(response.content)
463
 
464
  # 下载任务12
465
  CS_download_task12 = False
466
  CS_url12 = ""
467
  CS_destination_folder12 = f"/content/ui/models/Stable-Diffusion"
468
  CS_filename12 = ""
469
+ CS_target12 = f"{CS_destination_folder12}/{CS_filename12}"
470
 
471
  if CS_download_task12:
472
+ os.makedirs(CS_destination_folder12, exist_ok=True)
473
+ response = requests.get(CS_url12)
474
+ with open(CS_target12, 'wb') as f:
475
+ f.write(response.content)
476
 
477
  # 下载任务13
478
  CS_download_task13 = False
479
  CS_url13 = ""
480
  CS_destination_folder13 = f"/content/ui/models/Stable-Diffusion"
481
  CS_filename13 = ""
482
+ CS_target13 = f"{CS_destination_folder13}/{CS_filename13}"
483
 
484
  if CS_download_task13:
485
+ os.makedirs(CS_destination_folder13, exist_ok=True)
486
+ response = requests.get(CS_url13)
487
+ with open(CS_target13, 'wb') as f:
488
+ f.write(response.content)
489
+
490
 
491
 
492
  #Lora模型下载
 
495
  Lora_url1 = "https://civitai.com/api/download/models/64842"
496
  Lora_destination_folder1 = "/content/ui/models/Lora"
497
  Lora_filename1 = "arona_puranalora_v1.safetensors"
498
+ Lora_target1 = os.path.join(Lora_destination_folder1, Lora_filename1)
499
 
500
  if Lora_download_task1:
501
+ response = requests.get(Lora_url1)
502
+ if response.status_code == 200:
503
+ with open(Lora_target1, 'wb') as f:
504
+ f.write(response.content)
505
 
506
  # Lora任务2
507
  Lora_download_task2 = False
508
  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"
509
  Lora_destination_folder2 = "/content/ui/models/Lora"
510
+ 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"
511
+ Lora_target2 = os.path.join(Lora_destination_folder2, Lora_filename2)
512
 
513
  if Lora_download_task2:
514
+ response = requests.get(Lora_url2)
515
+ if response.status_code == 200:
516
+ with open(Lora_target2, 'wb') as f:
517
+ f.write(response.content)
518
 
519
  # Lora任务3
520
  Lora_download_task3 = True
521
  Lora_url3 = "https://civitai.com/api/download/models/52900"
522
  Lora_destination_folder3 = "/content/ui/models/Lora"
523
  Lora_filename3 = "cailaiarona-000007.safetensors"
524
+ Lora_target3 = os.path.join(Lora_destination_folder3, Lora_filename3)
525
 
526
  if Lora_download_task3:
527
+ response = requests.get(Lora_url3)
528
+ if response.status_code == 200:
529
+ with open(Lora_target3, 'wb') as f:
530
+ f.write(response.content)
531
 
532
  # Lora任务4
533
  Lora_download_task4 = True
534
  Lora_url4 = "https://civitai.com/api/download/models/9409"
535
  Lora_destination_folder4 = Lora_destination_folder3
536
  Lora_filename4 = "chara-arona-v1.safetensors"
537
+ Lora_target4 = os.path.join(Lora_destination_folder4, Lora_filename4)
538
 
539
  if Lora_download_task4:
540
+ response = requests.get(Lora_url4)
541
+ if response.status_code == 200:
542
+ with open(Lora_target4, 'wb') as f:
543
+ f.write(response.content)
544
 
545
  # Lora任务5
546
  Lora_download_task5 = False
547
  Lora_url5 = ""
548
  Lora_destination_folder5 = Lora_destination_folder3
549
  Lora_filename5 = ""
550
+ Lora_target5 = os.path.join(Lora_destination_folder5, Lora_filename5)
551
 
552
  if Lora_download_task5:
553
+ response = requests.get(Lora_url5)
554
+ if response.status_code == 200:
555
+ with open(Lora_target5, 'wb') as f:
556
+ f.write(response.content)
557
 
558
  # Lora任务6
559
  Lora_download_task6 = False
560
  Lora_url6 = ""
561
  Lora_destination_folder6 = Lora_destination_folder3
562
  Lora_filename6 = ""
563
+ Lora_target6 = os.path.join(Lora_destination_folder6, Lora_filename6)
564
 
565
  if Lora_download_task6:
566
+ response = requests.get(Lora_url6)
567
+ if response.status_code == 200:
568
+ with open(Lora_target6, 'wb') as f:
569
+ f.write(response.content)
570
+
571
 
572
  # VAE下载
573
  # VAE任务1
 
578
  VAE_target1 = f"{VAE_destination_folder1}/{VAE_filename1}"
579
 
580
  if VAE_download_task1:
581
+ response = requests.get(VAE_url1)
582
+ with open(VAE_target1, 'wb') as file:
583
+ file.write(response.content)
584
 
585
  # VAE任务2
586
  VAE_download_task2 = True
 
590
  VAE_target2 = f"{VAE_destination_folder2}/{VAE_filename2}"
591
 
592
  if VAE_download_task2:
593
+ response = requests.get(VAE_url2)
594
+ with open(VAE_target2, 'wb') as file:
595
+ file.write(response.content)
596
 
597
  # VAE任务3
598
  VAE_download_task3 = True
 
602
  VAE_target3 = f"{VAE_destination_folder3}/{VAE_filename3}"
603
 
604
  if VAE_download_task3:
605
+ response = requests.get(VAE_url3)
606
+ with open(VAE_target3, 'wb') as file:
607
+ file.write(response.content)
608
 
609
  # VAE任务4
610
  VAE_download_task4 = False
 
614
  VAE_target4 = f"{VAE_destination_folder4}/{VAE_filename4}"
615
 
616
  if VAE_download_task4:
617
+ response = requests.get(VAE_url4)
618
+ with open(VAE_target4, 'wb') as file:
619
+ file.write(response.content)
620
 
621
  # VAE任务5
622
  VAE_download_task5 = True
 
626
  VAE_target5 = f"{VAE_destination_folder5}/{VAE_filename5}"
627
 
628
  if VAE_download_task5:
629
+ response = requests.get(VAE_url5)
630
+ with open(VAE_target5, 'wb') as file:
631
+ file.write(response.content)
632
 
633
  # VAE任务6
634
  VAE_download_task6 = True
 
638
  VAE_target6 = f"{VAE_destination_folder6}/{VAE_filename6}"
639
 
640
  if VAE_download_task6:
641
+ response = requests.get(VAE_url6)
642
+ with open(VAE_target6, 'wb') as file:
643
+ file.write(response.content)
644
 
645
  # VAE任务7
646
  VAE_download_task7 = True
 
650
  VAE_target7 = f"{VAE_destination_folder7}/{VAE_filename7}"
651
 
652
  if VAE_download_task7:
653
+ response = requests.get(VAE_url7)
654
+ with open(VAE_target7, 'wb') as file:
655
+ file.write(response.content)
656
 
657
  # VAE任务8
658
  VAE_download_task8 = True
 
662
  VAE_target8 = f"{VAE_destination_folder8}/{VAE_filename8}"
663
 
664
  if VAE_download_task8:
665
+ response = requests.get(VAE_url8)
666
+ with open(VAE_target8, 'wb') as file:
667
+ file.write(response.content)
668
 
669
  # VAE任务9
670
  VAE_download_task9 = False
 
674
  VAE_target9 = f"{VAE_destination_folder9}/{VAE_filename9}"
675
 
676
  if VAE_download_task9:
677
+ response = requests.get(VAE_url9)
678
+ with open(VAE_target9, 'wb') as file:
679
+ file.write(response.content)
680
 
681
  # VAE任务10
682
  VAE_download_task10 = False
 
686
  VAE_target10 = f"{VAE_destination_folder10}/{VAE_filename10}"
687
 
688
  if VAE_download_task10:
689
+ response = requests.get(VAE_url10)
690
+ with open(VAE_target10, 'wb') as file:
691
+ file.write(response.content)
692
 
693
  # VAE任务11
694
  VAE_download_task11 = False
 
698
  VAE_target11 = f"{VAE_destination_folder11}/{VAE_filename11}"
699
 
700
  if VAE_download_task11:
701
+ response = requests.get(VAE_url11)
702
+ with open(VAE_target11, 'wb') as file:
703
+ file.write(response.content)
704
 
705
  # VAE任务12
706
  VAE_download_task12 = False
 
710
  VAE_target12 = f"{VAE_destination_folder12}/{VAE_filename12}"
711
 
712
  if VAE_download_task12:
713
+ response = requests.get(VAE_url12)
714
+ with open(VAE_target12, 'wb') as file:
715
+ file.write(response.content)
716
 
717
  # VAE任务13
718
  VAE_download_task13 = False
 
722
  VAE_target13 = f"{VAE_destination_folder13}/{VAE_filename13}"
723
 
724
  if VAE_download_task13:
725
+ response = requests.get(VAE_url13)
726
+ with open(VAE_target13, 'wb') as file:
727
+ file.write(response.content)
728
+
729
 
730
 
731
  # embeddings模型下载
732
+ # 下载函数
733
+ def download_file(url, destination_folder, filename):
734
+ os.makedirs(destination_folder, exist_ok=True)
735
+ response = requests.get(url)
736
+ with open(os.path.join(destination_folder, filename), 'wb') as file:
737
+ file.write(response.content)
738
+
739
  # _下载任务1_
740
  embeddings_download_task1 = True #@param {type:"boolean"}
741
  embeddings_url1 = "https://civitai.com/api/download/models/125849"
 
744
  embeddings_target1 = f'{embeddings_destination_folder1}/{embeddings_filename1}'
745
 
746
  if embeddings_download_task1:
747
+ download_file(embeddings_url1, embeddings_destination_folder1, embeddings_filename1)
748
 
 
749
  # _下载任务2_
750
  embeddings_download_task2 = False #@param {type:"boolean"}
751
  embeddings_url2 = ""
 
754
  embeddings_target2 = f'{embeddings_destination_folder2}/{embeddings_filename2}'
755
 
756
  if embeddings_download_task2:
757
+ download_file(embeddings_url2, embeddings_destination_folder2, embeddings_filename2)
758
 
 
759
  # _下载任务3_
760
  embeddings_download_task3 = False #@param {type:"boolean"}
761
  embeddings_url3 = ""
 
764
  embeddings_target3 = f'{embeddings_destination_folder3}/{embeddings_filename3}'
765
 
766
  if embeddings_download_task3:
767
+ download_file(embeddings_url3, embeddings_destination_folder3, embeddings_filename3)
768
 
 
769
  # _下载任务4_
770
  embeddings_download_task4 = False #@param {type:"boolean"}
771
  embeddings_url4 = ""
 
774
  embeddings_target4 = f'{embeddings_destination_folder4}/{embeddings_filename4}'
775
 
776
  if embeddings_download_task4:
777
+ download_file(embeddings_url4, embeddings_destination_folder4, embeddings_filename4)
778
 
 
779
  # _下载任务5_
780
  embeddings_download_task5 = False #@param {type:"boolean"}
781
  embeddings_url5 = ""
 
784
  embeddings_target5 = f'{embeddings_destination_folder5}/{embeddings_filename5}'
785
 
786
  if embeddings_download_task5:
787
+ download_file(embeddings_url5, embeddings_destination_folder5, embeddings_filename5)
788
+
789
 
790
 
791