RudiCahyan commited on
Commit
22871b3
1 Parent(s): a6ccf21

Upload 2 files

Browse files
Files changed (2) hide show
  1. Simple.ipynb +274 -0
  2. requirements.txt +6 -1
Simple.ipynb ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 0,
6
+ "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "name": "stdout",
10
+ "output_type": "stream",
11
+ "text": [
12
+ "--skip-torch-cuda-test\n",
13
+ "\u001b[1;32mInstalling xformers...\n",
14
+ "\u001b[0m\n",
15
+ "[WinError 2] The system cannot find the file specified: '/content'\n",
16
+ "c:\\Users\\user\\Downloads\\novelai\n",
17
+ "Grabbing pre-built xformers from camenduru's repo\n",
18
+ "Status code: 200\n"
19
+ ]
20
+ },
21
+ {
22
+ "name": "stderr",
23
+ "output_type": "stream",
24
+ "text": [
25
+ "ERROR: xformers-0.0.16+814314d.d20230118-cp38-cp38-linux_x86_64.whl is not a supported wheel on this platform.\n",
26
+ "\n",
27
+ "[notice] A new release of pip available: 22.3.1 -> 23.0.1\n",
28
+ "[notice] To update, run: C:\\Users\\user\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\python.exe -m pip install --upgrade pip\n",
29
+ "ERROR: Could not find a version that satisfies the requirement triton (from versions: none)\n",
30
+ "ERROR: No matching distribution found for triton\n",
31
+ "\n",
32
+ "[notice] A new release of pip available: 22.3.1 -> 23.0.1\n",
33
+ "[notice] To update, run: C:\\Users\\user\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\python.exe -m pip install --upgrade pip\n"
34
+ ]
35
+ },
36
+ {
37
+ "name": "stdout",
38
+ "output_type": "stream",
39
+ "text": [
40
+ "\u001b[1;32mInstalling webui...\n",
41
+ "\u001b[0m\n"
42
+ ]
43
+ },
44
+ {
45
+ "name": "stderr",
46
+ "output_type": "stream",
47
+ "text": [
48
+ "'touch' is not recognized as an internal or external command,\n",
49
+ "operable program or batch file.\n"
50
+ ]
51
+ },
52
+ {
53
+ "name": "stdout",
54
+ "output_type": "stream",
55
+ "text": [
56
+ "[WinError 2] The system cannot find the file specified: 'stable-diffusion-webui'\n",
57
+ "c:\\Users\\user\\Downloads\\novelai\n",
58
+ "\u001b[1;32mDownloading AnythingV3 model...\n",
59
+ "\u001b[0m\n",
60
+ "[WinError 3] The system cannot find the path specified: '/content/stable-diffusion-webui/models/Stable-diffusion/'\n",
61
+ "c:\\Users\\user\\Downloads\\novelai\n"
62
+ ]
63
+ },
64
+ {
65
+ "name": "stderr",
66
+ "output_type": "stream",
67
+ "text": [
68
+ "[ was unexpected at this time.\n",
69
+ "[ was unexpected at this time.\n"
70
+ ]
71
+ },
72
+ {
73
+ "name": "stdout",
74
+ "output_type": "stream",
75
+ "text": [
76
+ "\u001b[1;32mSetting UI configs...\n",
77
+ "\u001b[0m\n",
78
+ "[WinError 3] The system cannot find the path specified: '/content/stable-diffusion-webui'\n",
79
+ "c:\\Users\\user\\Downloads\\novelai\n"
80
+ ]
81
+ },
82
+ {
83
+ "name": "stderr",
84
+ "output_type": "stream",
85
+ "text": [
86
+ "[ was unexpected at this time.\n",
87
+ "-f was unexpected at this time.\n",
88
+ "[ was unexpected at this time.\n",
89
+ "[ was unexpected at this time.\n",
90
+ "'touch' is not recognized as an internal or external command,\n",
91
+ "operable program or batch file.\n",
92
+ "'gdown' is not recognized as an internal or external command,\n",
93
+ "operable program or batch file.\n",
94
+ "'[' is not recognized as an internal or external command,\n",
95
+ "operable program or batch file.\n"
96
+ ]
97
+ },
98
+ {
99
+ "name": "stdout",
100
+ "output_type": "stream",
101
+ "text": [
102
+ "\u001b[1;32mInstalling extensions...\n",
103
+ "\u001b[0m\n",
104
+ "[WinError 3] The system cannot find the path specified: '/content/stable-diffusion-webui/extensions'\n",
105
+ "c:\\Users\\user\\Downloads\\novelai\n"
106
+ ]
107
+ },
108
+ {
109
+ "name": "stderr",
110
+ "output_type": "stream",
111
+ "text": [
112
+ "/bin/bash: -c: line 0: unexpected EOF while looking for matching `''\n",
113
+ "/bin/bash: -c: line 1: syntax error: unexpected end of file\n",
114
+ "/bin/bash: -c: line 0: unexpected EOF while looking for matching `''\n",
115
+ "/bin/bash: -c: line 1: syntax error: unexpected end of file\n"
116
+ ]
117
+ },
118
+ {
119
+ "name": "stdout",
120
+ "output_type": "stream",
121
+ "text": [
122
+ "[WinError 3] The system cannot find the path specified: '/content/stable-diffusion-webui/embeddings/'\n",
123
+ "c:\\Users\\user\\Downloads\\novelai\n"
124
+ ]
125
+ },
126
+ {
127
+ "name": "stderr",
128
+ "output_type": "stream",
129
+ "text": [
130
+ "fatal: destination path 'Umi-AI' already exists and is not an empty directory.\n",
131
+ "[ was unexpected at this time.\n",
132
+ "[ was unexpected at this time.\n",
133
+ "[ was unexpected at this time.\n",
134
+ "'sed' is not recognized as an internal or external command,\n",
135
+ "operable program or batch file.\n"
136
+ ]
137
+ },
138
+ {
139
+ "name": "stdout",
140
+ "output_type": "stream",
141
+ "text": [
142
+ "\u001b[1;32mInstallation Success!\n",
143
+ "\u001b[1;32mLaunching the webui...\n",
144
+ "\u001b[0m\n",
145
+ "[WinError 3] The system cannot find the path specified: '/content/stable-diffusion-webui'\n",
146
+ "c:\\Users\\user\\Downloads\\novelai\n"
147
+ ]
148
+ },
149
+ {
150
+ "name": "stderr",
151
+ "output_type": "stream",
152
+ "text": [
153
+ "python: can't open file 'c:\\\\Users\\\\user\\\\Downloads\\\\novelai\\\\launch.py': [Errno 2] No such file or directory\n"
154
+ ]
155
+ }
156
+ ],
157
+ "source": [
158
+ "#@title - Instant (Simple)\n",
159
+ "import requests\n",
160
+ "import os\n",
161
+ "import subprocess\n",
162
+ "# cek = subprocess.getoutput('nvidia-smi')\n",
163
+ "# if not 'T4' in cek:\n",
164
+ "# print(\"\u001b[1;32m-----Your colab session is over. Use other google account or wait 12-24 hours-----\")\n",
165
+ "# print(\"-----Sesi colab elu udah habis bro. Saran gw tunggu 12-24 jam atau bikin/pake akun google lain-----\")\n",
166
+ "# raise KeyboardInterrupt\n",
167
+ "\n",
168
+ "\n",
169
+ "#thanks to https://github.com/camenduru for the fork\n",
170
+ "\n",
171
+ "# print(subprocess.check_output('nvidia-smi'))\n",
172
+ "commandline_args = os.environ.get('COMMANDLINE_ARGS', \"--skip-torch-cuda-test\")\n",
173
+ "print(commandline_args)\n",
174
+ "print('\u001b[1;32mInstalling xformers...')\n",
175
+ "print('\u001b[0m')\n",
176
+ "%cd \n",
177
+ "#!if ! [ -f xformers ]; then pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16+814314d.d20230118-cp38-cp38-linux_x86_64.whl; pip install -q --pre triton; touch xformers; fi\n",
178
+ "if not os.path.isfile('xformers'):\n",
179
+ " print(\"Grabbing pre-built xformers from camenduru's repo\")\n",
180
+ " url = 'https://api.github.com/repos/camenduru/stable-diffusion-webui-colab/releases/latest'\n",
181
+ " response = requests.get(url)\n",
182
+ " print(\"Status code: \" + str(response.status_code))\n",
183
+ " if response.status_code == 200:\n",
184
+ " data = response.json()\n",
185
+ " templink = [link for link in [asset['browser_download_url'] for asset in data['assets'] if 'cp38' in asset['name']]]\n",
186
+ " xformerlink = templink[0]\n",
187
+ " else:\n",
188
+ " print(\"Request failed, loading last updated xformers instead\")\n",
189
+ " xformerlink = 'https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.16/xformers-0.0.16%2B814314d.d20230118-cp38-cp38-linux_x86_64.whl'\n",
190
+ " !pip install -q $xformerlink\n",
191
+ " !pip install -q --pre triton\n",
192
+ " !touch xformers\n",
193
+ "print('\u001b[1;32mInstalling webui...')\n",
194
+ "print('\u001b[0m')\n",
195
+ "!if ! [ -d stable-diffusion-webui ]; then git clone -b v2.0 https://github.com/camenduru/stable-diffusion-webui; touch forkedwebui; fi\n",
196
+ "%cd stable-diffusion-webui\n",
197
+ "\n",
198
+ "#AnythingV3 Model & Vae\n",
199
+ "print('\u001b[1;32mDownloading AnythingV3 model...')\n",
200
+ "print('\u001b[0m')\n",
201
+ "%cd /stable-diffusion-webui/models/Stable-diffusion/\n",
202
+ "!if ! [ -f Anything-V3.0.safetensors ]; then gdown https://huggingface.co/Linaqruf/anything-v3.0/resolve/main/anything-v3-fp32-pruned.safetensors -O /stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0.safetensors; fi\n",
203
+ "!if ! [ -f Anything-V3.0.vae.pt ]; then gdown https://huggingface.co/WarriorMama777/OrangeMixs/resolve/main/VAEs/orangemix.vae.pt -O /stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0.vae.pt; fi\n",
204
+ "\n",
205
+ "#webui setup for nai\n",
206
+ "print('\u001b[1;32mSetting UI configs...')\n",
207
+ "print('\u001b[0m')\n",
208
+ "%cd /stable-diffusion-webui\n",
209
+ "!if [ -f configinstan ]; then rm configinstan; fi\n",
210
+ "!if ! [ -f configinstanlite ]; then gdown https://pastebin.com/raw/fmN0i5Sd -O /stable-diffusion-webui/ui-config.json && gdown https://pastebin.com/raw/amVtB1NW -O /stable-diffusion-webui/config.json; fi\n",
211
+ "!if ! [ -f configinstanlite ]; then mv /stable-diffusion-webui/modules/ui.py /stable-diffusion-webui/modules/ui_backup.py && gdown https://pastebin.com/raw/pKFWUfLM -O /stable-diffusion-webui/modules/ui.py; fi\n",
212
+ "!touch configinstanlite\n",
213
+ "\n",
214
+ "#notification bell\n",
215
+ "!gdown https://github.com/etherealxx/etherportal-webui-colab/raw/master/notification.mp3 -O /stable-diffusion-webui/notification.mp3\n",
216
+ "\n",
217
+ "#foolhardy remacri\n",
218
+ "! [ ! -d models/ESRGAN ] && mkdir -p models/ESRGAN; [ ! -f models/ESRGAN/4x_foolhardy_Remacri.pth ] && gdown https://huggingface.co/etherealxx/whoseisthis/resolve/main/4x_foolhardy_Remacri.pth -O /stable-diffusion-webui/models/ESRGAN/4x_foolhardy_Remacri.pth\n",
219
+ "\n",
220
+ "#extensions\n",
221
+ "print('\u001b[1;32mInstalling extensions...')\n",
222
+ "print('\u001b[0m')\n",
223
+ "%cd /stable-diffusion-webui/extensions\n",
224
+ "!bash -c 'for repo in AlUlkesh/stable-diffusion-webui-images-browser Extraltodeus/depthmap2mask DominikDoom/a1111-sd-webui-tagcomplete ddPn08/kohya-sd-scripts-webui arenatemp/stable-diffusion-webui-model-toolkit; do if [ ! -d \"$repo\" ]; then git clone \"https://github.com/$repo\" && true; fi; done'\n",
225
+ "!bash -c 'for repo in sd-civitai-browser kohya-sd-scripts-webui stable-diffusion-webui-model-toolkit batchlinks-webui; do if [ -d \"$repo\" ]; then rm -rf $repo && true; fi; done'\n",
226
+ "#%cd /stable-diffusion-webui/extensions/UnivAICharGen\n",
227
+ "#!git checkout c56b5146049b91cfcd645c62bd356bd0631c4131 .\n",
228
+ "!git clone -b pre-embedding --single-branch https://github.com/etherealxx/Umi-AI\n",
229
+ "\n",
230
+ "#badprompt & badartist\n",
231
+ "%cd /stable-diffusion-webui/embeddings/\n",
232
+ "!if ! [ -f bad_prompt.pt ]; then gdown https://huggingface.co/datasets/Nerfgun3/bad_prompt/resolve/main/bad_prompt_version2.pt -O /stable-diffusion-webui/embeddings/bad_prompt.pt; fi\n",
233
+ "!if ! [ -f bad_artist.pt ]; then gdown https://huggingface.co/NiXXerHATTER59/bad-artist/resolve/main/bad-artist.pt -O /stable-diffusion-webui/embeddings/bad_artist.pt; fi\n",
234
+ "!if ! [ -f bad_hands.pt ]; then gdown https://huggingface.co/etherealxx/whoseisthis/resolve/main/bad-hands-5.pt -O /stable-diffusion-webui/embeddings/bad_hands.pt; fi\n",
235
+ "\n",
236
+ "#some fix\n",
237
+ "!sed -i -e '''/prepare_environment()/a\\ os.system\\(f\\\"\"\"sed -i -e ''\\\"s/dict()))/dict())).cuda()/g\\\"'' /stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py\"\"\")''' /stable-diffusion-webui/launch.py\n",
238
+ "\n",
239
+ "print('\u001b[1;32mInstallation Success!')\n",
240
+ "print('\u001b[1;32mLaunching the webui...')\n",
241
+ "print('\u001b[0m')\n",
242
+ "%cd /stable-diffusion-webui\n",
243
+ "!python launch.py --ckpt /stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0.safetensors --vae-path /stable-diffusion-webui/models/Stable-diffusion/Anything-V3.0.vae.pt --share --xformers --enable-insecure-extension-access --gradio-queue"
244
+ ]
245
+ }
246
+ ],
247
+ "metadata": {
248
+ "kernelspec": {
249
+ "display_name": "Python 3",
250
+ "language": "python",
251
+ "name": "python3"
252
+ },
253
+ "language_info": {
254
+ "codemirror_mode": {
255
+ "name": "ipython",
256
+ "version": 3
257
+ },
258
+ "file_extension": ".py",
259
+ "mimetype": "text/x-python",
260
+ "name": "python",
261
+ "nbconvert_exporter": "python",
262
+ "pygments_lexer": "ipython3",
263
+ "version": "3.10.10"
264
+ },
265
+ "orig_nbformat": 4,
266
+ "vscode": {
267
+ "interpreter": {
268
+ "hash": "7b1f2b33e866b0bf2409397e5f58ba9cdf170d3b7f64c8f359c79998e2f88ad4"
269
+ }
270
+ }
271
+ },
272
+ "nbformat": 4,
273
+ "nbformat_minor": 2
274
+ }
requirements.txt CHANGED
@@ -1,2 +1,7 @@
1
  mljar-mercury
2
- torch
 
 
 
 
 
 
1
  mljar-mercury
2
+ diffusers
3
+ transformers
4
+ ftfy
5
+ scipy
6
+ torch
7
+ --extra-index-url https://download.pytorch.org/whl/cu113