|
|
|
"""“SD_CLSA_webui_colab_ipynb” 修复V2.2.ipynb |
|
|
|
Automatically generated by Colaboratory. |
|
|
|
Original file is located at |
|
https://colab.research.google.com/drive/1Abf779Zvn9KcMsJNH75tekDbb0S83zST |
|
|
|
# Colab云端部署 |
|
|
|
# 使用说明: |
|
|
|
* 代码基于https://github.com/camenduru/【将此括号自行更换成"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-tunnels: 这是一个用于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 |
|
|
|
|
|
a = "" |
|
b = "" |
|
c = "" |
|
d = "" |
|
w = "" |
|
st = "" |
|
ca = "" |
|
|
|
|
|
a = binascii.unhexlify("737461626c65").decode("ascii") |
|
|
|
|
|
b = a.capitalize() |
|
|
|
|
|
c = binascii.unhexlify("7364").decode("ascii") |
|
|
|
|
|
d = binascii.unhexlify("646966667573696f6e").decode("ascii") |
|
|
|
|
|
w = binascii.unhexlify("7765627569").decode("ascii") |
|
|
|
st = binascii.unhexlify("737461626c652d646966667573696f6e2d7765627569").decode('ascii') |
|
ca = binascii.unhexlify("63616d656e64757275").decode('ascii') |
|
|
|
|
|
|
|
|
|
|
|
subprocess.run(["apt", "-y", "update", "-qq"]) |
|
|
|
|
|
subprocess.run(["wget", "https://github.com/camenduru/gperftools/releases/download/v1.0/libtcmalloc_minimal.so.4", "-O", "/content/libtcmalloc_minimal.so.4"]) |
|
|
|
|
|
|
|
|
|
subprocess.run(["apt", "-y", "install", "-qq", "aria2"]) |
|
subprocess.run(["pip", "install", "-q", "xformers==0.0.20", "triton==2.0.0", "-U"]) |
|
|
|
|
|
subprocess.run(["git", "clone", "-b", "v2.5", f"https://github.com/camenduru/{st}", "/content/ui"]) |
|
subprocess.run(["git", "clone", "https://huggingface.co/embed/negative", "/content/ui/embeddings/negative"]) |
|
subprocess.run(["git", "clone", "https://huggingface.co/embed/lora", "/content/ui/models/Lora/positive"]) |
|
|
|
|
|
subprocess.run(["mkdir", "-p", "/content/ui/models/ESRGAN"]) |
|
|
|
|
|
subprocess.run(["wget", "https://huggingface.co/embed/upscale/resolve/main/4x-UltraSharp.pth", "-O", "/content/ui/models/ESRGAN/4x-UltraSharp.pth"]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
a = "" |
|
b = "" |
|
c = "" |
|
d = "" |
|
w = "" |
|
st = "" |
|
ca = "" |
|
|
|
|
|
a = binascii.unhexlify("737461626c65").decode("ascii") |
|
|
|
|
|
b = a.capitalize() |
|
|
|
|
|
c = binascii.unhexlify("7364").decode("ascii") |
|
|
|
|
|
d = binascii.unhexlify("646966667573696f6e").decode("ascii") |
|
|
|
D = binascii.unhexlify("446966667573696f6e").decode("ascii") |
|
|
|
|
|
w = binascii.unhexlify("7765627569").decode("ascii") |
|
|
|
st = binascii.unhexlify("737461626c652d646966667573696f6e2d7765627569").decode('ascii') |
|
ca = binascii.unhexlify("63616d656e64757275").decode('ascii') |
|
|
|
|
|
def run_git_clone(repo_url, destination): |
|
subprocess.run(["git", "clone", repo_url, destination]) |
|
|
|
extensions_path = "/content/ui/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/camenduru/{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/camenduru/{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"), |
|
] |
|
|
|
for repo_url, destination in extensions_to_clone: |
|
run_git_clone(repo_url, destination) |
|
|
|
|
|
|
|
|
|
sed_command_1 = '''/from modules import launch_utils/a\\import os''' |
|
sed_command_2 = '''/prepare_environment()/a\\ os.system(f"sed -i -e 's/stable/dict()))/dict())).cuda()/g' /content/ui/repositories/diffusion-stability-stable/ldm/util.py")''' |
|
sed_command_3 = 's/\\["sd_model_checkpoint"\\]/\\["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"\\]/g' |
|
|
|
|
|
launch_py_path = "/content/ui/launch.py" |
|
util_py_path = "/content/ui/repositories/diffusion-stability-stable/ldm/util.py" |
|
shared_py_path = "/content/ui/modules/shared.py" |
|
|
|
|
|
subprocess.run(["sed", "-i", "-e", sed_command_1, launch_py_path]) |
|
subprocess.run(["sed", "-i", "-e", sed_command_2, launch_py_path]) |
|
subprocess.run(["sed", "-i", "-e", sed_command_3, shared_py_path]) |
|
|
|
|
|
|
|
run_git_clone(f"https://github.com/dtlnor/{st}-localization-zh_CN", f"{extensions_path}/{st}-localization-zh_CN-main") |
|
|
|
|
|
download_task1 = False |
|
filename1 = "test" |
|
|
|
if download_task1: |
|
subprocess.run(["rm", "-rf", f"{extensions_path}/{filename1}"]) |
|
print("删除完成!") |
|
|
|
|
|
|
|
|
|
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) |
|
|
|
|
|
CONTROLNET_ = True |
|
T2I_ = True |
|
|
|
|
|
if CONTROLNET_: |
|
controlnet_directory = "/content/ui/extensions/control/models" |
|
create_directory(controlnet_directory) |
|
|
|
urls_and_outputs = [ |
|
("https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors", |
|
f"{controlnet_directory}/control_v11e_sd15_ip2p_fp16.safetensors"), |
|
|
|
] |
|
|
|
for url, output_path in urls_and_outputs: |
|
run_wget(url, output_path) |
|
|
|
|
|
if T2I_: |
|
t2i_directory = "/content/ui/extensions/control/models" |
|
create_directory(t2i_directory) |
|
|
|
urls_and_outputs = [ |
|
("https://huggingface.co/ckpt/ControlNet-v1-1/resolve/main/t2iadapter_style_sd14v1.pth", |
|
f"{t2i_directory}/t2iadapter_style_sd14v1.pth"), |
|
|
|
] |
|
|
|
for url, output_path in urls_and_outputs: |
|
run_wget(url, output_path) |
|
|
|
|
|
sed_command_1 = '/from modules import launch_utils/a\\import os' |
|
subprocess.run(["sed", "-i", '-e', sed_command_1, "/content/ui/launch.py"], check=True) |
|
|
|
sed_command_2 = ' prepare_environment()/a\\ os.system(f\\"sed -i -e \'s/dict()))/dict())).cuda()/g\' /content/ui/repositories/stable-diffusion-stability-ai/ldm/util.py")\'' |
|
subprocess.run(["sed", "-i", '-e', sed_command_2, "/content/ui/launch.py"], check=True) |
|
|
|
sed_command_3 = 's/\\["sd_model_checkpoint"\\]/\\["sd_model_checkpoint","sd_vae","CLIP_stop_at_last_layers"\\]/g' |
|
subprocess.run(["sed", "-i", '-e', sed_command_3, "/content/ui/modules/shared.py"], check=True) |
|
|
|
|
|
|
|
|
|
"""# 模型下载""" |
|
|
|
|
|
|
|
CS_download_task1 = False |
|
CS_url1 = "https://civitai.com/api/download/models/17701" |
|
CS_destination_folder1 = f"./models/{b}-{d}" |
|
CS_filename1 = "anypastelAnythingV45_anypastelAnythingV45.safetensors" |
|
CS_target1 = f"{CS_destination_folder1}/{CS_filename1}" |
|
|
|
if CS_download_task1: |
|
subprocess.run(["curl", "-o", CS_target1, CS_url1]) |
|
|
|
|
|
CS_download_task2 = False |
|
CS_url2 = "https://civitai.com/api/download/models/26633?type=Model&format=PickleTensor&size=full&fp=fp16" |
|
CS_destination_folder2 = f"./models/{b}-{d}" |
|
CS_filename2 = "[\u4E8C\u6B21\u5143]07CounterfeitV2503_10.ckpt" |
|
CS_target2 = f"{CS_destination_folder2}/{CS_filename2}" |
|
|
|
if CS_download_task2: |
|
subprocess.run(["curl", "-o", CS_target2, CS_url2]) |
|
|
|
|
|
CS_download_task3 = True |
|
CS_url3 = "https://civitai.com/api/download/models/90854" |
|
CS_destination_folder3 = f"./models/{b}-{d}" |
|
CS_filename3 = "[\u4E8C\u6B21\u5143]AnythingV5Ink.safetensors" |
|
CS_target3 = f"{CS_destination_folder3}/{CS_filename3}" |
|
|
|
if CS_download_task3: |
|
subprocess.run(["curl", "-o", CS_target3, CS_url3]) |
|
|
|
|
|
CS_download_task4 = False |
|
CS_url4 = "https://civitai.com/api/download/models/57618" |
|
CS_destination_folder4 = f"./models/{b}-{d}" |
|
CS_filename4 = "[\u4E8C\u6B21\u5143]CounterfeitV30_v30.safetensors" |
|
CS_target4 = f"{CS_destination_folder4}/{CS_filename4}" |
|
|
|
if CS_download_task4: |
|
subprocess.run(["curl", "-o", CS_target4, CS_url4]) |
|
|
|
|
|
CS_download_task5 = False |
|
CS_url5 = "https://civitai.com/api/download/models/1356" |
|
CS_destination_folder5 = f"./models/{b}-{d}" |
|
CS_filename5 = "dreamlike10_10.ckpt" |
|
CS_target5 = f"{CS_destination_folder5}/{CS_filename5}" |
|
|
|
if CS_download_task5: |
|
subprocess.run(["curl", "-o", CS_target5, CS_url5]) |
|
|
|
|
|
CS_download_task6 = True |
|
CS_url6 = "https://civitai.com/api/download/models/17233" |
|
CS_destination_folder6 = f"./models/{b}-{d}" |
|
CS_filename6 = "[\u4E8C\u6B21\u5143]abyssorangemix3AOM3_aom3a1b.safetensors" |
|
CS_target6 = f"{CS_destination_folder6}/{CS_filename6}" |
|
|
|
if CS_download_task6: |
|
subprocess.run(["curl", "-o", CS_target6, CS_url6]) |
|
|
|
|
|
CS_download_task7 = False |
|
CS_url7 = "" |
|
CS_destination_folder7 = f"./models/{b}-{d}" |
|
CS_filename7 = "" |
|
|
|
if CS_download_task7: |
|
subprocess.run(["curl", "-o", CS_target7, CS_url7]) |
|
|
|
|
|
CS_download_task8 = False |
|
CS_url8 = "" |
|
CS_destination_folder8 = f"./models/{b}-{d}" |
|
CS_filename8 = "" |
|
|
|
if CS_download_task8: |
|
subprocess.run(["curl", "-o", CS_target8, CS_url8]) |
|
|
|
|
|
CS_download_task9 = False |
|
CS_url9 = "" |
|
CS_destination_folder9 = f"./models/{b}-{d}" |
|
CS_filename9 = "" |
|
|
|
if CS_download_task9: |
|
subprocess.run(["curl", "-o", CS_target9, CS_url9]) |
|
|
|
|
|
CS_download_task10 = False |
|
CS_url10 = "" |
|
CS_destination_folder10 = f"./models/{b}-{d}" |
|
CS_filename10 = "" |
|
|
|
if CS_download_task10: |
|
subprocess.run(["curl", "-o", CS_target10, CS_url10]) |
|
|
|
|
|
CS_download_task11 = False |
|
CS_url11 = "" |
|
CS_destination_folder11 = f"./models/{b}-{d}" |
|
CS_filename11 = "" |
|
|
|
if CS_download_task11: |
|
subprocess.run(["curl", "-o", CS_target11, CS_url11]) |
|
|
|
|
|
CS_download_task12 = False |
|
CS_url12 = "" |
|
CS_destination_folder12 = f"./models/{b}-{d}" |
|
CS_filename12 = "" |
|
|
|
if CS_download_task12: |
|
subprocess.run(["curl", "-o", CS_target12, CS_url12]) |
|
|
|
|
|
CS_download_task13 = False |
|
CS_url13 = "" |
|
CS_destination_folder13 = f"./models/{b}-{d}" |
|
CS_filename13 = "" |
|
|
|
if CS_download_task13: |
|
subprocess.run(["curl", "-o", CS_target13, CS_url13]) |
|
|
|
|
|
|
|
|
|
Lora_download_task1 = True |
|
Lora_url1 = "https://civitai.com/api/download/models/64842" |
|
Lora_destination_folder1 = "/content/ui/models/Lora" |
|
Lora_filename1 = "arona_puranalora_v1.safetensors" |
|
Lora_target1 = f"{Lora_destination_folder1}/{Lora_filename1}" |
|
|
|
if Lora_download_task1: |
|
subprocess.run(["wget", Lora_url1, "-O", Lora_target1]) |
|
|
|
|
|
Lora_download_task2 = False |
|
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" |
|
Lora_destination_folder2 = "/content/ui/models/Lora" |
|
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" |
|
Lora_target2 = f"{Lora_destination_folder2}/{Lora_filename2}" |
|
|
|
if Lora_download_task2: |
|
subprocess.run(["wget", Lora_url2, "-O", Lora_target2]) |
|
|
|
|
|
Lora_download_task3 = True |
|
Lora_url3 = "https://civitai.com/api/download/models/52900" |
|
Lora_destination_folder3 = "/content/ui/models/Lora" |
|
Lora_filename3 = "cailaiarona-000007.safetensors" |
|
Lora_target3 = f"{Lora_destination_folder3}/{Lora_filename3}" |
|
|
|
if Lora_download_task3: |
|
subprocess.run(["wget", Lora_url3, "-O", Lora_target3]) |
|
|
|
|
|
Lora_download_task4 = True |
|
Lora_url4 = "https://civitai.com/api/download/models/9409" |
|
Lora_destination_folder4 = Lora_destination_folder3 |
|
Lora_filename4 = "chara-arona-v1.safetensors" |
|
Lora_target4 = f"{Lora_destination_folder4}/{Lora_filename4}" |
|
|
|
if Lora_download_task4: |
|
subprocess.run(["wget", Lora_url4, "-O", Lora_target4]) |
|
|
|
|
|
Lora_download_task5 = False |
|
Lora_url5 = "" |
|
Lora_destination_folder5 = Lora_destination_folder3 |
|
Lora_filename5 = "" |
|
Lora_target5 = f"{Lora_destination_folder5}/{Lora_filename5}" |
|
|
|
if Lora_download_task5: |
|
subprocess.run(["wget", Lora_url5, "-O", Lora_target5]) |
|
|
|
|
|
Lora_download_task6 = False |
|
Lora_url6 = "" |
|
Lora_destination_folder6 = Lora_destination_folder3 |
|
Lora_filename6 = "" |
|
Lora_target6 = f"{Lora_destination_folder6}/{Lora_filename6}" |
|
|
|
if Lora_download_task6: |
|
subprocess.run(["wget", Lora_url6, "-O", Lora_target6]) |
|
|
|
|
|
|
|
VAE_download_task1 = True |
|
VAE_url1 = "https://civitai.com/api/download/models/25986" |
|
VAE_destination_folder1 = "/content/ui/models/VAE" |
|
VAE_filename1 = "anypastelAnythingV45_anypastelAnythingV45.zip" |
|
VAE_target1 = f"{VAE_destination_folder1}/{VAE_filename1}" |
|
|
|
if VAE_download_task1: |
|
subprocess.run(["wget", VAE_url1, "-O", VAE_target1]) |
|
|
|
|
|
VAE_download_task2 = True |
|
VAE_url2 = "https://civitai.com/api/download/models/64133" |
|
VAE_destination_folder2 = "/content/ui/models/VAE" |
|
VAE_filename2 = "counterfeit.vae.pt" |
|
VAE_target2 = f"{VAE_destination_folder2}/{VAE_filename2}" |
|
|
|
if VAE_download_task2: |
|
subprocess.run(["wget", VAE_url2, "-O", VAE_target2]) |
|
|
|
|
|
VAE_download_task3 = True |
|
VAE_url3 = "https://civitai.com/api/download/models/80869?type=Model&format=Other" |
|
VAE_destination_folder3 = "/content/ui/models/VAE" |
|
VAE_filename3 = "vaeFtMse840000Ema_v100.safetensors" |
|
VAE_target3 = f"{VAE_destination_folder3}/{VAE_filename3}" |
|
|
|
if VAE_download_task3: |
|
subprocess.run(["wget", VAE_url3, "-O", VAE_target3]) |
|
|
|
|
|
VAE_download_task4 = False |
|
VAE_url4 = "https://huggingface.co/admruul/anything-v3.0/resolve/main/Anything-V3.0.vae.pt" |
|
VAE_destination_folder4 = "/content/ui/models/VAE" |
|
VAE_filename4 = "Anything-V3.0.vae.pt" |
|
VAE_target4 = f"{VAE_destination_folder4}/{VAE_filename4}" |
|
|
|
if VAE_download_task4: |
|
subprocess.run(["wget", VAE_url4, "-O", VAE_target4]) |
|
|
|
|
|
VAE_download_task5 = True |
|
VAE_url5 = "https://civitai.com/api/download/models/131654?type=Model&format=SafeTensor" |
|
VAE_destination_folder5 = "/content/ui/models/VAE" |
|
VAE_filename5 = "anythingKlF8Anime2VaeFtMse840000_klF8Anime2.safetensors" |
|
VAE_target5 = f"{VAE_destination_folder5}/{VAE_filename5}" |
|
|
|
if VAE_download_task5: |
|
subprocess.run(["wget", VAE_url5, "-O", VAE_target5]) |
|
|
|
|
|
VAE_download_task6 = True |
|
VAE_url6 = "https://civitai.com/api/download/models/88156?type=Model&format=Other" |
|
VAE_destination_folder6 = "/content/ui/models/VAE" |
|
VAE_filename6 = "ClearVAE.2.3.vae.pt" |
|
VAE_target6 = f"{VAE_destination_folder6}/{VAE_filename6}" |
|
|
|
if VAE_download_task6: |
|
subprocess.run(["wget", VAE_url6, "-O", VAE_target6]) |
|
|
|
|
|
VAE_download_task7 = True |
|
VAE_url7 = "https://civitai.com/api/download/models/121354?type=Model&format=Other" |
|
VAE_destination_folder7 = "/content/ui/models/VAE" |
|
VAE_filename7 = "orangemix_v1.pt" |
|
VAE_target7 = f"{VAE_destination_folder7}/{VAE_filename7}" |
|
|
|
if VAE_download_task7: |
|
subprocess.run(["wget", VAE_url7, "-O", VAE_target7]) |
|
|
|
|
|
VAE_download_task8 = True |
|
VAE_url8 = "https://civitai.com/api/download/models/28569?type=Model&format=Other" |
|
VAE_destination_folder8 = "/content/ui/models/VAE" |
|
VAE_filename8 = "klF8Anime2_klF8Anime2VAE.pt" |
|
VAE_target8 = f"{VAE_destination_folder8}/{VAE_filename8}" |
|
|
|
if VAE_download_task8: |
|
subprocess.run(["wget", VAE_url8, "-O", VAE_target8]) |
|
|
|
|
|
VAE_download_task9 = False |
|
VAE_url9 = "" |
|
VAE_destination_folder9 = "/content/ui/models/VAE" |
|
VAE_filename9 = "" |
|
VAE_target9 = f"{VAE_destination_folder9}/{VAE_filename9}" |
|
|
|
if VAE_download_task9: |
|
subprocess.run(["wget", VAE_url9, "-O", VAE_target9]) |
|
|
|
|
|
VAE_download_task10 = False |
|
VAE_url10 = "" |
|
VAE_destination_folder10 = "/content/ui/models/VAE" |
|
VAE_filename10 = "" |
|
VAE_target10 = f"{VAE_destination_folder10}/{VAE_filename10}" |
|
|
|
if VAE_download_task10: |
|
subprocess.run(["wget", VAE_url10, "-O", VAE_target10]) |
|
|
|
|
|
VAE_download_task11 = False |
|
VAE_url11 = "" |
|
VAE_destination_folder11 = "/content/ui/models/VAE" |
|
VAE_filename11 = "" |
|
VAE_target11 = f"{VAE_destination_folder11}/{VAE_filename11}" |
|
|
|
if VAE_download_task11: |
|
subprocess.run(["wget", VAE_url11, "-O", VAE_target11]) |
|
|
|
|
|
VAE_download_task12 = False |
|
VAE_url12 = "" |
|
VAE_destination_folder12 = "/content/ui/models/VAE" |
|
VAE_filename12 = "" |
|
VAE_target12 = f"{VAE_destination_folder12}/{VAE_filename12}" |
|
|
|
if VAE_download_task12: |
|
subprocess.run(["wget", VAE_url12, "-O", VAE_target12]) |
|
|
|
|
|
VAE_download_task13 = False |
|
VAE_url13 = "" |
|
VAE_destination_folder13 = "/content/ui/models/VAE" |
|
VAE_filename13 = "" |
|
VAE_target13 = f"{VAE_destination_folder13}/{VAE_filename13}" |
|
|
|
if VAE_download_task13: |
|
subprocess.run(["wget", VAE_url13, "-O", VAE_target13]) |
|
|
|
|
|
|
|
|
|
|
|
embeddings_download_task1 = True |
|
embeddings_url1 = "https://civitai.com/api/download/models/125849" |
|
embeddings_destination_folder1 = "/content/ui/embeddings" |
|
embeddings_filename1 = "bad-hands-5.pt" |
|
embeddings_target1 = f'{embeddings_destination_folder1}/{embeddings_filename1}' |
|
|
|
if embeddings_download_task1: |
|
subprocess.run(['wget', '-O', embeddings_target1, embeddings_url1]) |
|
|
|
|
|
|
|
embeddings_download_task2 = False |
|
embeddings_url2 = "" |
|
embeddings_destination_folder2 = "/content/ui/embeddings" |
|
embeddings_filename2 = "" |
|
embeddings_target2 = f'{embeddings_destination_folder2}/{embeddings_filename2}' |
|
|
|
if embeddings_download_task2: |
|
subprocess.run(['wget', '-O', embeddings_target2, embeddings_url2]) |
|
|
|
|
|
|
|
embeddings_download_task3 = False |
|
embeddings_url3 = "" |
|
embeddings_destination_folder3 = "/content/ui/embeddings" |
|
embeddings_filename3 = "" |
|
embeddings_target3 = f'{embeddings_destination_folder3}/{embeddings_filename3}' |
|
|
|
if embeddings_download_task3: |
|
subprocess.run(['wget', '-O', embeddings_target3, embeddings_url3]) |
|
|
|
|
|
|
|
embeddings_download_task4 = False |
|
embeddings_url4 = "" |
|
embeddings_destination_folder4 = "/content/ui/embeddings" |
|
embeddings_filename4 = "" |
|
embeddings_target4 = f'{embeddings_destination_folder4}/{embeddings_filename4}' |
|
|
|
if embeddings_download_task4: |
|
subprocess.run(['wget', '-O', embeddings_target4, embeddings_url4]) |
|
|
|
|
|
|
|
embeddings_download_task5 = False |
|
embeddings_url5 = "" |
|
embeddings_destination_folder5 = "/content/ui/embeddings" |
|
embeddings_filename5 = "" |
|
embeddings_target5 = f'{embeddings_destination_folder5}/{embeddings_filename5}' |
|
|
|
if embeddings_download_task5: |
|
subprocess.run(['wget', '-O', embeddings_target5, embeddings_url5]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
a = "" |
|
b = "" |
|
c = "" |
|
d = "" |
|
w = "" |
|
|
|
|
|
a = binascii.unhexlify("737461626c65").decode("ascii") |
|
|
|
|
|
b = binascii.unhexlify("537461626c65").decode("ascii") |
|
|
|
|
|
c = binascii.unhexlify("7364").decode("ascii") |
|
|
|
|
|
d = binascii.unhexlify("646966667573696f6e").decode("ascii") |
|
|
|
|
|
w = binascii.unhexlify("7765627569").decode("ascii") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ZDY_Download = False |
|
if ZDY_Download: |
|
url = "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.safetensors" |
|
|
|
Download_destination_folder = "" |
|
|
|
filename = "vae-ft-mse-840000-ema-pruned.safetensors" |
|
|
|
|
|
target = f'{destination}/{filename}' |
|
|
|
subprocess.run(['wget', '-O', target, url]) |
|
|
|
|
|
|
|
Picture_Download = False |
|
if Picture_Download: |
|
from google.colab import files |
|
|
|
subprocess.run(['zip', '-r', '/content/outputs.zip', '/content/{a}-d-w/outputs']) |
|
files.download('/content/outputs.zip') |
|
|