Nekos4Lyfe commited on
Commit
3fa8d08
·
1 Parent(s): d7fe7b7

Delete Neko_sd.ipynb

Browse files
Files changed (1) hide show
  1. Neko_sd.ipynb +0 -309
Neko_sd.ipynb DELETED
@@ -1,309 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "code",
5
- "source": [
6
- "#Fetch the .zip file of the UI\n",
7
- "#Note that extensions are attached within this .zip file\n",
8
- "#A full list of extensions used can be found under sd/extensions/Extensions download URLs.txt\n",
9
- "%cd /content\n",
10
- "!curl -Lo sd.zip https://huggingface.co/Nekos4Lyfe/sd-kit/resolve/main/sd.zip\n",
11
- "!unzip sd.zip \n",
12
- "!rm embeddings.zip #remove .zip file"
13
- ],
14
- "metadata": {
15
- "id": "V1X7OSaLJuHa"
16
- },
17
- "execution_count": null,
18
- "outputs": []
19
- },
20
- {
21
- "cell_type": "code",
22
- "source": [
23
- "#Download some basic ControlNET models \n",
24
- "!curl -Lo /content/sd/extensions/controlnet/models/control_v11p_sd15_canny.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_canny_fp16.safetensors\n",
25
- "!curl -Lo /content/sd/extensions/controlnet/models/t2iadapter_canny_sd14v1.pth https://huggingface.co/nolanaatama/models/resolve/main/t2iadapter_canny_sd14v1.pth\n",
26
- "!curl -Lo /content/sd/extensions/controlnet/models/control_v11p_sd15_lineart.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15_lineart_fp16.safetensors\n",
27
- "!curl -Lo /content/sd/extensions/controlnet/models/control_v11p_sd15s2_lineart_anime.safetensors https://huggingface.co/nolanaatama/models/resolve/main/control_v11p_sd15s2_lineart_anime_fp16.safetensors\n"
28
- ],
29
- "metadata": {
30
- "id": "3ab7ebbQIP-v"
31
- },
32
- "execution_count": null,
33
- "outputs": []
34
- },
35
- {
36
- "cell_type": "code",
37
- "source": [
38
- "from google.colab import drive\n",
39
- "drive.mount('/content/drive')\n",
40
- "\n",
41
- "#Choose a model to store on Drive as backup. Here are some examples\n",
42
- "#!curl -Lo /content/drive/MyDrive/models/mistoon.safetensors https://civitai.com/api/download/models/28861\n",
43
- "#!curl -Lo /content/drive/MyDrive/models/ghostmix.safetensors https://civitai.com/api/download/models/64503\n",
44
- "#!curl -Lo /content/drive/MyDrive/models/darkside.safetensors https://civitai.com/api/download/models/63193\n",
45
- "#!curl -Lo /content/drive/MyDrive/models/lyriel.safetensors https://civitai.com/api/download/models/72396\n",
46
- "#!curl -Lo /content/drive/MyDrive/models/beenyou.safetensors https://civitai.com/api/download/models/64889\n",
47
- "#!curl -Lo /content/drive/MyDrive/models/analogmadness.safetensors https://civitai.com/api/download/models/56498\n",
48
- "\n",
49
- "#Store VAE on your drive for easy access in the future \n",
50
- "#!curl -Lo /content/drive/MyDrive/VAE/mse840000.vae.pt https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt #<--Commonly used VAE For photoreal models\n",
51
- "#!curl -Lo /content/drive/MyDrive/VAE/kl-f8-anime2.vae.pt https://civitai.com/api/download/models/28569 #<--Commonly used VAE For anime models\n",
52
- "\n",
53
- "#Add a preloaded model from your Google drive (recommended as civitai is slow/offline sometimes)\n",
54
- "#import shutil\n",
55
- "#shutil.copy(\"/content/drive/MyDrive/models/analogmadness.safetensors\", \n",
56
- "# \"/content/sd/models/Stable-diffusion/analogmadness.safetensors\")\n",
57
- "\n",
58
- "#Add VAE to model\n",
59
- "#shutil.copy(\"/content/drive/MyDrive/VAE/mse840000.vae.pt\", \n",
60
- "# \"/content/sd/models/Stable-diffusion/analogmadness.vae.pt\")"
61
- ],
62
- "metadata": {
63
- "colab": {
64
- "base_uri": "https://localhost:8080/"
65
- },
66
- "id": "pFkOt218iAKp",
67
- "outputId": "ae13e74f-1822-48e1-9f5d-b03479f8ab41"
68
- },
69
- "execution_count": 4,
70
- "outputs": [
71
- {
72
- "output_type": "stream",
73
- "name": "stdout",
74
- "text": [
75
- "Mounted at /content/drive\n"
76
- ]
77
- }
78
- ]
79
- },
80
- {
81
- "cell_type": "code",
82
- "source": [
83
- "#--------------Add a model from civitai:-------------------------------#\n",
84
- "#Baked VAE (No external VAE required)\n",
85
- "!curl -Lo /content/sd/models/Stable-diffusion/azovya-rpg.safetensors https://civitai.com/api/download/models/87886 #<---baked VAE\n",
86
- "\n",
87
- "#Photoreal models\n",
88
- "#!curl -Lo /content/sd/models/Stable-diffusion/analogmadness.safetensors https://civitai.com/api/download/models/56498\n",
89
- "\n",
90
- "#Anime models\n",
91
- "#!curl -Lo /content/sd/models/Stable-diffusion/mistoon.safetensors https://civitai.com/api/download/models/28861\n",
92
- "#!curl -Lo /content/sd/models/Stable-diffusion/beenyou.safetensors https://civitai.com/api/download/models/85614\n",
93
- "\n",
94
- "#model from Google Drive\n",
95
- "#import shutil\n",
96
- "#shutil.copy(\"/content/drive/MyDrive/models/analogmadness.safetensors\", \n",
97
- " # \"/content/sd/models/Stable-diffusion/analogmadness.safetensors\")\n",
98
- "\n",
99
- "#---------------Add VAE stored on drive to model:-----------------------#\n",
100
- "\n",
101
- "#Add VAE for anime models:\n",
102
- "#import shutil\n",
103
- "#shutil.copy(\"/content/drive/MyDrive/VAE/kl-f8-anime2.vae.pt\", \n",
104
- "# \"/content/sd/models/Stable-diffusion/mistoon.vae.pt\")\n",
105
- "\n",
106
- "#Add VAE for photoreal models:\n",
107
- "#import shutil\n",
108
- "#shutil.copy(\"/content/drive/MyDrive/VAE/mse840000.vae.pt\", \n",
109
- "# \"/content/sd/models/Stable-diffusion/analogmadness.vae.pt\")\n"
110
- ],
111
- "metadata": {
112
- "colab": {
113
- "base_uri": "https://localhost:8080/",
114
- "height": 35
115
- },
116
- "id": "TtUGrBEN7AsN",
117
- "outputId": "1b452bfd-6b7c-4fa4-c612-15bf5caff61f"
118
- },
119
- "execution_count": 5,
120
- "outputs": [
121
- {
122
- "output_type": "execute_result",
123
- "data": {
124
- "text/plain": [
125
- "'/content/sd/models/Stable-diffusion/analogmadness.vae.pt'"
126
- ],
127
- "application/vnd.google.colaboratory.intrinsic+json": {
128
- "type": "string"
129
- }
130
- },
131
- "metadata": {},
132
- "execution_count": 5
133
- }
134
- ]
135
- },
136
- {
137
- "cell_type": "code",
138
- "source": [
139
- "#Install dependencies\n",
140
- "!pip install --upgrade fastapi==0.90.1\n",
141
- "!pip install -q torch==2.0.0+cu118 torchvision==0.15.1+cu118 torchaudio==2.0.1+cu118 torchtext==0.15.1 torchdata==0.6.0 --extra-index-url https://download.pytorch.org/whl/cu118 -U\n",
142
- "!pip install -q xformers==0.0.18 triton==2.0.0 -U\n",
143
- "\n",
144
- "#run the webui once \n",
145
- "#Three blue links will appear to the UI\n",
146
- "#(This cell will run indefinetely until you press the square shaped \"Stop\" button <---)\n",
147
- "#\n",
148
- "%cd /content/sd\n",
149
- "!COMMANDLINE_ARGS=\"--share --disable-safe-unpickle --no-half-vae --xformers --enable-insecure-extension --gradio-queue --remotemoe\" REQS_FILE=\"requirements.txt\" python launch.py\n",
150
- "# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
151
- ],
152
- "metadata": {
153
- "id": "XFottHPM31pS"
154
- },
155
- "execution_count": null,
156
- "outputs": []
157
- },
158
- {
159
- "cell_type": "code",
160
- "source": [
161
- "#Add some embeddings after running the UI\n",
162
- "import shutil\n",
163
- "shutil.rmtree(\"/content/sd/embeddings/embeddings\") #Remove empty folder\n",
164
- "%cd /content\n",
165
- "!curl -Lo embeddings.zip https://huggingface.co/Nekos4Lyfe/sd-kit/resolve/main/embeddings.zip \n",
166
- "%cd /content/sd/embeddings\n",
167
- "!unzip /content/embeddings.zip #Create new embeddings folder with content\n",
168
- "%cd /content\n",
169
- "!rm embeddings.zip #remove .zip file\n",
170
- "\n",
171
- "#How to use: \n",
172
- "#write \"no_Sketch\" in the negative prompt to activate no_Sketch.pt\n",
173
- "#write angry512 in the prompt to activate angry512.pt"
174
- ],
175
- "metadata": {
176
- "id": "P3MTYF8fmVDY"
177
- },
178
- "execution_count": null,
179
- "outputs": []
180
- },
181
- {
182
- "cell_type": "code",
183
- "execution_count": null,
184
- "metadata": {
185
- "id": "b7FqKKN4tE3m"
186
- },
187
- "outputs": [],
188
- "source": [
189
- "#Add some LoRa:s after running the UI \n",
190
- "#Here the LoRa trigger words are the same as the LoRa .safetensor names\n",
191
- "!curl -Lo /content/sd/models/Lora/epinoise.safetensors https://civitai.com/api/download/models/16576\n",
192
- "!curl -Lo /content/sd/models/Lora/dieselpunkai.safetensors https://civitai.com/api/download/models/27755\n",
193
- "!curl -Lo /content/sd/models/Lora/hipoly.safetensors https://civitai.com/api/download/models/44566\n",
194
- "!curl -Lo /content/sd/models/Lora/1990s\\(style\\).safetensors https://civitai.com/api/download/models/54221\n",
195
- "!curl -Lo /content/sd/models/Lora/kids_illustration.safetensors https://civitai.com/api/download/models/67980\n",
196
- "!curl -Lo /content/sd/models/Lora/\\(illumination\\).safetensors https://civitai.com/api/download/models/42981\n",
197
- "\n",
198
- "\n",
199
- "#How to use: \n",
200
- "#write <lora:epinoise:1> epinoise in the prompt to activate the Lora epinoise.safetensors"
201
- ]
202
- },
203
- {
204
- "cell_type": "code",
205
- "source": [
206
- "#Add some Wildcards after running the UI \n",
207
- "#These are not my own but fetched from here: https://www.sdcompendium.com/doku.php?id=start\n",
208
- "#(using the dynamic prompts extension baked into sd.zip)\n",
209
- "%cd /content\n",
210
- "!curl -Lo wildcards.zip https://huggingface.co/Nekos4Lyfe/sd-kit/resolve/main/wildcards.zip \n",
211
- "\n",
212
- "import shutil\n",
213
- "shutil.rmtree(\"/content/sd/extensions/sd-dynamic-prompts/wildcards\") #Remove empty folder\n",
214
- "%cd /content/sd/extensions/sd-dynamic-prompts/wildcards\n",
215
- "!unzip /content/wildcards.zip \n",
216
- "%cd /content\n",
217
- "!rm wildcards.zip #remove .zip file\n"
218
- ],
219
- "metadata": {
220
- "id": "3hPt2WCNEy9f"
221
- },
222
- "execution_count": null,
223
- "outputs": []
224
- },
225
- {
226
- "cell_type": "code",
227
- "source": [
228
- "!curl -Lo /content/sd/models/Lora/kusanagi_motoko.safetensors https://civitai.com/api/download/models/7692\n",
229
- "!curl -Lo /content/sd/models/Lora/WH40K_ork.safetensors https://civitai.com/api/download/models/63475\n",
230
- "!curl -Lo /content/sd/models/Lora/cameltoe.safetensors https://civitai.com/api/download/models/63536\n",
231
- "!curl -Lo /content/sd/models/Lora/MSHN.safetensors https://civitai.com/api/download/models/62552\n",
232
- "!curl -Lo /content/sd/models/Lora/blame.safetensors https://civitai.com/api/download/models/55412\n",
233
- "!curl -Lo /content/sd/models/Lora/WH40K_Imperial_Guardsman.safetensors https://civitai.com/api/download/models/56778\n",
234
- "!curl -Lo /content/sd/models/Lora/WH40K_Commissar.safetensors https://civitai.com/api/download/models/56414\n",
235
- "!curl -Lo /content/sd/models/Lora/Squeezer1.safetensors https://civitai.com/api/download/models/54302\n",
236
- "!curl -Lo /content/sd/models/Lora/Squeezer2.safetensors https://civitai.com/api/download/models/44493\n",
237
- "!curl -Lo /content/sd/models/Lora/scared_expression.safetensors https://civitai.com/api/download/models/49924\n",
238
- "!curl -Lo /content/sd/models/Lora/graphic_novel.safetensors https://civitai.com/api/download/models/39455\n",
239
- "!curl -Lo /content/sd/models/Lora/knn.safetensors https://civitai.com/api/download/models/33463\n",
240
- "!curl -Lo /content/sd/models/Lora/>_<-@_@-=_=-X-X-._.-JITOME-:I.safetensors https://civitai.com/api/download/models/30666\n",
241
- "!curl -Lo /content/sd/models/Lora/emotion.safetensors https://civitai.com/models/11998/emotion-puppeteer-lora\n",
242
- "!curl -Lo /content/sd/models/Lora/adepta_sororitas.safetensors https://civitai.com/api/download/models/12730\n",
243
- "!curl -Lo /content/sd/models/Lora/gmod.safetensors https://civitai.com/api/download/models/5988\n",
244
- "!curl -Lo /content/sd/models/Lora/onoff.safetensors https://civitai.com/api/download/models/55073\n",
245
- "!curl -Lo /content/sd/models/Lora/innie.safetensors https://civitai.com/api/download/models/19492\n",
246
- "!curl -Lo /content/sd/models/Lora/mrrpss.safetensors https://civitai.com/api/download/models/52660\n",
247
- "!curl -Lo /content/sd/models/Lora/frombelow.safetensors https://civitai.com/api/download/models/63354\n",
248
- "!curl -Lo /content/sd/models/Lora/eaba.safetensors https://civitai.com/api/download/models/68626\n"
249
- ],
250
- "metadata": {
251
- "id": "EwOplCcSSDB0"
252
- },
253
- "execution_count": null,
254
- "outputs": []
255
- },
256
- {
257
- "cell_type": "code",
258
- "source": [
259
- "#Run the UI again with the LoRa and embeddings\n",
260
- "#To access the LoRa and embeddings, click one of the buttons beneath the big \"Generate!\" button. \n",
261
- "#It's the button beneath \"Generate!\" right in the middle with some orange on it. \n",
262
- "#Scroll up to find the UI links\n",
263
- "%cd /content/sd\n",
264
- "!COMMANDLINE_ARGS=\"--share --disable-safe-unpickle --no-half-vae --xformers --enable-insecure-extension --gradio-queue --remotemoe --disable-console-progressbars\" REQS_FILE=\"requirements.txt\" python launch.py\n",
265
- "# If remotemoe failed to start, change '--remotemoe' to '--cloudflared' on the COMMANDLINE_ARGS line above to use cloudflare tunnel"
266
- ],
267
- "metadata": {
268
- "id": "2jdGVvT19hk2"
269
- },
270
- "execution_count": null,
271
- "outputs": []
272
- },
273
- {
274
- "cell_type": "code",
275
- "source": [
276
- "#Use remote storage rather then Drive storage \n",
277
- "#(note that you will lose all generated images at end of session)\n",
278
- "%cd /content\n",
279
- "!curl -Lo memfix.zip https://huggingface.co/Nekos4Lyfe/sd-kit/resolve/main/memfix.zip \n",
280
- "!unzip memfix.zip\n",
281
- "!apt install -qq libunwind8-dev\n",
282
- "!dpkg -i *.deb\n",
283
- "%env LD_PRELOAD=libtcmalloc.so\n",
284
- "!rm *"
285
- ],
286
- "metadata": {
287
- "id": "_2T1Tc0uq8bc"
288
- },
289
- "execution_count": null,
290
- "outputs": []
291
- }
292
- ],
293
- "metadata": {
294
- "colab": {
295
- "provenance": [],
296
- "gpuType": "T4"
297
- },
298
- "kernelspec": {
299
- "display_name": "Python 3",
300
- "name": "python3"
301
- },
302
- "language_info": {
303
- "name": "python"
304
- },
305
- "accelerator": "GPU"
306
- },
307
- "nbformat": 4,
308
- "nbformat_minor": 0
309
- }