Upload 下载模型脚本.ipynb
Browse files- 下载模型脚本.ipynb +93 -0
下载模型脚本.ipynb
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"id": "816b16cd-1d62-4cd8-81e3-efc81e462b0b",
|
6 |
+
"metadata": {},
|
7 |
+
"source": [
|
8 |
+
"# 下载模型代码。"
|
9 |
+
]
|
10 |
+
},
|
11 |
+
{
|
12 |
+
"cell_type": "markdown",
|
13 |
+
"id": "b4239c56-f8e7-4fca-8624-15f1c89e5a23",
|
14 |
+
"metadata": {},
|
15 |
+
"source": [
|
16 |
+
"# 下载模型,直接把模型下载地址粘贴进去\n",
|
17 |
+
"# 支持的模型下载站:liblib.ai, tusiart.com, Huggingface镜像站\n",
|
18 |
+
"# 不支持的:Civitai,\n",
|
19 |
+
"## HUggingface镜像站:huggingface.sukaka.top\n",
|
20 |
+
"## 必须先把SD停下来再执行代码!"
|
21 |
+
]
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"cell_type": "code",
|
25 |
+
"execution_count": null,
|
26 |
+
"id": "4ff5f047-49a6-4f2f-800f-622fe57f1f94",
|
27 |
+
"metadata": {},
|
28 |
+
"outputs": [
|
29 |
+
{
|
30 |
+
"name": "stdout",
|
31 |
+
"output_type": "stream",
|
32 |
+
"text": [
|
33 |
+
"/root/xlab-app-center/stable-diffusion-webui/models/Stable-diffusion\n",
|
34 |
+
"开始下载模型:[二次元]Cuteyukimix-kemiaomiao.safetensors\n",
|
35 |
+
" *** Download Progress Summary as of Tue Mar 26 22:03:49 2024 *** 33s\u001b[0m\u001b[35m]\u001b[0m\u001b[0mmm0m\n",
|
36 |
+
"===============================================================================\n",
|
37 |
+
"[#cd851a 1.4GiB/2.2GiB(67%) CN:16 DL:23MiB ETA:31s]\n",
|
38 |
+
"FILE: /root/xlab-app-center/stable-diffusion-webui/models/Stable-diffusion/[二次元]Cuteyukimix-kemiaomiao.safetensors\n",
|
39 |
+
"-------------------------------------------------------------------------------\n",
|
40 |
+
"\n",
|
41 |
+
"\u001b[35m[\u001b[0m#cd851a 2.2GiB/2.2GiB\u001b[36m(99%)\u001b[0m CN:1 DL:\u001b[32m47KiB\u001b[0m\u001b[35m]\u001b[0m\u001b[0m0m\u001b[35m]\u001b[0m\u001b[0mmm"
|
42 |
+
]
|
43 |
+
}
|
44 |
+
],
|
45 |
+
"source": [
|
46 |
+
"# 下载 模型\n",
|
47 |
+
"urls = ['https://hf-mirror.com/eienmojiki/CuteYukiMix-kemiaomiao/resolve/main/CuteYukiMix-kemiaomiao.safetensors?download=true']\n",
|
48 |
+
"\n",
|
49 |
+
"下载目录 = '/root/xlab-app-center/stable-diffusion-webui/models/Stable-diffusion'\n",
|
50 |
+
"\n",
|
51 |
+
"文件名 = \"[二次元]Cuteyukimix-kemiaomiao.safetensors\"\n",
|
52 |
+
"# SD大模型目录 :/root/xlab-app-center/stable-diffusion-webui/models/Stable-diffusion\n",
|
53 |
+
"# Lora目录:/root/xlab-app-center/stable-diffusion-webui/models/Lora\n",
|
54 |
+
"# VAE目录:/root/xlab-app-center/stable-diffusion-webui/models/VAE\n",
|
55 |
+
"\n",
|
56 |
+
"%cd {下载目录}\n",
|
57 |
+
"for url in urls:\n",
|
58 |
+
" !echo '开始下载模型:{文件名}'\n",
|
59 |
+
" !aria2c -x 16 -s 16 -c -k 1M --console-log-level=error \"{url}\" -o \"{文件名}\"\n",
|
60 |
+
"%cd /root/xlab-app-center"
|
61 |
+
]
|
62 |
+
},
|
63 |
+
{
|
64 |
+
"cell_type": "code",
|
65 |
+
"execution_count": null,
|
66 |
+
"id": "234a9f96-d5ff-4aaf-9944-ba376761a17f",
|
67 |
+
"metadata": {},
|
68 |
+
"outputs": [],
|
69 |
+
"source": []
|
70 |
+
}
|
71 |
+
],
|
72 |
+
"metadata": {
|
73 |
+
"kernelspec": {
|
74 |
+
"display_name": "Python 3 (ipykernel)",
|
75 |
+
"language": "python",
|
76 |
+
"name": "python3"
|
77 |
+
},
|
78 |
+
"language_info": {
|
79 |
+
"codemirror_mode": {
|
80 |
+
"name": "ipython",
|
81 |
+
"version": 3
|
82 |
+
},
|
83 |
+
"file_extension": ".py",
|
84 |
+
"mimetype": "text/x-python",
|
85 |
+
"name": "python",
|
86 |
+
"nbconvert_exporter": "python",
|
87 |
+
"pygments_lexer": "ipython3",
|
88 |
+
"version": "3.8.10"
|
89 |
+
}
|
90 |
+
},
|
91 |
+
"nbformat": 4,
|
92 |
+
"nbformat_minor": 5
|
93 |
+
}
|