-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSDextensionsDownload.py
82 lines (58 loc) · 2.83 KB
/
SDextensionsDownload.py
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
import os
from pathlib import *
import subprocess
os.environ["http_proxy"] = "http://127.0.0.1:7890"
os.environ["https_proxy"] = "http://127.0.0.1:7890"
extbasePath = Path.joinpath(Path.cwd(),"extensions")
extgitName=[
"https://github.com/kohya-ss/sd-webui-additional-networks",#
"https://github.com/AlUlkesh/stable-diffusion-webui-images-browser",
"https://github.com/KohakuBlueleaf/a1111-sd-webui-locon",
"https://github.com/Nevysha/Cozy-Nest",
"https://github.com/DominikDoom/a1111-sd-webui-tagcomplete",
"https://github.com/journey-ad/sd-webui-bilingual-localization",
#"https://github.com/AbdullahAlfaraj/Auto-Photoshop-StableDiffusion-Plugin",# 安装插件ccx
]
for extgitName in extgitName:
gitPath = Path.joinpath(extbasePath, Path(extgitName).name)
if gitPath.exists():
cmd = "cd %s && git pull" %(gitPath)
subprocess.call(cmd, shell=True)
else:
cmd = "cd %s && git clone %s" %(extbasePath,extgitName)
subprocess.call(cmd, shell=True)
################################################################
vaeModelsPath = Path.joinpath(Path.cwd(),"models/VAE")
if vaeModelsPath.exists():
print("%s 已经存在" %vaeModelsPath)
pass
else:
Path.mkdir(vaeModelsPath)
vaeModelshugeName=[
"https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors",
"https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/vae/diffusion_pytorch_model.safetensors",
]
if len(vaeModelshugeName) != 0:
for vaeModelshugeName in vaeModelshugeName:
cmd = "cd %s && wget -N -c %s" %(vaeModelsPath,vaeModelshugeName)
subprocess.call(cmd, shell=True)
#####################################################
# embeddings、TEXTUAL INVERSION
embeddingsPath = Path.joinpath(Path.cwd(),"embeddings")
embeddingshugeName=[
"https://huggingface.co/datasets/gsdf/EasyNegative/resolve/main/EasyNegative.safetensors",# EasyNegative
]
embeddingscivitName=[
"https://civitai.com/api/download/models/5119",# Pure Eros Face
"https://civitai.com/api/download/models/20068",# badhandv4,坏手
"https://civitai.com/api/download/models/19837",# badv3,坏身体
"https://civitai.com/api/download/models/5637",# ng_deepnegative_v1_75t
]
if len(embeddingshugeName) != 0:
for embeddingshugeName in embeddingshugeName:
cmd = "cd %s && wget -N -c %s" %(embeddingsPath,embeddingshugeName)
subprocess.call(cmd, shell=True)
if len(embeddingscivitName) != 0:
for embeddingscivitName in embeddingscivitName:
cmd = "cd %s && aria2c -V -c --disable-ipv6 %s" %(embeddingsPath,embeddingscivitName)
subprocess.call(cmd, shell=True)