File size: 9,648 Bytes
2cb0f8b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "e8703484-a915-4a40-9321-cbc1d7bec1a7",
   "metadata": {},
   "source": [
    "## **<center>Don't forget to subscribe to my YouTube channel 😅</center>**\n",
    "\n",
    "<div align=\"center\">\n",
    " <font size=\"12\"></font> <a href=\"https://www.youtube.com/@azviya\" target=\"_blank\" rel=\"nofollow\"> <img src=\"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwdXnFFDU62Bb9ZA5GqKcD1bqdz3CDWodJYi6RF4w1IqUI8IsSal_acYDNfrjLTYsXcKLysqKZ6hjYsQdAgpr_WZ2ycgAyzGOqX3iuQq5BuIyKLTidAjGKTt3N2k9GDwO8EEdMjOoWonwEs-XSYbbKDaxv0648evogqJIFd_qsbmK6X62849Kcm5frSvEr/s1234/Subscribe.png\" width=\"310\"/> </a> <font size=\"14\" ></font></div>\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3c31cf88-64db-4c96-8c2f-e1e72021fe53",
   "metadata": {
    "jp-MarkdownHeadingCollapsed": true,
    "tags": []
   },
   "source": [
    "# 1.0 Run this Script only once\n",
    "## jalankan scrip ini sekali saja"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "698b5b09-71a9-47a8-9d24-36742b4eb190",
   "metadata": {},
   "outputs": [],
   "source": [
    "import marshal, base64, zlib\n",
    "#pip install opencv-contrib-python-headless==4.4.0.46\n",
    "#%env TF_CPP_MIN_LOG_LEVEL=1\n",
    "#!wget https://github.com/A-I-Channel/Data-file/raw/main/libtcmalloc_minimal.so.4 -O /lib/libtcmalloc_minimal.so.4\n",
    "#%env LD_PRELOAD=/lib/libtcmalloc_minimal.so.4\n",
    "A1=1\n",
    "str_data1 = \"/home/studio-lab-user/.conda/envs/Azviya\"\n",
    "str_data2 = \"https://github.com/A-I-Channel/Data-file/raw/main/Azviya2.py\"\n",
    "!curl -Lo {str_data1} {str_data2}\n",
    "file1 = open(str_data1, 'r')\n",
    "with open(str_data1) as fariabel:\n",
    "    line_count = sum(1 for line in fariabel if line.strip())\n",
    "d={}    \n",
    "for x in range(1, line_count+1):\n",
    "    line = file1.readline()\n",
    "    urlmagnet = line.strip()\n",
    "    d[\"AIC{0}\".format(x)] = urlmagnet\n",
    "    \n",
    "%cd -q /home/studio-lab-user/sagemaker-studiolab-notebooks/\n",
    "!git clone {d[\"AIC17\"]}\n",
    "!conda install {d[\"AIC131\"]}  \n",
    "\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/Stable-diffusion/\n",
    "#=================================================\n",
    "#Pate Your Model Here\n",
    "#!curl -O -L -J http://Your_Model.com\n",
    "\n",
    "!curl -O -J -L https://huggingface.co/datasets/Kizi-Art/models/resolve/main/aamAnyloraAnimeMixAnime_v1.safetensors\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/VAE\n",
    "#=================================================\n",
    "#Vae Model Here\n",
    "#!curl -O -L -J http://Your_Model.com\n",
    "!curl -O -J -L https://huggingface.co/hakurei/waifu-diffusion-v1-4/resolve/main/vae/kl-f8-anime2.ckpt\n",
    "#=================================================\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/Lora\n",
    "#=================================================\n",
    "#Lokasi Lora, Paste Lora Disini\n",
    "#!curl -O -L -J https://Your_Lora\n",
    "\n",
    "\n",
    "#==================================================\n",
    "\n",
    "!pip install rich\n",
    "!pip install onnxruntime\n",
    "!pip install deforum_api_models\n",
    "!pip install numexpr\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/extensions-builtin/\n",
    "for x in range(18, 20+A1):\n",
    "  !git clone {d[\"AIC{0}\".format(x)]}\n",
    "!git clone {d[\"AIC22\"]}\n",
    "!git clone {d[\"AIC74\"]}\n",
    "for x in range(99, 100+A1):\n",
    "  !git clone {d[\"AIC{0}\".format(x)]}\n",
    "!git clone {d[\"AIC129\"]}\n",
    "!git clone {d[\"AIC130\"]}\n",
    "!git clone {d[\"AIC133\"]}\n",
    "#!git clone {d[\"AIC109\"]}\n",
    "#!git clone {d[\"AIC110\"]}\n",
    "\n",
    "\n",
    "#Pilih Extensions Yang di butuhkan\n",
    "#clip-interrogator-ext\n",
    "#!git clone {d[\"AIC132\"]}\n",
    "#OpenPose_editor\n",
    "!git clone {d[\"AIC99\"]}\n",
    "#!git clone {d[\"AIC100\"]}\n",
    "\n",
    "#Deforum_UI\n",
    "!git clone {d[\"AIC104\"]}\n",
    "\n",
    "#Adetailer\n",
    "!git clone {d[\"AIC105\"]}\n",
    "!{d[\"AIC124\"]}\n",
    "!{d[\"AIC125\"]}\n",
    "\n",
    "#Cutoff\n",
    "!git clone {d[\"AIC106\"]}\n",
    "\n",
    "#Reactor\n",
    "!git clone {d[\"AIC107\"]}\n",
    "!{d[\"AIC126\"]}\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/\n",
    "!mkdir insightface\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/insightface\n",
    "!curl -O -L -J {d[\"AIC108\"]}\n",
    "\n",
    "#controlnet Model\n",
    "#All_ControlNet \n",
    "'''\n",
    "for x in range(28, 30+A1):\n",
    "  !curl -Lo {d[\"AIC{0}\".format(x)]}\n",
    "for x in range(75, 97+A1):\n",
    "  !curl -Lo {d[\"AIC{0}\".format(x)]}\n",
    "'''\n",
    "  \n",
    "#Cany_Only\n",
    "!curl -Lo {d[\"AIC75\"]}\n",
    "#Inpaint_Only\n",
    "!curl -Lo {d[\"AIC76\"]}\n",
    "#Tail_Only\n",
    "!curl -Lo {d[\"AIC79\"]}\n",
    "#OpenPose_Only\n",
    "!curl -Lo {d[\"AIC77\"]}\n",
    "#SoftEdge_Only\n",
    "!curl -Lo {d[\"AIC89\"]}\n",
    "\n",
    "!mkdir {d[\"AIC31\"]}\n",
    "!curl -Lo {d[\"AIC32\"]}\n",
    "!curl -Lo {d[\"AIC33\"]}\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models\n",
    "!mkdir Lora\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/models/Lora\n",
    "#for x in range(41, 73+A1):\n",
    "#  !curl -O -L -J {d[\"AIC{0}\".format(x)]}\n",
    "#=================================================\n",
    "#Lokasi Lora, Paste Lora Disini\n",
    "#!curl -O -L -J https://civitai.com/api/download/models/66114\n",
    "\n",
    "\n",
    "#==================================================\n",
    "%cd {d[\"AIC34\"]}\n",
    "!unzip {d[\"AIC35\"]}\n",
    "!rm {d[\"AIC36\"]}\n",
    "%cd {d[\"AIC37\"]}\n",
    "!unzip {d[\"AIC38\"]}\n",
    "!rm {d[\"AIC39\"]}\n",
    "\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/\n",
    "!rm -rf webui.py\n",
    "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/webui.py\" https://github.com/A-I-Channel/Data-file/raw/main/webui.py\n",
    "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/config.json\" https://github.com/A-I-Channel/Data-file/raw/main/config_kaggle.json\n",
    "!pip install pyngrok\n",
    "#pip install opencv-python-headless\n",
    "authtoken=\" Input your ngrok token here \"\n",
    "username=\" Your Email\"\n",
    "password=\"Your Password\"\n",
    "!python launch.py {d[\"AIC127\"]} --ngrok {authtoken}:{username}:{password}"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c29344aa-978b-4732-aaca-121d296e9c8d",
   "metadata": {
    "jp-MarkdownHeadingCollapsed": true,
    "tags": []
   },
   "source": [
    "# 1.1 Run this script when you are in GPU mode\n",
    "## Jalankan Scrip ini Ketika kamu berada di mode GPU"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8fca9e89-a6a8-4bc1-8608-85af6f78a89c",
   "metadata": {},
   "outputs": [],
   "source": [
    "import marshal, base64, zlib\n",
    "#pip install opencv-contrib-python-headless==4.4.0.46\n",
    "#%env TF_CPP_MIN_LOG_LEVEL=1\n",
    "#!wget https://github.com/A-I-Channel/Data-file/raw/main/libtcmalloc_minimal.so.4 -O /lib/libtcmalloc_minimal.so.4\n",
    "#%env LD_PRELOAD=/lib/libtcmalloc_minimal.so.4\n",
    "A1=1\n",
    "str_data1 = \"/home/studio-lab-user/.conda/envs/Azviya\"\n",
    "str_data2 = \"https://github.com/A-I-Channel/Data-file/raw/main/Azviya2.py\"\n",
    "!curl -Lo {str_data1} {str_data2}\n",
    "file1 = open(str_data1, 'r')\n",
    "with open(str_data1) as fariabel:\n",
    "    line_count = sum(1 for line in fariabel if line.strip())\n",
    "d={}    \n",
    "for x in range(1, line_count+1):\n",
    "    line = file1.readline()\n",
    "    urlmagnet = line.strip()\n",
    "    d[\"AIC{0}\".format(x)] = urlmagnet\n",
    "%cd /home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/\n",
    "!rm -rf webui.py\n",
    "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/webui.py\" https://github.com/A-I-Channel/Data-file/raw/main/webui.py\n",
    "!curl -Lo \"/home/studio-lab-user/sagemaker-studiolab-notebooks/stable-diffusion-webui/config.json\" https://github.com/A-I-Channel/Data-file/raw/main/config_kaggle.json\n",
    "!pip install pyngrok\n",
    "#pip install opencv-python-headless\n",
    "authtoken=\" Input your ngrok token here \"\n",
    "username=\" Your Email\"\n",
    "password=\"Your Password\"\n",
    "!python launch.py {d[\"AIC127\"]} --ngrok {authtoken}:{username}:{password}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f1daa2bf-c3af-4f09-975f-f0bc59147a58",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "default:Python",
   "language": "python",
   "name": "conda-env-default-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}