ACCA225 commited on
Commit
f9de86b
1 Parent(s): 0cc4ff7

Upload Kaggle-SD-webui v2.2.2 (最新).ipynb

Browse files
Files changed (1) hide show
  1. Kaggle-SD-webui v2.2.2 (最新).ipynb +1374 -0
Kaggle-SD-webui v2.2.2 (最新).ipynb ADDED
@@ -0,0 +1,1374 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "\n",
8
+ "## NovelAi sd-webui AI绘画项目 修复版(完全免费,无需任何配置!)\n",
9
+ "**torch: 2.0.0+cu118  •  xformers: 0.0.19**\n",
10
+ "​\n",
11
+ "# <span style=\"color:red; font-weight:bold;\">有问题请加qq群632428790 (691/2000)</span>\n",
12
+ "### 急需一名宣传人员,无偿,会做B站视频就行"
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "markdown",
17
+ "metadata": {},
18
+ "source": [
19
+ "## 使用教程:https://www.kaggle.com/code/at2020dead/novelai-stable-diffusion/notebook \n"
20
+ ]
21
+ },
22
+ {
23
+ "cell_type": "markdown",
24
+ "metadata": {},
25
+ "source": [
26
+ "\n",
27
+ "<div class=\"alert alert-block alert-info\" style=\"font-size:14px; font-family:verdana;\">\n",
28
+ " 📌 2022年11月18日: Crtated By Yiyiooo & Loading\n",
29
+ "</div>\n",
30
+ "最近更新日志:\n",
31
+ "<div class=\"alert alert-block alert-info\" style=\"font-size:14px; font-family:verdana;\">\n",
32
+ " 2023年3月5日更新:现在支持通过下载链接上传模型了,省去了下载模型后再上传后的麻烦.()\n",
33
+ "</div>\n",
34
+ "<div class=\"alert alert-block alert-info\" style=\"font-size:14px; font-family:verdana;\">\n",
35
+ " 2023年5月15日更新:现在可以双开webui了,可以双线程跑图(GPU请选择 T4 x2 , 将use2设置为True)\n",
36
+ "</div>\n",
37
+ "<div class=\"alert alert-block alert-info\" style=\"font-size:14px; font-family:verdana;\">\n",
38
+ " 2023年5月15日更新:更新了多线程启动,启动速度更快一些\n",
39
+ "</div>\n",
40
+ "<div class=\"alert alert-block alert-info\" style=\"font-size:14px; font-family:verdana;\">\n",
41
+ " 2023年6月6日更新:更新了xformers版本,生成速度更快一些\n",
42
+ "</div>"
43
+ ]
44
+ },
45
+ {
46
+ "cell_type": "markdown",
47
+ "metadata": {},
48
+ "source": [
49
+ "# 注意事项/WARNING:\n",
50
+ "- ### 1.将设置中的PERSISTENCE改为Files Only方便下次打开提高启动速度,第一次启动后下载Python环境包就不用下载第二次了\n",
51
+ "- ### 2.检测到出现涩图会容易导致封号现象,建议到webui设置里把'始终保存所有生成的图像'和‘始终保存所有生成的宫格图’关了\n",
52
+ "- ### 3.如果不能启动,请新建一个notebook并且重新导入\n",
53
+ "- ### 4.若出现BUG,请跟我们反馈,我们是无偿组织,请不要催作者更新,谢谢配合"
54
+ ]
55
+ },
56
+ {
57
+ "cell_type": "markdown",
58
+ "metadata": {},
59
+ "source": [
60
+ "## Ai绘画模型下载站:\n",
61
+ "#### [Civitai](http://civitai.com)\n",
62
+ " \n",
63
+ "#### [huggingface](http://huggingface.co)\n",
64
+ "# 友情合作\n",
65
+ "### [pix.ink](http://pix.ink) "
66
+ ]
67
+ },
68
+ {
69
+ "cell_type": "code",
70
+ "execution_count": 1,
71
+ "metadata": {
72
+ "execution": {
73
+ "iopub.execute_input": "2023-06-06T13:31:46.526376Z",
74
+ "iopub.status.busy": "2023-06-06T13:31:46.525502Z",
75
+ "iopub.status.idle": "2023-06-06T13:31:46.542665Z",
76
+ "shell.execute_reply": "2023-06-06T13:31:46.541657Z",
77
+ "shell.execute_reply.started": "2023-06-06T13:31:46.526340Z"
78
+ }
79
+ },
80
+ "outputs": [],
81
+ "source": [
82
+ "# 安装目录\n",
83
+ "install_path=\"/kaggle/working\" #或者/kaggle\n",
84
+ "updata_webui = False #是否开机自动更新webui\n",
85
+ "\n",
86
+ "# 重置变量 会删掉sd_webui重新安装\n",
87
+ "reLoad = False\n",
88
+ "updata_webui = False\n",
89
+ "\n",
90
+ "#清理和打包生成的图片\n",
91
+ "zip_output=True\n",
92
+ "clear_output=True\n",
93
+ "#打包环境减少下次启动时\n",
94
+ "use_zip_venv = False\n",
95
+ "\n",
96
+ "# 使用huggingface保存和载入webui配置文件\n",
97
+ "huggingface_use = True\n",
98
+ "huggingface_token_file = '/kaggle/input/tenkens/hugfacetoken.txt'\n",
99
+ "huggiingface_repo_id = 'ACCA225/sdconfig'\n",
100
+ "# 将会同步的文件\n",
101
+ "yun_files = [\n",
102
+ "'ui-config.json',\n",
103
+ "'config.json',\n",
104
+ "'styles.csv'\n",
105
+ "]"
106
+ ]
107
+ },
108
+ {
109
+ "cell_type": "code",
110
+ "execution_count": 2,
111
+ "metadata": {
112
+ "execution": {
113
+ "iopub.execute_input": "2023-06-06T13:31:46.547389Z",
114
+ "iopub.status.busy": "2023-06-06T13:31:46.546557Z",
115
+ "iopub.status.idle": "2023-06-06T13:31:46.562867Z",
116
+ "shell.execute_reply": "2023-06-06T13:31:46.561790Z",
117
+ "shell.execute_reply.started": "2023-06-06T13:31:46.547353Z"
118
+ }
119
+ },
120
+ "outputs": [],
121
+ "source": [
122
+ "#模型和插件\n",
123
+ "\n",
124
+ "# 插件列表: git仓库地址\n",
125
+ "# 不需要的插件在前面加 # ,插件地址之间需要用英语逗号隔开\n",
126
+ "extensions = [\n",
127
+ " 'https://github.com/Elldreth/loopback_scaler',\n",
128
+ " 'https://github.com/jexom/sd-webui-depth-lib',\n",
129
+ " #'https://github.com/AlUlkesh/stable-diffusion-webui-images-browser',\n",
130
+ " 'https://github.com/camenduru/sd-civitai-browser',\n",
131
+ " 'https://github.com/Mikubill/sd-webui-controlnet',\n",
132
+ " 'https://github.com/nonnonstop/sd-webui-3d-open-pose-editor',\n",
133
+ " 'https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN',\n",
134
+ " 'https://github.com/opparco/stable-diffusion-webui-two-shot',\n",
135
+ " #'https://github.com/minicacas/stable-diffusion-webui-composable-lora',\n",
136
+ " 'https://github.com/DominikDoom/a1111-sd-webui-tagcomplete',\n",
137
+ " 'https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111',\n",
138
+ " #'https://github.com/KohakuBlueleaf/a1111-sd-webui-locon',\n",
139
+ " 'https://github.com/hnmr293/sd-webui-cutoff',\n",
140
+ " 'https://github.com/hako-mikan/sd-webui-lora-block-weight',\n",
141
+ " 'https://github.com/butaixianran/Stable-Diffusion-Webui-Civitai-Helper',\n",
142
+ " 'https://github.com/catppuccin/stable-diffusion-webui',\n",
143
+ " #'https://github.com/Nevysha/Cozy-Nest',\n",
144
+ " 'https://github.com/Scholar01/sd-webui-mov2mov',\n",
145
+ " 'https://github.com/toriato/stable-diffusion-webui-wd14-tagger',\n",
146
+ " 'https://github.com/Physton/sd-webui-prompt-all-in-one',\n",
147
+ " 'https://github.com/KohakuBlueleaf/a1111-sd-webui-lycoris',\n",
148
+ " #'https://github.com/deforum-art/sd-webui-deforum',\n",
149
+ " 'https://github.com/Scholar01/sd-webui-mov2mov',\n",
150
+ " 'https://github.com/zanllp/sd-webui-infinite-image-browsing',\n",
151
+ "]\n",
152
+ "\n",
153
+ "# Stable Diffusion模型请放在这里(不用填模型的文件名,只填模型的目录即可)\n",
154
+ "sd_model = [\n",
155
+ "#'/kaggle/input/cetus-mix/',\n",
156
+ "#'/kaggle/input/aom3ackpt',\n",
157
+ "'/kaggle/input/9527-fp16',\n",
158
+ "#'/kaggle/input/dalcefo-painting',\n",
159
+ " ]\n",
160
+ "# Stable Diffusion模型下载链接放这里\n",
161
+ "sd_model_urls=[\n",
162
+ "#GhostMix_v1.2\n",
163
+ "'https://civitai.com/api/download/models/59685',\n",
164
+ "'https://huggingface.co/swl-models/9527/resolve/main/9527-non-ema-fp16.safetensors',\n",
165
+ "#Counterfeit-V3.0\n",
166
+ "'https://civitai.com/api/download/models/57618',\n",
167
+ "#LibraMix\n",
168
+ "'https://civitai.com/api/download/models/41391',\n",
169
+ "'https://huggingface.co/datasets/sukaka/sd_models_fp16/resolve/main/cetusMix_Coda2.safetensors',\n",
170
+ "'https://huggingface.co/datasets/sukaka/sd_models_fp16/resolve/main/cetusMix_Version35.safetensors',\n",
171
+ "\n",
172
+ "]\n",
173
+ "\n",
174
+ "# VAE模型请放在这里(不用填模型的文件名,只填模型的目录即可)\n",
175
+ "vae_model = []\n",
176
+ "#VAE模型下载链接放这里\n",
177
+ "vae_model_urls=[\n",
178
+ "'https://huggingface.co/stabilityai/sd-vae-ft-ema-original/resolve/main/vae-ft-ema-560000-ema-pruned.safetensors',\n",
179
+ "'https://huggingface.co/datasets/sukaka/sd_models_fp16/resolve/main/clearvae.vae.pt',\n",
180
+ "'https://huggingface.co/datasets/sukaka/sd_models_fp16/resolve/main/klF8Anime2.vae.pt',\n",
181
+ "'https://huggingface.co/dector/vae-840000/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt'\n",
182
+ "]\n",
183
+ "\n",
184
+ "# Lora模型的数据集路径请写在这里:\n",
185
+ "lora_model = [\n",
186
+ "#'/kaggle/input/lora-1',\n",
187
+ "] \n",
188
+ "# Lora模型下载链接放这里\n",
189
+ "lora_model_urls=[\n",
190
+ "#墨心\n",
191
+ "'https://civitai.com/api/download/models/14856',\n",
192
+ "#山楂糕\n",
193
+ "'https://civitai.com/api/download/models/41580',\n",
194
+ "#细节调整\n",
195
+ "'https://civitai.com/api/download/models/62833'\n",
196
+ "]\n",
197
+ "# Lycoris和loha模型的数据集路径请写在这里:\n",
198
+ "lyco_model = [\n",
199
+ "#'/kaggle/input/lora-1',\n",
200
+ "] \n",
201
+ "# Lycoris和loha模型下载链接放这里\n",
202
+ "lyco_model_urls=[\n",
203
+ "#FilmGirl 胶片风\n",
204
+ "'https://civitai.com/api/download/models/75069',\n",
205
+ "#Teacher clothes 教师衣服\n",
206
+ "\"https://civitai.com/api/download/models/65426\",\n",
207
+ "#伪日光\n",
208
+ "'https://civitai.com/api/download/models/71235'\n",
209
+ "]\n",
210
+ "\n",
211
+ "# ControlNet模型data请放在这里:\n",
212
+ "cn_model = [\n",
213
+ "]\n",
214
+ "# controlnet模型下载链接放这里\n",
215
+ "cn_model_urls = [\n",
216
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_ip2p_fp16.safetensors',\n",
217
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11e_sd15_shuffle_fp16.safetensors',\n",
218
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11f1p_sd15_depth_fp16.safetensors',\n",
219
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_canny_fp16.safetensors',\n",
220
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_inpaint_fp16.safetensors',\n",
221
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_lineart_fp16.safetensors',\n",
222
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_mlsd_fp16.safetensors',\n",
223
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_normalbae_fp16.safetensors',\n",
224
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_openpose_fp16.safetensors',\n",
225
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_scribble_fp16.safetensors',\n",
226
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15_softedge_fp16.safetensors',\n",
227
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors',\n",
228
+ "'https://huggingface.co/comfyanonymous/ControlNet-v1-1_fp16_safetensors/resolve/main/control_v11u_sd15_tile_fp16.safetensors',\n",
229
+ "]\n",
230
+ "\n",
231
+ "# Hypernetworks超网络模型路径请放在这里:\n",
232
+ "hypernetworks_model = []\n",
233
+ "#Hypernetworks超网络模型下载链接请放在这里\n",
234
+ "hypernetworks_model_urls = []\n",
235
+ "\n",
236
+ "#放大算法路径请放在这里\n",
237
+ "ESRGAN = []\n",
238
+ "#放大算法链接请放在这里\n",
239
+ "ESRGAN_urls = [\n",
240
+ "'https://huggingface.co/FacehugmanIII/4x_foolhardy_Remacri/resolve/main/4x_foolhardy_Remacri.pth',\n",
241
+ "'https://huggingface.co/konohashinobi4/4xAnimesharp/resolve/main/4x-AnimeSharp.pth',\n",
242
+ "'https://huggingface.co/lokCX/4x-Ultrasharp/resolve/main/4x-UltraSharp.pth',\n",
243
+ "]\n",
244
+ "\n",
245
+ "# embeddings(pt文件)请放在这里:\n",
246
+ "embeddings_model = [\n",
247
+ "'/kaggle/input/bad-embedding',\n",
248
+ "] \n",
249
+ "# embeddings(pt文件)下载链接请放在这里:\n",
250
+ "embeddings_model_urls=[\n",
251
+ "'https://huggingface.co/datasets/sukaka/sd_configs/resolve/main/%E4%BA%BA%E4%BD%93%E4%BF%AE%E6%AD%A3/EasyNegative.pt',\n",
252
+ "'https://huggingface.co/datasets/sukaka/sd_configs/resolve/main/%E4%BA%BA%E4%BD%93%E4%BF%AE%E6%AD%A3/bad-artist-anime.pt',\n",
253
+ "'https://huggingface.co/datasets/sukaka/sd_configs/resolve/main/%E4%BA%BA%E4%BD%93%E4%BF%AE%E6%AD%A3/bad-hands-5.pt',\n",
254
+ "'https://huggingface.co/datasets/sukaka/sd_configs/resolve/main/%E4%BA%BA%E4%BD%93%E4%BF%AE%E6%AD%A3/bad_prompt_version2.pt',\n",
255
+ "'https://huggingface.co/datasets/sukaka/sd_configs/resolve/main/%E4%BA%BA%E4%BD%93%E4%BF%AE%E6%AD%A3/bad-image-v2-39000.pt',\n",
256
+ "]\n",
257
+ "\n",
258
+ "#script文件导入\n",
259
+ "scripts = []\n",
260
+ "#script文件下载链接导入\n",
261
+ "scripts_urls = [\n",
262
+ "'https://huggingface.co/datasets/sukaka/sd_configs/resolve/main/repositories/k-diffusion/k_diffusion/sampling.py'\n",
263
+ "]\n",
264
+ "\n",
265
+ "#tag词库文件导入\n",
266
+ "tags = []\n",
267
+ "#tag词库文件下载链接导入\n",
268
+ "tags_urls=[\n",
269
+ "\"https://huggingface.co/datasets/sukaka/sd_configs/resolve/main/danbooru.zh_CN.csv\",\n",
270
+ "]\n"
271
+ ]
272
+ },
273
+ {
274
+ "cell_type": "code",
275
+ "execution_count": 3,
276
+ "metadata": {
277
+ "execution": {
278
+ "iopub.execute_input": "2023-06-06T13:31:46.566538Z",
279
+ "iopub.status.busy": "2023-06-06T13:31:46.565625Z",
280
+ "iopub.status.idle": "2023-06-06T13:31:46.577054Z",
281
+ "shell.execute_reply": "2023-06-06T13:31:46.576054Z",
282
+ "shell.execute_reply.started": "2023-06-06T13:31:46.566489Z"
283
+ }
284
+ },
285
+ "outputs": [],
286
+ "source": [
287
+ "#ngrok穿透\n",
288
+ "ngrok_use = True\n",
289
+ "ngrokTokenFile='/kaggle/input/tenkens/Authtoken.txt' # 非必填 存放ngrokToken的文件的路径\n",
290
+ "#Frp 内网穿透\n",
291
+ "use_frpc = False\n",
292
+ "frpconfigfile = '/kaggle/input/tenkens/7860.ini' # 非必填 frp 配置文件,本地端口 7860\n",
293
+ "\n",
294
+ "# 启动时默认加载的模型名称 填模型名称,名称建议带上文件名后缀\n",
295
+ "usedCkpt = 'cetusMix_Coda2.safetensors'\n",
296
+ "\n",
297
+ "#启动参数\n",
298
+ "args = [\n",
299
+ " '--share',\n",
300
+ " '--xformers',\n",
301
+ " '--lowram',\n",
302
+ " '--no-hashing',\n",
303
+ " '--disable-nan-check',\n",
304
+ " '--enable-insecure-extension-access',\n",
305
+ " '--disable-console-progressbars',\n",
306
+ " '--enable-console-prompts',\n",
307
+ " '--no-gradio-queue',\n",
308
+ " '--no-half-vae',\n",
309
+ " '--api',\n",
310
+ " f'--lyco-dir {install_path}/models/lyco',\n",
311
+ "]"
312
+ ]
313
+ },
314
+ {
315
+ "cell_type": "code",
316
+ "execution_count": 4,
317
+ "metadata": {
318
+ "execution": {
319
+ "iopub.execute_input": "2023-06-06T13:31:46.581718Z",
320
+ "iopub.status.busy": "2023-06-06T13:31:46.580945Z",
321
+ "iopub.status.idle": "2023-06-06T13:31:46.590885Z",
322
+ "shell.execute_reply": "2023-06-06T13:31:46.589987Z",
323
+ "shell.execute_reply.started": "2023-06-06T13:31:46.581685Z"
324
+ }
325
+ },
326
+ "outputs": [],
327
+ "source": [
328
+ "use2 = False#是否开启两个webui\n",
329
+ "#ngrok穿透\n",
330
+ "ngrok_use1 = True\n",
331
+ "ngrokTokenFile1='/kaggle/input/tenkens/Authtoken1.txt' # 非必填 存放ngrokToken的文件的路径\n",
332
+ "#Frp 内网穿透\n",
333
+ "use_frpc1 = False\n",
334
+ "frpconfigfile1 = '/kaggle/input/tenkens/7861.ini' # 非必填 frp 配置文件,本地端口 7860\n",
335
+ "\n",
336
+ "#第二个webui使用的模型\n",
337
+ "usedCkpt1 = 'cetusMix_Coda2.safetensors'\n",
338
+ "\n",
339
+ "#启动参数\n",
340
+ "args1 = [\n",
341
+ " '--share',\n",
342
+ " '--xformers',\n",
343
+ " '--lowram',\n",
344
+ " '--no-hashing',\n",
345
+ " '--disable-nan-check',\n",
346
+ " '--enable-insecure-extension-access',\n",
347
+ " '--disable-console-progressbars',\n",
348
+ " '--enable-console-prompts',\n",
349
+ " '--no-gradio-queue',\n",
350
+ " '--no-half-vae',\n",
351
+ " '--api',\n",
352
+ " f'--lyco-dir {install_path}/models/lyco',\n",
353
+ "]"
354
+ ]
355
+ },
356
+ {
357
+ "cell_type": "code",
358
+ "execution_count": 5,
359
+ "metadata": {
360
+ "execution": {
361
+ "iopub.execute_input": "2023-06-06T13:31:46.592964Z",
362
+ "iopub.status.busy": "2023-06-06T13:31:46.592528Z",
363
+ "iopub.status.idle": "2023-06-06T13:31:46.604934Z",
364
+ "shell.execute_reply": "2023-06-06T13:31:46.603982Z",
365
+ "shell.execute_reply.started": "2023-06-06T13:31:46.592932Z"
366
+ }
367
+ },
368
+ "outputs": [],
369
+ "source": [
370
+ "#使用的库\n",
371
+ "from pathlib import Path\n",
372
+ "import subprocess\n",
373
+ "import pandas as pd\n",
374
+ "import shutil\n",
375
+ "import os\n",
376
+ "import time\n",
377
+ "import re\n",
378
+ "import gc\n",
379
+ "import requests\n",
380
+ "import zipfile\n",
381
+ "from concurrent.futures import ProcessPoolExecutor\n",
382
+ "os.environ['install_path'] = install_path"
383
+ ]
384
+ },
385
+ {
386
+ "cell_type": "code",
387
+ "execution_count": 6,
388
+ "metadata": {
389
+ "execution": {
390
+ "iopub.execute_input": "2023-06-06T13:31:46.639329Z",
391
+ "iopub.status.busy": "2023-06-06T13:31:46.638634Z",
392
+ "iopub.status.idle": "2023-06-06T13:31:46.656693Z",
393
+ "shell.execute_reply": "2023-06-06T13:31:46.655745Z",
394
+ "shell.execute_reply.started": "2023-06-06T13:31:46.639297Z"
395
+ }
396
+ },
397
+ "outputs": [],
398
+ "source": [
399
+ "#功能函数,内存优化\n",
400
+ "def libtcmalloc():\n",
401
+ " if os.path.exists('/kaggle/temp'):\n",
402
+ " os.chdir('/kaggle')\n",
403
+ " os.chdir('temp')\n",
404
+ " os.environ[\"LD_PRELOAD\"] = \"libtcmalloc.so\"\n",
405
+ " print('内存优化已安装')\n",
406
+ " else:\n",
407
+ " \n",
408
+ " if use_frpc:\n",
409
+ " !aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/datasets/ACCA225/Frp/resolve/main/frpc -d /kaggle/working/frpc -o frpc\n",
410
+ " os.system('pip install -q pyngrok ')\n",
411
+ " os.chdir('/kaggle')\n",
412
+ " os.makedirs('temp', exist_ok=True)\n",
413
+ " os.chdir('temp')\n",
414
+ " os.system('wget -qq http://launchpadlibrarian.net/367274644/libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb')\n",
415
+ " os.system('wget -qq https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/google-perftools_2.5-2.2ubuntu3_all.deb')\n",
416
+ " os.system('wget -qq https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb')\n",
417
+ " os.system('wget -qq https://launchpad.net/ubuntu/+source/google-perftools/2.5-2.2ubuntu3/+build/14795286/+files/libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb')\n",
418
+ " os.system('apt install -qq libunwind8-dev -y')\n",
419
+ " !dpkg -i *.deb\n",
420
+ " os.environ[\"LD_PRELOAD\"] = \"libtcmalloc.so\"\n",
421
+ " !rm *.deb\n",
422
+ " print('内存优化已安装')"
423
+ ]
424
+ },
425
+ {
426
+ "cell_type": "code",
427
+ "execution_count": 7,
428
+ "metadata": {
429
+ "execution": {
430
+ "iopub.execute_input": "2023-06-06T13:31:46.663280Z",
431
+ "iopub.status.busy": "2023-06-06T13:31:46.662694Z",
432
+ "iopub.status.idle": "2023-06-06T13:31:46.803906Z",
433
+ "shell.execute_reply": "2023-06-06T13:31:46.802897Z",
434
+ "shell.execute_reply.started": "2023-06-06T13:31:46.663234Z"
435
+ }
436
+ },
437
+ "outputs": [],
438
+ "source": [
439
+ "#功能函数,环境和sd_webui安装\n",
440
+ "def unzip_file(src: str, dest: str = '/kaggle/outputs'):\n",
441
+ " if os.path.exists(src):\n",
442
+ " with zipfile.ZipFile(src, 'r') as zip_ref:\n",
443
+ " for member in zip_ref.namelist():\n",
444
+ " filename = os.path.basename(member)\n",
445
+ " if not filename:\n",
446
+ " continue\n",
447
+ " dest_file = os.path.join(dest, filename)\n",
448
+ " if os.path.exists(dest_file):\n",
449
+ " os.remove(dest_file)\n",
450
+ " zip_ref.extract(member, dest)\n",
451
+ "\n",
452
+ "def webui_config_download(yun_files, huggiingface_repo_id):\n",
453
+ " %cd $install_path/stable-diffusion-webui/\n",
454
+ " for yun_file in yun_files:\n",
455
+ " url = f'https://huggingface.co/datasets/{huggiingface_repo_id}/resolve/main/{yun_file}'\n",
456
+ " response = requests.head(url)\n",
457
+ " if response.status_code == 200:\n",
458
+ " result = subprocess.run(['wget', '-O', yun_file, url, '-q'], capture_output=True)\n",
459
+ " if result.returncode != 0:\n",
460
+ " print(f'Error: Failed to download {yun_file} from {url}')\n",
461
+ " else:\n",
462
+ " print(f'Error: Invalid URL {url}')\n",
463
+ " \n",
464
+ "def venv_install():\n",
465
+ " %cd /opt/conda/envs\n",
466
+ " if os.path.exists('venv'):\n",
467
+ " print('环境已安装')\n",
468
+ " else:\n",
469
+ " %cd /kaggle/working/\n",
470
+ " if not os.path.exists('venv.tar.gz'):\n",
471
+ " print('环境包下载中')\n",
472
+ " !wget https://huggingface.co/datasets/sukaka/venv_ai_drow/resolve/main/sd_webui/sd_webui_torch201_cu118_xf20.tar.gz -O venv.tar.gz\n",
473
+ " print('环境包已下载')\n",
474
+ " %cd /opt/conda/envs/\n",
475
+ " !mkdir venv\n",
476
+ " %cd venv\n",
477
+ " print('环境安装中')\n",
478
+ " os.system('apt -y install -qq pigz > /dev/null 2>&1')\n",
479
+ " !pigz -dc -p 5 /kaggle/working/venv.tar.gz | tar xf -\n",
480
+ " !source /opt/conda/bin/activate venv\n",
481
+ " print('环境安装完毕')\n",
482
+ "\n",
483
+ "#安装webui\n",
484
+ "def install_webui():\n",
485
+ " %cd $install_path\n",
486
+ " if reLoad:\n",
487
+ " !rm -rf stable-diffusion-webui\n",
488
+ " if Path(\"stable-diffusion-webui\").exists():\n",
489
+ " if updata_webui:\n",
490
+ " %cd $install_path/stable-diffusion-webui/\n",
491
+ " !git pull\n",
492
+ " print('stable-diffusion-webui已安装')\n",
493
+ " else:\n",
494
+ " print('stable-diffusion-webui安装中')\n",
495
+ " #Download Automatic1111's Stable Diffusion Web UI\n",
496
+ " !git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui\n",
497
+ " %cd $install_path/stable-diffusion-webui/\n",
498
+ " #Use lastest version\n",
499
+ " !git checkout 20ae71faa8ef035c31aa3a410b707d792c8203a3\n",
500
+ " with open('launch.py', 'r') as f:\n",
501
+ " content = f.read()\n",
502
+ " with open('launch.py', 'w') as f:\n",
503
+ " f.write('import ssl\\n')\n",
504
+ " f.write('ssl._create_default_https_context = ssl._create_unverified_context\\n')\n",
505
+ " f.write(content)\n",
506
+ " print('stable-diffusion-webui已安装')\n",
507
+ " if huggingface_use:\n",
508
+ " webui_config_download(yun_files, huggiingface_repo_id)\n",
509
+ " \n",
510
+ " unzip_file('/kaggle/working/图片.zip')\n",
511
+ " install_extensions(install_path, extensions)\n",
512
+ " download_model()\n",
513
+ " link_models()"
514
+ ]
515
+ },
516
+ {
517
+ "cell_type": "code",
518
+ "execution_count": 8,
519
+ "metadata": {
520
+ "execution": {
521
+ "iopub.execute_input": "2023-06-06T13:31:46.807018Z",
522
+ "iopub.status.busy": "2023-06-06T13:31:46.806411Z",
523
+ "iopub.status.idle": "2023-06-06T13:31:46.833796Z",
524
+ "shell.execute_reply": "2023-06-06T13:31:46.832760Z",
525
+ "shell.execute_reply.started": "2023-06-06T13:31:46.806981Z"
526
+ }
527
+ },
528
+ "outputs": [],
529
+ "source": [
530
+ "from concurrent.futures import ThreadPoolExecutor\n",
531
+ "# 安装插件,下载和同步模型\n",
532
+ "def install_extensions(install_path, extensions):\n",
533
+ " print('安装插件,此处出现红条是正常的')\n",
534
+ " os.chdir(os.path.join(install_path, 'stable-diffusion-webui'))\n",
535
+ " os.makedirs('extensions', exist_ok=True)\n",
536
+ " os.chdir('extensions')\n",
537
+ "\n",
538
+ " def clone_repo(ex):\n",
539
+ " repo_name = ex.split('/')[-1]\n",
540
+ " if not os.path.exists(repo_name):\n",
541
+ " os.system('git clone ' + ex)\n",
542
+ "\n",
543
+ " with ThreadPoolExecutor(max_workers=4) as executor:\n",
544
+ " executor.map(clone_repo, extensions)\n",
545
+ " \n",
546
+ "def download_link(link, target_folder):\n",
547
+ " if link.startswith('https://huggingface.co/'):\n",
548
+ " filename = re.search(r'[^/]+$', link).group(0)\n",
549
+ " return f'aria2c --console-log-level=error -q -c -x 16 -s 16 -k 1M -d \"{target_folder}\" -o \"{filename}\" \"{link}\"'\n",
550
+ " else:\n",
551
+ " return f'aria2c --console-log-level=error -q -c -x 16 -s 16 -k 1M --remote-time -d \"{target_folder}\" \"{link}\"'\n",
552
+ "\n",
553
+ "def download_links(links, target_folder):\n",
554
+ " tasks = []\n",
555
+ " for link in links:\n",
556
+ " tasks.append(download_link(link, target_folder))\n",
557
+ " return tasks\n",
558
+ "\n",
559
+ "def download_links_all(tasks):\n",
560
+ " with ThreadPoolExecutor(max_workers=5) as executor:\n",
561
+ " for task in tasks:\n",
562
+ " executor.submit(os.system, task)\n",
563
+ " \n",
564
+ "# 下载模型文件\n",
565
+ "def download_model():\n",
566
+ " os.chdir('/kaggle')\n",
567
+ " os.makedirs('models', exist_ok=True)\n",
568
+ " os.chdir('models')\n",
569
+ " os.makedirs('VAE', exist_ok=True)\n",
570
+ " os.makedirs('Stable-diffusion', exist_ok=True)\n",
571
+ " os.makedirs('Lora', exist_ok=True)\n",
572
+ " os.makedirs('cn-model', exist_ok=True)\n",
573
+ " os.makedirs('hypernetworks', exist_ok=True)\n",
574
+ " os.makedirs('ESRGAN', exist_ok=True)\n",
575
+ " os.makedirs('lyco', exist_ok=True)\n",
576
+ " tasks = []\n",
577
+ " tasks.extend(download_links(vae_model_urls, 'VAE'))\n",
578
+ " tasks.extend(download_links(sd_model_urls, 'Stable-diffusion'))\n",
579
+ " tasks.extend(download_links(lora_model_urls, 'Lora'))\n",
580
+ " tasks.extend(download_links(cn_model_urls, 'cn-model'))\n",
581
+ " tasks.extend(download_links(hypernetworks_model_urls, 'hypernetworks'))\n",
582
+ " tasks.extend(download_links(ESRGAN_urls, 'ESRGAN'))\n",
583
+ " tasks.extend(download_links(lyco_model_urls, 'lyco'))\n",
584
+ " tasks.extend(download_links(embeddings_model_urls, f'{install_path}/stable-diffusion-webui/embeddings'))\n",
585
+ " tasks.extend(download_links(scripts_urls, f'{install_path}/stable-diffusion-webui/scripts'))\n",
586
+ " tasks.extend(download_links(tags_urls, f'{install_path}/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/tags'))\n",
587
+ " download_links_all(tasks)\n",
588
+ "\n",
589
+ "def create_symlinks(folder_paths, target_dir):\n",
590
+ " # Create target directory if it doesn't exist\n",
591
+ " if not os.path.exists(target_dir):\n",
592
+ " os.makedirs(target_dir)\n",
593
+ " # Remove broken symlinks in target directory\n",
594
+ " for filename in os.listdir(target_dir):\n",
595
+ " target_path = os.path.join(target_dir, filename)\n",
596
+ " if os.path.islink(target_path) and not os.path.exists(target_path):\n",
597
+ " os.unlink(target_path)\n",
598
+ " # Create new symlinks\n",
599
+ " for source_path in folder_paths:\n",
600
+ " if not os.path.exists(source_path):\n",
601
+ " continue\n",
602
+ " if os.path.isdir(source_path):\n",
603
+ " for filename in os.listdir(source_path):\n",
604
+ " source_file_path = os.path.join(source_path, filename)\n",
605
+ " target_file_path = os.path.join(target_dir, filename)\n",
606
+ " if not os.path.exists(target_file_path):\n",
607
+ " os.symlink(source_file_path, target_file_path)\n",
608
+ " print(f'Created symlink for {filename} in {target_dir}')\n",
609
+ " else:\n",
610
+ " filename = os.path.basename(source_path)\n",
611
+ " target_file_path = os.path.join(target_dir, filename)\n",
612
+ " if not os.path.exists(target_file_path):\n",
613
+ " os.symlink(source_path, target_file_path)\n",
614
+ " print(f'Created symlink for {filename} in {target_dir}')\n",
615
+ "\n",
616
+ "# 链接模型文件\n",
617
+ "def link_models():\n",
618
+ " cn_model.append('/kaggle/models/cn-model')\n",
619
+ " vae_model.append('/kaggle/models/VAE')\n",
620
+ " sd_model.append('/kaggle/models/Stable-diffusion')\n",
621
+ " lora_model.append('/kaggle/models/Lora')\n",
622
+ " hypernetworks_model.append('/kaggle/models/hypernetworks')\n",
623
+ " ESRGAN.append('/kaggle/models/ESRGAN')\n",
624
+ " lyco_model.append('/kaggle/models/lyco')\n",
625
+ " \n",
626
+ " create_symlinks(vae_model,f'{install_path}/stable-diffusion-webui/models/VAE')\n",
627
+ " create_symlinks(sd_model,f'{install_path}/stable-diffusion-webui/models/Stable-diffusion')\n",
628
+ " create_symlinks(lora_model,f'{install_path}/stable-diffusion-webui/models/Lora')\n",
629
+ " create_symlinks(cn_model,f'{install_path}/stable-diffusion-webui/extensions/sd-webui-controlnet/models')\n",
630
+ " create_symlinks(embeddings_model,f'{install_path}/stable-diffusion-webui/embeddings')\n",
631
+ " create_symlinks(hypernetworks_model,f'{install_path}/stable-diffusion-webui/models/hypernetworks')\n",
632
+ " create_symlinks(ESRGAN,f'{install_path}/stable-diffusion-webui/models/ESRGAN')\n",
633
+ " create_symlinks(tags,f'{install_path}/stable-diffusion-webui/extensions/a1111-sd-webui-tagcomplete/tags')\n",
634
+ " create_symlinks(scripts,f'{install_path}/stable-diffusion-webui/scripts')\n",
635
+ " create_symlinks(lyco_model,f'{install_path}/stable-diffusion-webui/models/lyco')\n"
636
+ ]
637
+ },
638
+ {
639
+ "cell_type": "code",
640
+ "execution_count": 9,
641
+ "metadata": {
642
+ "execution": {
643
+ "iopub.execute_input": "2023-06-06T13:31:46.836148Z",
644
+ "iopub.status.busy": "2023-06-06T13:31:46.835356Z",
645
+ "iopub.status.idle": "2023-06-06T13:31:46.848925Z",
646
+ "shell.execute_reply": "2023-06-06T13:31:46.847899Z",
647
+ "shell.execute_reply.started": "2023-06-06T13:31:46.836114Z"
648
+ }
649
+ },
650
+ "outputs": [],
651
+ "source": [
652
+ "# 功能函数:内网穿透\n",
653
+ "#ngrok\n",
654
+ "def ngrok_start(ngrokTokenFile: str, port: int, address_name: str, should_run: bool):\n",
655
+ " if not should_run:\n",
656
+ " print('Skipping ngrok start')\n",
657
+ " return\n",
658
+ " if Path(ngrokTokenFile).exists():\n",
659
+ " with open(ngrokTokenFile, encoding=\"utf-8\") as nkfile:\n",
660
+ " ngrokToken = nkfile.readline()\n",
661
+ " print('use nrgok')\n",
662
+ " from pyngrok import conf, ngrok\n",
663
+ " conf.get_default().auth_token = ngrokToken\n",
664
+ " conf.get_default().monitor_thread = False\n",
665
+ " ssh_tunnels = ngrok.get_tunnels(conf.get_default())\n",
666
+ " if len(ssh_tunnels) == 0:\n",
667
+ " ssh_tunnel = ngrok.connect(port, bind_tls=True)\n",
668
+ " print(f'{address_name}:' + ssh_tunnel.public_url)\n",
669
+ " else:\n",
670
+ " print(f'{address_name}:' + ssh_tunnels[0].public_url)\n",
671
+ " else:\n",
672
+ " print('skip start ngrok')\n",
673
+ "\n",
674
+ "#Frp内网穿透 \n",
675
+ "import subprocess\n",
676
+ "\n",
677
+ "def install_Frpc(port, frpconfigfile, use_frpc):\n",
678
+ " if use_frpc:\n",
679
+ " subprocess.run(['chmod', '+x', '/kaggle/working/frpc/frpc'], check=True)\n",
680
+ " print(f'正在启动frp ,端口{port}')\n",
681
+ " subprocess.Popen(['/kaggle/working/frpc/frpc', '-c', frpconfigfile])\n"
682
+ ]
683
+ },
684
+ {
685
+ "cell_type": "code",
686
+ "execution_count": 10,
687
+ "metadata": {
688
+ "execution": {
689
+ "iopub.execute_input": "2023-06-06T13:31:46.850990Z",
690
+ "iopub.status.busy": "2023-06-06T13:31:46.850524Z",
691
+ "iopub.status.idle": "2023-06-06T13:31:46.880599Z",
692
+ "shell.execute_reply": "2023-06-06T13:31:46.879664Z",
693
+ "shell.execute_reply.started": "2023-06-06T13:31:46.850959Z"
694
+ }
695
+ },
696
+ "outputs": [],
697
+ "source": [
698
+ "#sd_webui启动\n",
699
+ "def start_webui_1():\n",
700
+ " if use2:\n",
701
+ " install_Frpc('7861',frpconfigfile1,use_frpc1)\n",
702
+ " ngrok_start(ngrokTokenFile1,7861,'第二个webui',ngrok_use1)\n",
703
+ " !sleep 90\n",
704
+ " %cd $install_path/stable-diffusion-webui\n",
705
+ " args1.append(f'--ckpt=models/Stable-diffusion/{usedCkpt1}')\n",
706
+ " !/opt/conda/envs/venv/bin/python3 launch.py {' '.join(args1)} --port 7861 --device-id=1\n",
707
+ " pass\n",
708
+ "\n",
709
+ "def start_webui_0():\n",
710
+ " %cd $install_path\n",
711
+ " install_Frpc('7860',frpconfigfile,use_frpc)\n",
712
+ " ngrok_start(ngrokTokenFile,7860,'第一个webui',ngrok_use)\n",
713
+ " %cd $install_path/stable-diffusion-webui\n",
714
+ " !mkdir models/lyco\n",
715
+ " args.append(f'--ckpt=models/Stable-diffusion/{usedCkpt}')\n",
716
+ " !/opt/conda/envs/venv/bin/python3 launch.py {' '.join(args)}\n",
717
+ " \n",
718
+ "def start_webui():\n",
719
+ " with ProcessPoolExecutor() as executor:\n",
720
+ " futures = []\n",
721
+ " for func in [start_webui_0, start_webui_1]:\n",
722
+ " futures.append(executor.submit(func))\n",
723
+ " time.sleep(1)\n",
724
+ " for future in futures:\n",
725
+ " future.result()"
726
+ ]
727
+ },
728
+ {
729
+ "cell_type": "code",
730
+ "execution_count": 11,
731
+ "metadata": {
732
+ "ExecutionIndicator": {
733
+ "show": false
734
+ },
735
+ "execution": {
736
+ "iopub.execute_input": "2023-06-06T13:31:46.885282Z",
737
+ "iopub.status.busy": "2023-06-06T13:31:46.884930Z",
738
+ "iopub.status.idle": "2023-06-06T13:31:46.894440Z",
739
+ "shell.execute_reply": "2023-06-06T13:31:46.893449Z",
740
+ "shell.execute_reply.started": "2023-06-06T13:31:46.885258Z"
741
+ },
742
+ "tags": []
743
+ },
744
+ "outputs": [],
745
+ "source": [
746
+ "def main():\n",
747
+ " startTicks = time.time()\n",
748
+ " os.system('apt-get update')\n",
749
+ " os.system('apt -y install -qq aria2')\n",
750
+ " with ProcessPoolExecutor() as executor:\n",
751
+ " futures = []\n",
752
+ " for func in [install_webui, venv_install,libtcmalloc]:\n",
753
+ " futures.append(executor.submit(func))\n",
754
+ " time.sleep(0.5)\n",
755
+ " for future in futures:\n",
756
+ " future.result()\n",
757
+ " libtcmalloc()\n",
758
+ " ticks = time.time()\n",
759
+ " print(\"加载耗时:\",(ticks - startTicks),\"s\")\n",
760
+ " start_webui()"
761
+ ]
762
+ },
763
+ {
764
+ "cell_type": "code",
765
+ "execution_count": 12,
766
+ "metadata": {
767
+ "execution": {
768
+ "iopub.execute_input": "2023-06-06T13:31:46.897858Z",
769
+ "iopub.status.busy": "2023-06-06T13:31:46.896912Z",
770
+ "iopub.status.idle": "2023-06-06T13:31:47.215286Z",
771
+ "shell.execute_reply": "2023-06-06T13:31:47.214328Z",
772
+ "shell.execute_reply.started": "2023-06-06T13:31:46.897806Z"
773
+ }
774
+ },
775
+ "outputs": [],
776
+ "source": [
777
+ "#功能函数,清理打包上传\n",
778
+ "from pathlib import Path\n",
779
+ "from huggingface_hub import HfApi, login\n",
780
+ "\n",
781
+ "def zip_venv():\n",
782
+ " !pip install conda-pack\n",
783
+ " !rm -rf /kaggle/working/venv.tar.gz\n",
784
+ " !conda pack -n venv -o /kaggle/working/venv.tar.gz --compress-level 0\n",
785
+ "\n",
786
+ "def hugface_upload(huggingface_token_file, yun_files, repo_id):\n",
787
+ " if Path(huggingface_token_file).exists():\n",
788
+ " with open(huggingface_token_file, encoding=\"utf-8\") as nkfile:\n",
789
+ " hugToken = nkfile.readline()\n",
790
+ " if hugToken != '':\n",
791
+ " # 使用您的 Hugging Face 访问令牌登录\n",
792
+ " login(token=hugToken)\n",
793
+ " # 实例化 HfApi 类\n",
794
+ " api = HfApi()\n",
795
+ " print(\"HfApi 类已实例化\")\n",
796
+ " %cd $install_path/stable-diffusion-webui\n",
797
+ " # 使用 upload_file() 函数上传文件\n",
798
+ " print(\"开始上传文件...\")\n",
799
+ " for yun_file in yun_files:\n",
800
+ " if Path(yun_file).exists():\n",
801
+ " response = api.upload_file(\n",
802
+ " path_or_fileobj=yun_file,\n",
803
+ " path_in_repo=yun_file,\n",
804
+ " repo_id=repo_id,\n",
805
+ " repo_type=\"dataset\"\n",
806
+ " )\n",
807
+ " print(\"文件上传完成\")\n",
808
+ " print(f\"响应: {response}\")\n",
809
+ " else:\n",
810
+ " print(f'Error: File {yun_file} does not exist')\n",
811
+ " else:\n",
812
+ " print(f'Error: File {huggingface_token_file} does not exist')\n",
813
+ "\n",
814
+ "def clean_folder(folder_path):\n",
815
+ " if not os.path.exists(folder_path):\n",
816
+ " return\n",
817
+ " for filename in os.listdir(folder_path):\n",
818
+ " file_path = os.path.join(folder_path, filename)\n",
819
+ " if os.path.isfile(file_path):\n",
820
+ " os.remove(file_path)\n",
821
+ " elif os.path.isdir(file_path):\n",
822
+ " shutil.rmtree(file_path)\n",
823
+ "\n",
824
+ "def zip_clear_updata():\n",
825
+ " if zip_output:\n",
826
+ " output_folder = '/kaggle/outputs/'\n",
827
+ " if os.path.exists(output_folder):\n",
828
+ " shutil.make_archive('/kaggle/working/图片', 'zip', output_folder)\n",
829
+ " print('图片已压缩到output')\n",
830
+ " else:\n",
831
+ " print(f'文件夹 {output_folder} 不存在,跳过压缩操作')\n",
832
+ " if clear_output:\n",
833
+ " %cd /kaggle/outputs/\n",
834
+ " clean_folder('img2img-images')\n",
835
+ " clean_folder('txt2img-images')\n",
836
+ " clean_folder('img2img-grids')\n",
837
+ " clean_folder('txt2img-grids')\n",
838
+ " clean_folder('extras-images')\n",
839
+ " print('清理完毕')\n",
840
+ " if huggingface_use == True:\n",
841
+ " hugface_upload(huggingface_token_file,yun_files,huggiingface_repo_id)\n",
842
+ " if use_zip_venv == True:\n",
843
+ " zip_venv()"
844
+ ]
845
+ },
846
+ {
847
+ "cell_type": "code",
848
+ "execution_count": 13,
849
+ "metadata": {
850
+ "_kg_hide-input": true,
851
+ "_kg_hide-output": false,
852
+ "execution": {
853
+ "iopub.execute_input": "2023-06-06T13:31:47.217158Z",
854
+ "iopub.status.busy": "2023-06-06T13:31:47.216771Z",
855
+ "iopub.status.idle": "2023-06-06T13:40:24.664600Z",
856
+ "shell.execute_reply": "2023-06-06T13:40:24.661769Z",
857
+ "shell.execute_reply.started": "2023-06-06T13:31:47.217124Z"
858
+ }
859
+ },
860
+ "outputs": [
861
+ {
862
+ "name": "stderr",
863
+ "output_type": "stream",
864
+ "text": [
865
+ "\n",
866
+ "WARNING: apt does not have a stable CLI interface. Use with caution in scripts.\n",
867
+ "\n"
868
+ ]
869
+ },
870
+ {
871
+ "name": "stdout",
872
+ "output_type": "stream",
873
+ "text": [
874
+ "The following additional packages will be installed:\n",
875
+ " libaria2-0 libc-ares2 libssh2-1\n",
876
+ "The following NEW packages will be installed:\n",
877
+ " aria2 libaria2-0 libc-ares2 libssh2-1\n"
878
+ ]
879
+ },
880
+ {
881
+ "name": "stderr",
882
+ "output_type": "stream",
883
+ "text": [
884
+ "dpkg-preconfigure: unable to re-open stdin: No such file or directory\n"
885
+ ]
886
+ },
887
+ {
888
+ "name": "stdout",
889
+ "output_type": "stream",
890
+ "text": [
891
+ "0 upgraded, 4 newly installed, 0 to remove and 28 not upgraded.\n",
892
+ "Need to get 1622 kB of archives.\n",
893
+ "After this operation, 5817 kB of additional disk space will be used.\n",
894
+ "Selecting previously unselected package libc-ares2:amd64.\n",
895
+ "(Reading database ... 115376 files and directories currently installed.)\n",
896
+ "Preparing to unpack .../libc-ares2_1.18.1-1ubuntu0.22.04.1_amd64.deb ...\n",
897
+ "Unpacking libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.1) ...\n",
898
+ "Selecting previously unselected package libssh2-1:amd64.\n",
899
+ "Preparing to unpack .../libssh2-1_1.10.0-3_amd64.deb ...\n",
900
+ "Unpacking libssh2-1:amd64 (1.10.0-3) ...\n",
901
+ "Selecting previously unselected package libaria2-0:amd64.\n",
902
+ "Preparing to unpack .../libaria2-0_1.36.0-1_amd64.deb ...\n",
903
+ "Unpacking libaria2-0:amd64 (1.36.0-1) ...\n",
904
+ "Selecting previously unselected package aria2.\n",
905
+ "Preparing to unpack .../aria2_1.36.0-1_amd64.deb ...\n",
906
+ "Unpacking aria2 (1.36.0-1) ...\n",
907
+ "Setting up libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.1) ...\n",
908
+ "Setting up libssh2-1:amd64 (1.10.0-3) ...\n",
909
+ "Setting up libaria2-0:amd64 (1.36.0-1) ...\n",
910
+ "Setting up aria2 (1.36.0-1) ...\n",
911
+ "Processing triggers for man-db (2.10.2-1) ...\n",
912
+ "Processing triggers for libc-bin (2.35-0ubuntu3.1) ...\n",
913
+ "/kaggle/working\n",
914
+ "stable-diffusion-webui安装中\n",
915
+ "/opt/conda/envs\n",
916
+ "/kaggle/working\n",
917
+ "环境包下载中\n",
918
+ "Cloning into 'stable-diffusion-webui'...\n",
919
+ "--2023-06-06 13:31:56-- https://huggingface.co/datasets/sukaka/venv_ai_drow/resolve/main/sd_webui/sd_webui_torch201_cu118_xf20.tar.gz\n",
920
+ "Resolving huggingface.co (huggingface.co)... 18.172.170.36, 18.172.170.44, 18.172.170.14, ...\n",
921
+ "Connecting to huggingface.co (huggingface.co)|18.172.170.36|:443... connected.\n",
922
+ "HTTP request sent, awaiting response... 302 Found\n",
923
+ "Location: https://cdn-lfs.huggingface.co/repos/93/61/936160f9623602ad97a9fe4c639531b59f4fe39854fcc22d75692344fb5dfbe2/609336a63928c38f99b0f842dd5d08e1bf255a8add61cbe82301ca5611831b34?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27sd_webui_torch201_cu118_xf20.tar.gz%3B+filename%3D%22sd_webui_torch201_cu118_xf20.tar.gz%22%3B&response-content-type=application%2Fgzip&Expires=1686317516&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzkzLzYxLzkzNjE2MGY5NjIzNjAyYWQ5N2E5ZmU0YzYzOTUzMWI1OWY0ZmUzOTg1NGZjYzIyZDc1NjkyMzQ0ZmI1ZGZiZTIvNjA5MzM2YTYzOTI4YzM4Zjk5YjBmODQyZGQ1ZDA4ZTFiZjI1NWE4YWRkNjFjYmU4MjMwMWNhNTYxMTgzMWIzND9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2ODYzMTc1MTZ9fX1dfQ__&Signature=LwdrbEvX1FsAqiCMdTpr0MpZSEMQNNbdeFdUntUzSm0wgYI4id719q7A7SQsLFDp1Nxem0qv1SWZUOp56Rn4dDMLBompEERivj0WIDqUueRmZfBvVK6YevuBeACN4Vc8XGtepe0XDJdfRf3fbeAmOwzAClyVbwAvrbXm6vCREihObTNQ4-SOTR2Lps6vWXn1K-z%7EhbUVAINqrFC1mNsRLcUYGx8ZHCiQA%7Ez35UiOURAONM-0myvcZlM0wZQRy819DJsD5q1SSfe27yyO262PkWt4dv0ra%7EmqLcP1msDNmyB2%7E%7EgRCKPTFX-r4SO0Il7WvtoupBEuqjou7LLyWzh2UA__&Key-Pair-Id=KVTP0A1DKRTAX [following]\n",
924
+ "--2023-06-06 13:31:56-- https://cdn-lfs.huggingface.co/repos/93/61/936160f9623602ad97a9fe4c639531b59f4fe39854fcc22d75692344fb5dfbe2/609336a63928c38f99b0f842dd5d08e1bf255a8add61cbe82301ca5611831b34?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27sd_webui_torch201_cu118_xf20.tar.gz%3B+filename%3D%22sd_webui_torch201_cu118_xf20.tar.gz%22%3B&response-content-type=application%2Fgzip&Expires=1686317516&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZG4tbGZzLmh1Z2dpbmdmYWNlLmNvL3JlcG9zLzkzLzYxLzkzNjE2MGY5NjIzNjAyYWQ5N2E5ZmU0YzYzOTUzMWI1OWY0ZmUzOTg1NGZjYzIyZDc1NjkyMzQ0ZmI1ZGZiZTIvNjA5MzM2YTYzOTI4YzM4Zjk5YjBmODQyZGQ1ZDA4ZTFiZjI1NWE4YWRkNjFjYmU4MjMwMWNhNTYxMTgzMWIzND9yZXNwb25zZS1jb250ZW50LWRpc3Bvc2l0aW9uPSomcmVzcG9uc2UtY29udGVudC10eXBlPSoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2ODYzMTc1MTZ9fX1dfQ__&Signature=LwdrbEvX1FsAqiCMdTpr0MpZSEMQNNbdeFdUntUzSm0wgYI4id719q7A7SQsLFDp1Nxem0qv1SWZUOp56Rn4dDMLBompEERivj0WIDqUueRmZfBvVK6YevuBeACN4Vc8XGtepe0XDJdfRf3fbeAmOwzAClyVbwAvrbXm6vCREihObTNQ4-SOTR2Lps6vWXn1K-z%7EhbUVAINqrFC1mNsRLcUYGx8ZHCiQA%7Ez35UiOURAONM-0myvcZlM0wZQRy819DJsD5q1SSfe27yyO262PkWt4dv0ra%7EmqLcP1msDNmyB2%7E%7EgRCKPTFX-r4SO0Il7WvtoupBEuqjou7LLyWzh2UA__&Key-Pair-Id=KVTP0A1DKRTAX\n",
925
+ "Resolving cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)... 18.65.229.16, 18.65.229.73, 18.65.229.83, ...\n",
926
+ "Connecting to cdn-lfs.huggingface.co (cdn-lfs.huggingface.co)|18.65.229.16|:443... connected.\n",
927
+ "HTTP request sent, awaiting response... 200 OK\n",
928
+ "Length: 2912904935 (2.7G) [application/gzip]\n",
929
+ "Saving to: ‘venv.tar.gz’\n",
930
+ "\n",
931
+ "venv.tar.gz 0%[ ] 0 --.-KB/s remote: Enumerating objects: 22280, done.\u001b[K\n",
932
+ "remote: Counting objects: 100% (426/426), done.\u001b[K\n",
933
+ "remote: Compressing objects: 100% (250/250), done.\u001b[K\n",
934
+ "remote: Total 22280 (delta 235), reused 291 (delta 156), pack-reused 21854\u001b[K Receiving objects: 2% (446/22280)Receiving objects: 23% (5125/22280)Receiving objects: 30% (6684/22280), 5.04 MiB | 10.07 MiB/sReceiving objects: 36% (8021/22280), 5.04 MiB | 10.07 MiB/sReceiving objects: 46% (10249/22280), 5.04 MiB | 10.07 MiB/sReceiving objects: 54% (12032/22280), 16.66 MiB | 11.08 MiB/sReceiving objects: 70% (15596/22280), 16.66 MiB | 11.08 MiB/sReceiving objects: 70% (15600/22280), 24.78 MiB | 12.37 MiB/sReceiving objects: 71% (15819/22280), 24.78 MiB | 12.37 MiB/sReceiving objects: 98% (21835/22280), 24.78 MiB | 12.37 MiB/s\n",
935
+ "Receiving objects: 100% (22280/22280), 30.32 MiB | 12.89 MiB/s, done.\n",
936
+ "Resolving deltas: 100% (15566/15566), done. ] 557.84M 138MB/s eta 17s Resolving deltas: 6% (934/15566)Resolving deltas: 14% (2180/15566)Resolving deltas: 16% (2491/15566)Resolving deltas: 25% (3892/15566)Resolving deltas: 32% (4982/15566)Resolving deltas: 56% (8717/15566)Resolving deltas: 95% (14788/15566)\n",
937
+ "venv.tar.gz 23%[===> ] 649.56M 146MB/s eta 15s /kaggle/working/stable-diffusion-webui\n",
938
+ "venv.tar.gz 33%[=====> ] 933.63M 168MB/s eta 12s Note: switching to '20ae71faa8ef035c31aa3a410b707d792c8203a3'.\n",
939
+ "\n",
940
+ "You are in 'detached HEAD' state. You can look around, make experimental\n",
941
+ "changes and commit them, and you can discard any commits you make in this\n",
942
+ "state without impacting any branches by switching back to a branch.\n",
943
+ "\n",
944
+ "If you want to create a new branch to retain commits you create, you may\n",
945
+ "do so (now or later) by using -c with the switch command. Example:\n",
946
+ "\n",
947
+ " git switch -c <new-branch-name>\n",
948
+ "\n",
949
+ "Or undo this operation with:\n",
950
+ "\n",
951
+ " git switch -\n",
952
+ "\n",
953
+ "Turn off this advice by setting config variable advice.detachedHead to false\n",
954
+ "\n",
955
+ "HEAD is now at 20ae71fa fix linter issue for 1.3.0\n",
956
+ "venv.tar.gz 34%[=====> ] 966.61M 167MB/s eta 12s stable-diffusion-webui已安装\n",
957
+ "/kaggle/working/stable-diffusion-webui\n",
958
+ "venv.tar.gz 43%[=======> ] 1.19G 179MB/s eta 11s 安装插件,此处出现红条是正常的\n",
959
+ "venv.tar.gz 45%[========> ] 1.25G 186MB/s eta 11s "
960
+ ]
961
+ },
962
+ {
963
+ "name": "stderr",
964
+ "output_type": "stream",
965
+ "text": [
966
+ "Cloning into 'loopback_scaler'...\n",
967
+ "Cloning into 'sd-webui-depth-lib'...\n",
968
+ "Cloning into 'sd-civitai-browser'...\n",
969
+ "Cloning into 'sd-webui-controlnet'...\n"
970
+ ]
971
+ },
972
+ {
973
+ "name": "stdout",
974
+ "output_type": "stream",
975
+ "text": [
976
+ "venv.tar.gz 96%[==================> ] 2.63G 218MB/s eta 1s "
977
+ ]
978
+ },
979
+ {
980
+ "name": "stderr",
981
+ "output_type": "stream",
982
+ "text": [
983
+ "Cloning into 'sd-webui-3d-open-pose-editor'...\n",
984
+ "Cloning into 'stable-diffusion-webui-localization-zh_CN'...\n"
985
+ ]
986
+ },
987
+ {
988
+ "name": "stdout",
989
+ "output_type": "stream",
990
+ "text": [
991
+ "venv.tar.gz 97%[==================> ] 2.64G 203MB/s eta 1s "
992
+ ]
993
+ },
994
+ {
995
+ "name": "stderr",
996
+ "output_type": "stream",
997
+ "text": [
998
+ "Cloning into 'stable-diffusion-webui-two-shot'...\n"
999
+ ]
1000
+ },
1001
+ {
1002
+ "name": "stdout",
1003
+ "output_type": "stream",
1004
+ "text": [
1005
+ "venv.tar.gz 98%[==================> ] 2.67G 145MB/s eta 0s "
1006
+ ]
1007
+ },
1008
+ {
1009
+ "name": "stderr",
1010
+ "output_type": "stream",
1011
+ "text": [
1012
+ "Updating files: 95% (876/922)\r"
1013
+ ]
1014
+ },
1015
+ {
1016
+ "name": "stdout",
1017
+ "output_type": "stream",
1018
+ "text": [
1019
+ "venv.tar.gz 98%[==================> ] 2.67G 133MB/s eta 0s "
1020
+ ]
1021
+ },
1022
+ {
1023
+ "name": "stderr",
1024
+ "output_type": "stream",
1025
+ "text": [
1026
+ "Updating files: 100% (922/922), done.\n",
1027
+ "Cloning into 'a1111-sd-webui-tagcomplete'...\n"
1028
+ ]
1029
+ },
1030
+ {
1031
+ "name": "stdout",
1032
+ "output_type": "stream",
1033
+ "text": [
1034
+ "venv.tar.gz 100%[===================>] 2.71G 107MB/s in 16s \n",
1035
+ "\n",
1036
+ "2023-06-06 13:32:12 (173 MB/s) - ‘venv.tar.gz’ saved [2912904935/2912904935]\n",
1037
+ "\n",
1038
+ "环境包已下载\n",
1039
+ "/opt/conda/envs\n",
1040
+ "/opt/conda/envs/venv\n",
1041
+ "环境安装中\n"
1042
+ ]
1043
+ },
1044
+ {
1045
+ "name": "stderr",
1046
+ "output_type": "stream",
1047
+ "text": [
1048
+ "Cloning into 'multidiffusion-upscaler-for-automatic1111'...\n",
1049
+ "Cloning into 'sd-webui-cutoff'...\n",
1050
+ "Cloning into 'sd-webui-lora-block-weight'...\n",
1051
+ "Cloning into 'Stable-Diffusion-Webui-Civitai-Helper'...\n",
1052
+ "Cloning into 'stable-diffusion-webui'...\n",
1053
+ "Cloning into 'sd-webui-mov2mov'...\n",
1054
+ "Cloning into 'stable-diffusion-webui-wd14-tagger'...\n",
1055
+ "Cloning into 'sd-webui-prompt-all-in-one'...\n",
1056
+ "Cloning into 'a1111-sd-webui-lycoris'...\n",
1057
+ "Cloning into 'sd-webui-infinite-image-browsing'...\n"
1058
+ ]
1059
+ },
1060
+ {
1061
+ "name": "stdout",
1062
+ "output_type": "stream",
1063
+ "text": [
1064
+ "Created symlink for clearvae.vae.pt in /kaggle/working/stable-diffusion-webui/models/VAE\n",
1065
+ "Created symlink for vae-ft-mse-840000-ema-pruned.ckpt in /kaggle/working/stable-diffusion-webui/models/VAE\n",
1066
+ "Created symlink for vae-ft-ema-560000-ema-pruned.safetensors in /kaggle/working/stable-diffusion-webui/models/VAE\n",
1067
+ "Created symlink for klF8Anime2.vae.pt in /kaggle/working/stable-diffusion-webui/models/VAE\n",
1068
+ "Created symlink for libramix_v10.safetensors in /kaggle/working/stable-diffusion-webui/models/Stable-diffusion\n",
1069
+ "Created symlink for cetusMix_Coda2.safetensors in /kaggle/working/stable-diffusion-webui/models/Stable-diffusion\n",
1070
+ "Created symlink for 9527-non-ema-fp16.safetensors in /kaggle/working/stable-diffusion-webui/models/Stable-diffusion\n",
1071
+ "Created symlink for CounterfeitV30_v30.safetensors in /kaggle/working/stable-diffusion-webui/models/Stable-diffusion\n",
1072
+ "Created symlink for cetusMix_Version35.safetensors in /kaggle/working/stable-diffusion-webui/models/Stable-diffusion\n",
1073
+ "Created symlink for shanzhagao128dim-epoch-000010.safetensors in /kaggle/working/stable-diffusion-webui/models/Lora\n",
1074
+ "Created symlink for add_detail.safetensors in /kaggle/working/stable-diffusion-webui/models/Lora\n",
1075
+ "Created symlink for MoXinV1.safetensors in /kaggle/working/stable-diffusion-webui/models/Lora\n",
1076
+ "Created symlink for control_v11p_sd15_mlsd_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1077
+ "Created symlink for control_v11p_sd15s2_lineart_anime_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1078
+ "Created symlink for control_v11p_sd15_openpose_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1079
+ "Created symlink for control_v11p_sd15_normalbae_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1080
+ "Created symlink for control_v11p_sd15_canny_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1081
+ "Created symlink for control_v11p_sd15_lineart_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1082
+ "Created symlink for control_v11e_sd15_ip2p_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1083
+ "Created symlink for control_v11p_sd15_inpaint_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1084
+ "Created symlink for control_v11p_sd15_scribble_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1085
+ "Created symlink for control_v11u_sd15_tile_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1086
+ "Created symlink for control_v11f1p_sd15_depth_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1087
+ "Created symlink for control_v11e_sd15_shuffle_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1088
+ "Created symlink for control_v11p_sd15_softedge_fp16.safetensors in /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/models\n",
1089
+ "Created symlink for 4x-AnimeSharp.pth in /kaggle/working/stable-diffusion-webui/models/ESRGAN\n",
1090
+ "Created symlink for 4x_foolhardy_Remacri.pth in /kaggle/working/stable-diffusion-webui/models/ESRGAN\n",
1091
+ "Created symlink for 4x-UltraSharp.pth in /kaggle/working/stable-diffusion-webui/models/ESRGAN\n",
1092
+ "Created symlink for FilmProvia2.safetensors in /kaggle/working/stable-diffusion-webui/models/lyco\n",
1093
+ "环境安装完毕\n"
1094
+ ]
1095
+ },
1096
+ {
1097
+ "name": "stderr",
1098
+ "output_type": "stream",
1099
+ "text": [
1100
+ "WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n",
1101
+ "\n",
1102
+ "WARNING: apt does not have a stable CLI interface. Use with caution in scripts.\n",
1103
+ "\n"
1104
+ ]
1105
+ },
1106
+ {
1107
+ "name": "stdout",
1108
+ "output_type": "stream",
1109
+ "text": [
1110
+ "The following additional packages will be installed:\n",
1111
+ " liblzma-dev\n",
1112
+ "Suggested packages:\n",
1113
+ " liblzma-doc\n",
1114
+ "The following NEW packages will be installed:\n",
1115
+ " liblzma-dev libunwind-dev\n"
1116
+ ]
1117
+ },
1118
+ {
1119
+ "name": "stderr",
1120
+ "output_type": "stream",
1121
+ "text": [
1122
+ "dpkg-preconfigure: unable to re-open stdin: No such file or directory\n"
1123
+ ]
1124
+ },
1125
+ {
1126
+ "name": "stdout",
1127
+ "output_type": "stream",
1128
+ "text": [
1129
+ "0 upgraded, 2 newly installed, 0 to remove and 28 not upgraded.\n",
1130
+ "Need to get 2040 kB of archives.\n",
1131
+ "After this operation, 6754 kB of additional disk space will be used.\n",
1132
+ "Selecting previously unselected package liblzma-dev:amd64.\n",
1133
+ "(Reading database ... 115466 files and directories currently installed.)\n",
1134
+ "Preparing to unpack .../liblzma-dev_5.2.5-2ubuntu1_amd64.deb ...\n",
1135
+ "Unpacking liblzma-dev:amd64 (5.2.5-2ubuntu1) ...\n",
1136
+ "Selecting previously unselected package libunwind-dev:amd64.\n",
1137
+ "Preparing to unpack .../libunwind-dev_1.3.2-2build2_amd64.deb ...\n",
1138
+ "Unpacking libunwind-dev:amd64 (1.3.2-2build2) ...\n",
1139
+ "Setting up liblzma-dev:amd64 (5.2.5-2ubuntu1) ...\n",
1140
+ "Setting up libunwind-dev:amd64 (1.3.2-2build2) ...\n",
1141
+ "Processing triggers for man-db (2.10.2-1) ...\n",
1142
+ "Selecting previously unselected package google-perftools.\n",
1143
+ "(Reading database ... 115559 files and directories currently installed.)\n",
1144
+ "Preparing to unpack google-perftools_2.5-2.2ubuntu3_all.deb ...\n",
1145
+ "Unpacking google-perftools (2.5-2.2ubuntu3) ...\n",
1146
+ "Selecting previously unselected package libgoogle-perftools-dev.\n",
1147
+ "Preparing to unpack libgoogle-perftools-dev_2.5-2.2ubuntu3_amd64.deb ...\n",
1148
+ "Unpacking libgoogle-perftools-dev (2.5-2.2ubuntu3) ...\n",
1149
+ "Selecting previously unselected package libgoogle-perftools4.\n",
1150
+ "Preparing to unpack libgoogle-perftools4_2.5-2.2ubuntu3_amd64.deb ...\n",
1151
+ "Unpacking libgoogle-perftools4 (2.5-2.2ubuntu3) ...\n",
1152
+ "Selecting previously unselected package libtcmalloc-minimal4.\n",
1153
+ "Preparing to unpack libtcmalloc-minimal4_2.5-2.2ubuntu3_amd64.deb ...\n",
1154
+ "Unpacking libtcmalloc-minimal4 (2.5-2.2ubuntu3) ...\n",
1155
+ "Setting up libtcmalloc-minimal4 (2.5-2.2ubuntu3) ...\n",
1156
+ "Setting up libgoogle-perftools4 (2.5-2.2ubuntu3) ...\n",
1157
+ "Setting up google-perftools (2.5-2.2ubuntu3) ...\n",
1158
+ "Setting up libgoogle-perftools-dev (2.5-2.2ubuntu3) ...\n",
1159
+ "Processing triggers for man-db (2.10.2-1) ...\n",
1160
+ "Processing triggers for libc-bin (2.35-0ubuntu3.1) ...\n",
1161
+ "内存优化已安装\n",
1162
+ "内存优化已安装\n",
1163
+ "加载耗时: 249.6120264530182 s\n",
1164
+ "/kaggle/working\n",
1165
+ "skip start ngrok\n",
1166
+ "/kaggle/working/stable-diffusion-webui\n",
1167
+ "mkdir: cannot create directory ‘models/lyco’: File exists\n",
1168
+ "Python 3.10.11 | packaged by conda-forge | (main, May 10 2023, 18:58:44) [GCC 11.3.0]\n",
1169
+ "Version: v1.3.0\n",
1170
+ "Commit hash: 20ae71faa8ef035c31aa3a410b707d792c8203a3\n",
1171
+ "Installing clip\n",
1172
+ "Installing open_clip\n",
1173
+ "Cloning Stable Diffusion into /kaggle/working/stable-diffusion-webui/repositories/stable-diffusion-stability-ai...\n",
1174
+ "Cloning Taming Transformers into /kaggle/working/stable-diffusion-webui/repositories/taming-transformers...\n",
1175
+ "Cloning K-diffusion into /kaggle/working/stable-diffusion-webui/repositories/k-diffusion...\n",
1176
+ "Cloning CodeFormer into /kaggle/working/stable-diffusion-webui/repositories/CodeFormer...\n",
1177
+ "Cloning BLIP into /kaggle/working/stable-diffusion-webui/repositories/BLIP...\n",
1178
+ "Installing requirements for CodeFormer\n",
1179
+ "Installing requirements\n",
1180
+ "Installing sd-webui-infinite-image-browsing requirement: python-dotenv\n",
1181
+ "Installing sd-webui-infinite-image-browsing requirement: Pillow\n",
1182
+ "\n",
1183
+ "Installing sd-webui-controlnet requirement: mediapipe\n",
1184
+ "Installing sd-webui-controlnet requirement: svglib\n",
1185
+ "Installing sd-webui-controlnet requirement: fvcore\n",
1186
+ "\n",
1187
+ "Installing requirements for CivitAI Browser\n",
1188
+ "\n",
1189
+ "Installing sd-webui-prompt-all-in-one: translators\n",
1190
+ "Installing sd-webui-prompt-all-in-one: openai\n",
1191
+ "Installing sd-webui-prompt-all-in-one: boto3\n",
1192
+ "Installing sd-webui-prompt-all-in-one: aliyunsdkcore\n",
1193
+ "Installing sd-webui-prompt-all-in-one: aliyunsdkalimt\n",
1194
+ "\n",
1195
+ "Installing requirements for Mov2mov\n",
1196
+ "Installing requirements for ffmpeg\n",
1197
+ "\n",
1198
+ "Downloading pose_landmark_full.tflite...\n",
1199
+ "Downloading pose_web.binarypb...\n",
1200
+ "Downloading pose_solution_packed_assets.data...\n",
1201
+ "Downloading pose_solution_simd_wasm_bin.wasm...\n",
1202
+ "Downloading pose_solution_packed_assets_loader.js...\n",
1203
+ "Downloading pose_solution_simd_wasm_bin.js...\n",
1204
+ "\n",
1205
+ "Launching Web UI with arguments: --share --xformers --lowram --no-hashing --disable-nan-check --enable-insecure-extension-access --disable-console-progressbars --enable-console-prompts --no-gradio-queue --no-half-vae --api --lyco-dir /kaggle/working/models/lyco --ckpt=models/Stable-diffusion/cetusMix_Coda2.safetensors\n",
1206
+ "Error loading script: sampling.py\n",
1207
+ "Traceback (most recent call last):\n",
1208
+ " File \"/kaggle/working/stable-diffusion-webui/modules/scripts.py\", line 263, in load_scripts\n",
1209
+ " script_module = script_loading.load_module(scriptfile.path)\n",
1210
+ " File \"/kaggle/working/stable-diffusion-webui/modules/script_loading.py\", line 10, in load_module\n",
1211
+ " module_spec.loader.exec_module(module)\n",
1212
+ " File \"<frozen importlib._bootstrap_external>\", line 883, in exec_module\n",
1213
+ " File \"<frozen importlib._bootstrap>\", line 241, in _call_with_frames_removed\n",
1214
+ " File \"/kaggle/working/stable-diffusion-webui/scripts/sampling.py\", line 10, in <module>\n",
1215
+ " from . import utils\n",
1216
+ "ModuleNotFoundError: No module named 'sampling'\n",
1217
+ "\n",
1218
+ "Civitai Helper: Get Custom Model Folder\n",
1219
+ "Civitai Helper: Load setting from: /kaggle/working/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/setting.json\n",
1220
+ "Civitai Helper: No setting file, use default\n",
1221
+ "2023-06-06 13:38:28,215 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet v1.1.218\n",
1222
+ "ControlNet preprocessor location: /kaggle/working/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads\n",
1223
+ "2023-06-06 13:38:28,433 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet v1.1.218\n",
1224
+ "sd-webui-prompt-all-in-one background API service started successfully.\n",
1225
+ "Loading weights [None] from /kaggle/working/stable-diffusion-webui/models/Stable-diffusion/cetusMix_Coda2.safetensors\n",
1226
+ "Creating model from config: /kaggle/working/stable-diffusion-webui/configs/v1-inference.yaml\n",
1227
+ "LatentDiffusion: Running in eps-prediction mode\n",
1228
+ "DiffusionWrapper has 859.52 M params.\n",
1229
+ "Downloading (…)olve/main/vocab.json: 100%|███| 961k/961k [00:00<00:00, 5.12MB/s]\n",
1230
+ "Downloading (…)olve/main/merges.txt: 100%|███| 525k/525k [00:00<00:00, 2.66MB/s]\n",
1231
+ "Downloading (…)cial_tokens_map.json: 100%|█████| 389/389 [00:00<00:00, 2.00MB/s]\n",
1232
+ "Downloading (…)okenizer_config.json: 100%|█████| 905/905 [00:00<00:00, 5.70MB/s]\n",
1233
+ "Downloading (…)lve/main/config.json: 100%|█| 4.52k/4.52k [00:00<00:00, 17.6MB/s]\n",
1234
+ "Loading VAE weights specified in settings: /kaggle/working/stable-diffusion-webui/models/VAE/clearvae.vae.pt\n",
1235
+ "Applying optimization: xformers... done.\n",
1236
+ "Textual inversion embeddings loaded(5): bad-artist-anime, bad-hands-5, bad-image-v2-39000, bad_prompt_version2, EasyNegative\n",
1237
+ "Model loaded in 32.4s (load weights from disk: 21.1s, create model: 2.8s, apply weights to model: 4.7s, apply half(): 1.2s, load VAE: 1.7s, move model to device: 0.7s).\n",
1238
+ "Running on local URL: http://127.0.0.1:7860\n",
1239
+ "Running on public URL: https://e881356cce029f957d.gradio.live\n",
1240
+ "\n",
1241
+ "This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces\n",
1242
+ "Startup time: 52.3s (import torch: 2.8s, import gradio: 2.4s, import ldm: 2.4s, other imports: 2.1s, setup codeformer: 0.2s, load scripts: 2.7s, create ui: 32.9s, gradio launch: 6.5s, scripts app_started_callback: 0.2s).\n",
1243
+ "\n",
1244
+ "txt2img: masterpiece, best quality,\n",
1245
+ "\n",
1246
+ ",delicate, beautiful,colorful, vividcolor, lighting,\n",
1247
+ "\n",
1248
+ "100%|███████████████████████████████████████████| 24/24 [00:12<00:00, 1.93it/s]\n"
1249
+ ]
1250
+ },
1251
+ {
1252
+ "name": "stderr",
1253
+ "output_type": "stream",
1254
+ "text": [
1255
+ "Process ForkProcess-4:\n",
1256
+ "Traceback (most recent call last):\n",
1257
+ " File \"/opt/conda/lib/python3.10/multiprocessing/process.py\", line 314, in _bootstrap\n",
1258
+ " self.run()\n",
1259
+ " File \"/opt/conda/lib/python3.10/multiprocessing/process.py\", line 108, in run\n",
1260
+ " self._target(*self._args, **self._kwargs)\n",
1261
+ " File \"/opt/conda/lib/python3.10/concurrent/futures/process.py\", line 240, in _process_worker\n",
1262
+ " call_item = call_queue.get(block=True)\n",
1263
+ " File \"/opt/conda/lib/python3.10/multiprocessing/queues.py\", line 103, in get\n",
1264
+ " res = self._recv_bytes()\n",
1265
+ " File \"/opt/conda/lib/python3.10/multiprocessing/connection.py\", line 216, in recv_bytes\n",
1266
+ " buf = self._recv_bytes(maxlength)\n",
1267
+ " File \"/opt/conda/lib/python3.10/multiprocessing/connection.py\", line 414, in _recv_bytes\n",
1268
+ " buf = self._recv(4)\n",
1269
+ " File \"/opt/conda/lib/python3.10/multiprocessing/connection.py\", line 379, in _recv\n",
1270
+ " chunk = read(handle, remaining)\n",
1271
+ "KeyboardInterrupt\n"
1272
+ ]
1273
+ },
1274
+ {
1275
+ "ename": "KeyboardInterrupt",
1276
+ "evalue": "",
1277
+ "output_type": "error",
1278
+ "traceback": [
1279
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
1280
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
1281
+ "Cell \u001b[0;32mIn[13], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# start\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[43mmain\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
1282
+ "Cell \u001b[0;32mIn[11], line 14\u001b[0m, in \u001b[0;36mmain\u001b[0;34m()\u001b[0m\n\u001b[1;32m 12\u001b[0m ticks \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[1;32m 13\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m加载耗时:\u001b[39m\u001b[38;5;124m\"\u001b[39m,(ticks \u001b[38;5;241m-\u001b[39m startTicks),\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124ms\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 14\u001b[0m \u001b[43mstart_webui\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
1283
+ "Cell \u001b[0;32mIn[10], line 27\u001b[0m, in \u001b[0;36mstart_webui\u001b[0;34m()\u001b[0m\n\u001b[1;32m 25\u001b[0m time\u001b[38;5;241m.\u001b[39msleep(\u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m 26\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m future \u001b[38;5;129;01min\u001b[39;00m futures:\n\u001b[0;32m---> 27\u001b[0m \u001b[43mfuture\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mresult\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
1284
+ "File \u001b[0;32m/opt/conda/lib/python3.10/concurrent/futures/_base.py:453\u001b[0m, in \u001b[0;36mFuture.result\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 450\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;241m==\u001b[39m FINISHED:\n\u001b[1;32m 451\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__get_result()\n\u001b[0;32m--> 453\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_condition\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mwait\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtimeout\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 455\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;129;01min\u001b[39;00m [CANCELLED, CANCELLED_AND_NOTIFIED]:\n\u001b[1;32m 456\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m CancelledError()\n",
1285
+ "File \u001b[0;32m/opt/conda/lib/python3.10/threading.py:320\u001b[0m, in \u001b[0;36mCondition.wait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 318\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m: \u001b[38;5;66;03m# restore state no matter what (e.g., KeyboardInterrupt)\u001b[39;00m\n\u001b[1;32m 319\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m timeout \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m--> 320\u001b[0m \u001b[43mwaiter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43macquire\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 321\u001b[0m gotit \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 322\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
1286
+ "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
1287
+ ]
1288
+ }
1289
+ ],
1290
+ "source": [
1291
+ "# start\n",
1292
+ "main()"
1293
+ ]
1294
+ },
1295
+ {
1296
+ "cell_type": "code",
1297
+ "execution_count": null,
1298
+ "metadata": {
1299
+ "execution": {
1300
+ "iopub.status.busy": "2023-06-06T13:40:24.667167Z",
1301
+ "iopub.status.idle": "2023-06-06T13:40:24.667871Z",
1302
+ "shell.execute_reply": "2023-06-06T13:40:24.667621Z",
1303
+ "shell.execute_reply.started": "2023-06-06T13:40:24.667592Z"
1304
+ }
1305
+ },
1306
+ "outputs": [],
1307
+ "source": [
1308
+ "#跑图结束,手动执行,清理图片并打包到output方便下载,同时同步配置文件\n",
1309
+ "zip_clear_updata()"
1310
+ ]
1311
+ },
1312
+ {
1313
+ "cell_type": "code",
1314
+ "execution_count": 5,
1315
+ "metadata": {
1316
+ "execution": {
1317
+ "iopub.execute_input": "2023-06-16T04:55:41.756128Z",
1318
+ "iopub.status.busy": "2023-06-16T04:55:41.755667Z",
1319
+ "iopub.status.idle": "2023-06-16T04:55:46.996151Z",
1320
+ "shell.execute_reply": "2023-06-16T04:55:46.994580Z",
1321
+ "shell.execute_reply.started": "2023-06-16T04:55:41.756066Z"
1322
+ }
1323
+ },
1324
+ "outputs": [
1325
+ {
1326
+ "name": "stdout",
1327
+ "output_type": "stream",
1328
+ "text": [
1329
+ "Get:1 http://packages.cloud.google.com/apt gcsfuse-focal InRelease [5002 B]\n",
1330
+ "Get:2 https://packages.cloud.google.com/apt cloud-sdk InRelease [6361 B] \n",
1331
+ "Hit:3 http://archive.ubuntu.com/ubuntu focal InRelease \n",
1332
+ "Get:4 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] \n",
1333
+ "Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]\n",
1334
+ "Get:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] \n",
1335
+ "Get:7 https://packages.cloud.google.com/apt cloud-sdk/main amd64 Packages [464 kB]\n",
1336
+ "Get:8 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1359 kB]\n",
1337
+ "Get:9 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [2539 kB]\n",
1338
+ "Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [2352 kB]\n",
1339
+ "Get:11 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [3282 kB]\n",
1340
+ "Get:12 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [1060 kB]\n",
1341
+ "Get:13 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2781 kB]\n",
1342
+ "Fetched 14.2 MB in 2s (5993 kB/s) \n",
1343
+ "Reading package lists... Done\n"
1344
+ ]
1345
+ }
1346
+ ],
1347
+ "source": [
1348
+ "# Traceback (most recent call la\n",
1349
+ "#!apt-get update"
1350
+ ]
1351
+ }
1352
+ ],
1353
+ "metadata": {
1354
+ "kernelspec": {
1355
+ "display_name": "Python 3 (ipykernel)",
1356
+ "language": "python",
1357
+ "name": "python3"
1358
+ },
1359
+ "language_info": {
1360
+ "codemirror_mode": {
1361
+ "name": "ipython",
1362
+ "version": 3
1363
+ },
1364
+ "file_extension": ".py",
1365
+ "mimetype": "text/x-python",
1366
+ "name": "python",
1367
+ "nbconvert_exporter": "python",
1368
+ "pygments_lexer": "ipython3",
1369
+ "version": "3.10.6"
1370
+ }
1371
+ },
1372
+ "nbformat": 4,
1373
+ "nbformat_minor": 4
1374
+ }