ACCA225 commited on
Commit
0618a27
1 Parent(s): 22933c9

Upload Openi-V4-New.ipynb

Browse files
Files changed (1) hide show
  1. Openi-V4-New.ipynb +408 -0
Openi-V4-New.ipynb ADDED
@@ -0,0 +1,408 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "6247c454-ae5d-4fa2-80e5-1918ccd4d094",
6
+ "metadata": {},
7
+ "source": [
8
+ "# 启智云云端部署Stable Diffusion WebUI\n",
9
+ "## 永久免费白嫖A100 24G/40G/80G显卡!\n",
10
+ "### 唯一项目地址:https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.6.1\n",
11
+ "### 唯一项目地址:https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.6.1\n",
12
+ "### 唯一项目地址:https://openi.pcl.ac.cn/2575044704/stable-diffusion-webui-v1.6.1\n",
13
+ "### 其它项目都是盗版!坚决不要相信此云端的显卡要给租金才能用!"
14
+ ]
15
+ },
16
+ {
17
+ "cell_type": "markdown",
18
+ "id": "091be464",
19
+ "metadata": {},
20
+ "source": [
21
+ "## By Nyan9 BiliBili。QQ2575044704\n",
22
+ "此为20元付费脚本,未经同意禁止公开此脚本。\n",
23
+ "如果要公开,请删除所有全部关键代码"
24
+ ]
25
+ },
26
+ {
27
+ "cell_type": "markdown",
28
+ "id": "48852a6e",
29
+ "metadata": {},
30
+ "source": [
31
+ "# 首次使用先复制镜像(左侧目录有sd就不用按这个):"
32
+ ]
33
+ },
34
+ {
35
+ "cell_type": "code",
36
+ "execution_count": 2,
37
+ "id": "0da5ecae",
38
+ "metadata": {
39
+ "tags": []
40
+ },
41
+ "outputs": [
42
+ {
43
+ "name": "stdout",
44
+ "output_type": "stream",
45
+ "text": [
46
+ "你的GPU运行状态:\n",
47
+ "Tue Mar 26 21:33:25 2024 \n",
48
+ "+---------------------------------------------------------------------------------------+\n",
49
+ "| NVIDIA-SMI 535.54.03 Driver Version: 535.54.03 CUDA Version: 12.2 |\n",
50
+ "|-----------------------------------------+----------------------+----------------------+\n",
51
+ "| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |\n",
52
+ "| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |\n",
53
+ "| | | MIG M. |\n",
54
+ "|=========================================+======================+======================|\n",
55
+ "| 0 NVIDIA A100-SXM4-80GB On | 00000000:89:00.0 Off | 0 |\n",
56
+ "| N/A 32C P0 64W / 400W | 4MiB / 81920MiB | 0% Default |\n",
57
+ "| | | Disabled |\n",
58
+ "+-----------------------------------------+----------------------+----------------------+\n",
59
+ " \n",
60
+ "+---------------------------------------------------------------------------------------+\n",
61
+ "| Processes: |\n",
62
+ "| GPU GI CI PID Type Process name GPU Memory |\n",
63
+ "| ID ID Usage |\n",
64
+ "|=======================================================================================|\n",
65
+ "| No running processes found |\n",
66
+ "+---------------------------------------------------------------------------------------+\n"
67
+ ]
68
+ }
69
+ ],
70
+ "source": [
71
+ "。"
72
+ ]
73
+ },
74
+ {
75
+ "cell_type": "markdown",
76
+ "id": "932a01c4",
77
+ "metadata": {},
78
+ "source": [
79
+ "# SD启动:\n",
80
+ "## 出现http//:127.0.0.1:7860后从内网穿透连接进入SD-WebUI!不是本地地址"
81
+ ]
82
+ },
83
+ {
84
+ "cell_type": "code",
85
+ "execution_count": 4,
86
+ "id": "929ee5ea-15e7-48cd-8c8a-09316b75ad18",
87
+ "metadata": {
88
+ "tags": []
89
+ },
90
+ "outputs": [
91
+ {
92
+ "name": "stdout",
93
+ "output_type": "stream",
94
+ "text": [
95
+ "everyone.safetensors openi_resource.version\t模型1.3.safetensors\n",
96
+ "niji.safetensors xuanliduocai.safetensors\t漫画模型.safetensors\n"
97
+ ]
98
+ }
99
+ ],
100
+ "source": [
101
+ "#先复制模型\n",
102
+ "。。。。。"
103
+ ]
104
+ },
105
+ {
106
+ "cell_type": "code",
107
+ "execution_count": null,
108
+ "id": "a52ebf7d",
109
+ "metadata": {
110
+ "tags": []
111
+ },
112
+ "outputs": [
113
+ {
114
+ "name": "stdout",
115
+ "output_type": "stream",
116
+ "text": [
117
+ "[Errno 2] No such file or directory: '/tmp/code/sd'\n",
118
+ "/sd\n",
119
+ "Python 3.10.9 (main, May 15 2023, 07:38:08) [GCC 11.3.0]\n",
120
+ "Version: v1.7.0-1-g167206da\n",
121
+ "Commit hash: 167206dafd7ea357ec3824e853f6dab024b6a338\n",
122
+ "Installing requirements\n",
123
+ "ControlNet init warning: Unable to install insightface automatically. Please try run `pip install insightface` manually.\n",
124
+ "Launching Web UI with arguments: --ckpt-dir=/tmp/pretrainmodel --ngrok=2douOsr61tUyYwMVF3lfj9uZGoa_6FPJ2x1xhKPbL6z4euKkM --ngrok-region=ap --ad-no-huggingface --no-download-sd-model --opt-channelslast --xformers --api --no-hashing --skip-torch-cuda-test --api-auth=123:123\n",
125
+ "ngrok authtoken detected, trying to connect...\n",
126
+ "ngrok connected to localhost:7860! URL: https://81fc-218-17-115-213.ngrok-free.app\n",
127
+ "\n",
128
+ "Tag Autocomplete: Could not locate model-keyword extension, Lora trigger word completion will be limited to those added through the extra networks menu.\n",
129
+ "\u001b[1m[\u001b[0m-\u001b[1m]\u001b[0m ADetailer initialized. version: \u001b[1;36m24.1\u001b[0m.\u001b[1;36m2\u001b[0m, num models: \u001b[1;36m4\u001b[0m\n",
130
+ "ControlNet preprocessor location: /sd/extensions/sd-webui-controlnet/annotator/downloads\n",
131
+ "2024-03-24 23:37:37,861 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet v1.1.441\n",
132
+ "2024-03-24 23:37:38,007 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet v1.1.441\n",
133
+ "sd-webui-prompt-all-in-one background API service started successfully.\n",
134
+ "Checkpoint 131-half.safetensors [870fa2e24c] not found; loading fallback stable_diffusion_model_01/everyone.safetensors\n",
135
+ "Loading weights [None] from /tmp/pretrainmodel/stable_diffusion_model_01/everyone.safetensors\n",
136
+ "2024-03-24 23:37:39,868 - ControlNet - \u001b[0;32mINFO\u001b[0m - ControlNet UI callback registered.\n",
137
+ "Creating model from config: /sd/configs/v1-inference.yaml\n",
138
+ "Running on local URL: http://127.0.0.1:7860\n",
139
+ "\n",
140
+ "To create a public link, set `share=True` in `launch()`.\n",
141
+ "Startup time: 28.6s (prepare environment: 12.7s, import torch: 2.9s, import gradio: 1.3s, setup paths: 1.4s, initialize shared: 0.3s, other imports: 2.0s, setup codeformer: 0.1s, load scripts: 2.7s, create ui: 2.0s, gradio launch: 2.8s, add APIs: 0.2s).\n",
142
+ "Couldn't find VAE named pastel-waifu-diffusion.vae.pt; using None instead\n",
143
+ "Applying attention optimization: xformers... done.\n",
144
+ "Model loaded in 34.5s (load weights from disk: 1.6s, create model: 1.3s, apply weights to model: 31.1s, calculate empty prompt: 0.2s).\n"
145
+ ]
146
+ }
147
+ ],
148
+ "source": [
149
+ "# 点击这个启动SD\n",
150
+ "。。。。。。。。。。。。。。。。。。。。。。。"
151
+ ]
152
+ },
153
+ {
154
+ "cell_type": "markdown",
155
+ "id": "0e0dc739",
156
+ "metadata": {},
157
+ "source": [
158
+ "-------"
159
+ ]
160
+ },
161
+ {
162
+ "cell_type": "markdown",
163
+ "id": "54a6b833",
164
+ "metadata": {},
165
+ "source": [
166
+ "# 下载模型,直接把模型下载地址粘贴进去\n",
167
+ "# 支持的模型下载站:liblib.ai, tusiart.com, Huggingface镜像站\n",
168
+ "# 不支持的:Civitai,\n",
169
+ "## HUggingface镜像站:huggingface.sukaka.top\n",
170
+ "## 必须先把SD停下来再执行代码!"
171
+ ]
172
+ },
173
+ {
174
+ "cell_type": "code",
175
+ "execution_count": 8,
176
+ "id": "e1d736de",
177
+ "metadata": {},
178
+ "outputs": [
179
+ {
180
+ "name": "stdout",
181
+ "output_type": "stream",
182
+ "text": [
183
+ "/tmp/code/sd/models/Lora\n",
184
+ "\u001b[35m[\u001b[0m#36562e 153MiB/162MiB\u001b[36m(94%)\u001b[0m CN:9 DL:\u001b[32m62MiB\u001b[0m\u001b[35m]\u001b[0m\u001b[0mm\n",
185
+ "Download Results:\n",
186
+ "gid |stat|avg speed |path/URI\n",
187
+ "======+====+===========+=======================================================\n",
188
+ "36562e|\u001b[1;32mOK\u001b[0m | 47MiB/s|/tmp/code/sd/models/Lora/Baiyu.safetensors\n",
189
+ "\n",
190
+ "Status Legend:\n",
191
+ "(OK):download completed.\n",
192
+ "/tmp/code\n"
193
+ ]
194
+ }
195
+ ],
196
+ "source": [
197
+ "代码呢?"
198
+ ]
199
+ },
200
+ {
201
+ "cell_type": "code",
202
+ "execution_count": 9,
203
+ "id": "741c1a0c",
204
+ "metadata": {},
205
+ "outputs": [],
206
+ "source": [
207
+ "。。"
208
+ ]
209
+ },
210
+ {
211
+ "cell_type": "code",
212
+ "execution_count": 3,
213
+ "id": "4097b906",
214
+ "metadata": {
215
+ "tags": []
216
+ },
217
+ "outputs": [
218
+ {
219
+ "ename": "SyntaxError",
220
+ "evalue": "EOL while scanning string literal (680814184.py, line 13)",
221
+ "output_type": "error",
222
+ "traceback": [
223
+ "\u001b[0;36m Cell \u001b[0;32mIn[3], line 13\u001b[0;36m\u001b[0m\n\u001b[0;31m \"https://gidsgdsmncvknsnkdvsnkdvsknd\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m EOL while scanning string literal\n"
224
+ ]
225
+ }
226
+ ],
227
+ "source": [
228
+ "## 安装常用插件,github如果连不上就多执行几次\n",
229
+ "extensions = [\n",
230
+ "\"https://github.com/Mikubill/sd-webui-controlnet\",\n",
231
+ "代码被砂糖酱吃掉了!\n",
232
+ " asfknaskfnf\n",
233
+ " asfasv\n",
234
+ "\n",
235
+ "\n",
236
+ "sfhkahsffhaksfa\n",
237
+ "sf\n",
238
+ "asf\n",
239
+ "\n",
240
+ "sf\n",
241
+ "as\n",
242
+ "f\n",
243
+ "asffas\n",
244
+ "saf\n",
245
+ "\n",
246
+ "\n",
247
+ "\n",
248
+ "\n",
249
+ "\n",
250
+ "\n",
251
+ "\n",
252
+ "\n",
253
+ "\n",
254
+ "\n",
255
+ "\n",
256
+ "\n",
257
+ "草草草草草草草草草草草草草草草草草草草"
258
+ ]
259
+ },
260
+ {
261
+ "cell_type": "markdown",
262
+ "id": "a28903ba",
263
+ "metadata": {},
264
+ "source": [
265
+ "------------------"
266
+ ]
267
+ },
268
+ {
269
+ "cell_type": "markdown",
270
+ "id": "902e6634",
271
+ "metadata": {},
272
+ "source": [
273
+ "# 下面代码是启���秋叶的Lora训练器:"
274
+ ]
275
+ },
276
+ {
277
+ "cell_type": "markdown",
278
+ "id": "13585ce5",
279
+ "metadata": {},
280
+ "source": [
281
+ "# 1.拉取lora训练文件(首次启动)(左侧有lora文件夹就不用拉取)"
282
+ ]
283
+ },
284
+ {
285
+ "cell_type": "code",
286
+ "execution_count": 11,
287
+ "id": "dcf2eeb6",
288
+ "metadata": {
289
+ "tags": []
290
+ },
291
+ "outputs": [
292
+ {
293
+ "name": "stdout",
294
+ "output_type": "stream",
295
+ "text": [
296
+ "Object `(空)` not found.\n"
297
+ ]
298
+ },
299
+ {
300
+ "ename": "NameError",
301
+ "evalue": "name 'aa' is not defined",
302
+ "output_type": "error",
303
+ "traceback": [
304
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
305
+ "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
306
+ "Cell \u001b[0;32mIn[11], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m get_ipython()\u001b[38;5;241m.\u001b[39mrun_line_magic(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mpinfo\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m(空)\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 2\u001b[0m get_ipython()\u001b[38;5;241m.\u001b[39mshow_usage()\n\u001b[0;32m----> 3\u001b[0m \u001b[43maa\u001b[49m\n",
307
+ "\u001b[0;31mNameError\u001b[0m: name 'aa' is not defined"
308
+ ]
309
+ }
310
+ ],
311
+ "source": [
312
+ "\n",
313
+ "?(空)\n",
314
+ "??\n",
315
+ "aa"
316
+ ]
317
+ },
318
+ {
319
+ "cell_type": "markdown",
320
+ "id": "0ec71212",
321
+ "metadata": {},
322
+ "source": [
323
+ "# 2. 启动Lora训练器"
324
+ ]
325
+ },
326
+ {
327
+ "cell_type": "code",
328
+ "execution_count": 5,
329
+ "id": "a2b0612a",
330
+ "metadata": {
331
+ "tags": []
332
+ },
333
+ "outputs": [
334
+ {
335
+ "ename": "SyntaxError",
336
+ "evalue": "invalid character in identifier (2822435047.py, line 4)",
337
+ "output_type": "error",
338
+ "traceback": [
339
+ "\u001b[0;36m Cell \u001b[0;32mIn[5], line 4\u001b[0;36m\u001b[0m\n\u001b[0;31m 忘记了原来代码怎么写的??\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid character in identifier\n"
340
+ ]
341
+ }
342
+ ],
343
+ "source": [
344
+ "代码被砂糖酱吃掉了!\n"
345
+ ]
346
+ },
347
+ {
348
+ "cell_type": "code",
349
+ "execution_count": 13,
350
+ "id": "db459d42-54b2-4f32-9a5a-fb9b6b681ba9",
351
+ "metadata": {},
352
+ "outputs": [
353
+ {
354
+ "ename": "SyntaxError",
355
+ "evalue": "invalid syntax (3528668389.py, line 2)",
356
+ "output_type": "error",
357
+ "traceback": [
358
+ "\u001b[0;36m Cell \u001b[0;32mIn[13], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m 先从打印hello world开始\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
359
+ ]
360
+ }
361
+ ],
362
+ "source": [
363
+ "自学python区\n",
364
+ "先从打印hello world开始"
365
+ ]
366
+ },
367
+ {
368
+ "cell_type": "code",
369
+ "execution_count": 12,
370
+ "id": "5968dbc3-1a87-425e-8de6-e7c2517d66d2",
371
+ "metadata": {},
372
+ "outputs": [
373
+ {
374
+ "ename": "SyntaxError",
375
+ "evalue": "invalid character in identifier (816423590.py, line 1)",
376
+ "output_type": "error",
377
+ "traceback": [
378
+ "\u001b[0;36m Cell \u001b[0;32mIn[12], line 1\u001b[0;36m\u001b[0m\n\u001b[0;31m print(hello world)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid character in identifier\n"
379
+ ]
380
+ }
381
+ ],
382
+ "source": [
383
+ "print(hello world)"
384
+ ]
385
+ }
386
+ ],
387
+ "metadata": {
388
+ "kernelspec": {
389
+ "display_name": "Python 3 (ipykernel)",
390
+ "language": "python",
391
+ "name": "python3"
392
+ },
393
+ "language_info": {
394
+ "codemirror_mode": {
395
+ "name": "ipython",
396
+ "version": 3
397
+ },
398
+ "file_extension": ".py",
399
+ "mimetype": "text/x-python",
400
+ "name": "python",
401
+ "nbconvert_exporter": "python",
402
+ "pygments_lexer": "ipython3",
403
+ "version": "3.8.10"
404
+ }
405
+ },
406
+ "nbformat": 4,
407
+ "nbformat_minor": 5
408
+ }