NagisaNao commited on
Commit
842a5c6
1 Parent(s): 21aba51

🔨 I didn't break the repo, right?..

Browse files
files_cells/notebooks/en/auto-cleaner_en.ipynb DELETED
@@ -1,356 +0,0 @@
1
- {
2
- "nbformat": 4,
3
- "nbformat_minor": 0,
4
- "metadata": {
5
- "colab": {
6
- "provenance": []
7
- },
8
- "kernelspec": {
9
- "name": "python3",
10
- "display_name": "Python 3"
11
- },
12
- "language_info": {
13
- "name": "python"
14
- }
15
- },
16
- "cells": [
17
- {
18
- "cell_type": "code",
19
- "source": [
20
- "##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##\n",
21
- "\n",
22
- "import os\n",
23
- "import time\n",
24
- "import ipywidgets as widgets\n",
25
- "from ipywidgets import Label, Button, VBox, HBox\n",
26
- "from IPython.display import display, HTML, Javascript\n",
27
- "\n",
28
- "\n",
29
- "# ================= DETECT ENV =================\n",
30
- "def detect_environment():\n",
31
- " free_plan = (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024 ** 3) <= 20)\n",
32
- " environments = {\n",
33
- " 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
34
- " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\")\n",
35
- " }\n",
36
- "\n",
37
- " for env_var, (environment, path) in environments.items():\n",
38
- " if env_var in os.environ:\n",
39
- " return environment, path, free_plan\n",
40
- "\n",
41
- "env, root_path, free_plan = detect_environment()\n",
42
- "webui_path = f\"{root_path}/sdw\"\n",
43
- "# ----------------------------------------------\n",
44
- "\n",
45
- "\n",
46
- "# ==================== CSS ====================\n",
47
- "CSS = \"\"\"\n",
48
- "<style>\n",
49
- "/* General Styles */\n",
50
- "\n",
51
- "hr {\n",
52
- " border-color: grey;\n",
53
- " background-color: grey;\n",
54
- " opacity: 0.25;\n",
55
- "}\n",
56
- "\n",
57
- ".instruction_AC {\n",
58
- " font-family: cursive;\n",
59
- " font-size: 18px;\n",
60
- " color: grey;\n",
61
- " user-select: none;\n",
62
- " cursor: default;\n",
63
- "}\n",
64
- "\n",
65
- "\n",
66
- "/* Container style */\n",
67
- "\n",
68
- ".container_AC {\n",
69
- " position: relative;\n",
70
- " background-color: #232323;\n",
71
- " width: 800px;\n",
72
- " height: auto;\n",
73
- " padding: 15px;\n",
74
- " border-radius: 15px;\n",
75
- " box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);\n",
76
- " margin-bottom: 5px;\n",
77
- " overflow: visible;\n",
78
- "}\n",
79
- "\n",
80
- ".container_AC::before {\n",
81
- " position: absolute;\n",
82
- " top: 5px;\n",
83
- " right: 10px;\n",
84
- " content: \"AutoCleanerV3.6\";\n",
85
- " font-weight: bold;\n",
86
- " font-size: 24px;\n",
87
- " color: rgba(0, 0, 0, 0.2);\n",
88
- "}\n",
89
- "\n",
90
- ".container_AC::after {\n",
91
- " position: absolute;\n",
92
- " top: 30px;\n",
93
- " right: 10px;\n",
94
- " content: \"ANXETY\";\n",
95
- " font-weight: bold;\n",
96
- " font-size: 18px;\n",
97
- " color: rgba(0, 0, 0, 0.2);\n",
98
- "}\n",
99
- "\n",
100
- ".custom-select-multiple_AC select {\n",
101
- " padding: 10px;\n",
102
- " font-family: cursive;\n",
103
- " border: 1px solid #262626 !important;\n",
104
- " border-radius: 10px;\n",
105
- " color: white;\n",
106
- " background-color: #1c1c1c;\n",
107
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
108
- "}\n",
109
- "\n",
110
- ".output_AC {\n",
111
- " padding: 10px;\n",
112
- " height: auto;\n",
113
- " border: 1px solid #262626;\n",
114
- " border-radius: 10px;\n",
115
- " background-color: #1c1c1c;\n",
116
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
117
- " width: auto;\n",
118
- " box-sizing: border-box;\n",
119
- "}\n",
120
- "\n",
121
- ".output_message_AC {\n",
122
- " font-family: cursive;\n",
123
- " color: white !important;\n",
124
- " font-size: 14px;\n",
125
- " user-select: none;\n",
126
- " cursor: default\n",
127
- "}\n",
128
- "\n",
129
- "\n",
130
- ".storage_info_AC {\n",
131
- " padding: 5px 20px;\n",
132
- " height: auto;\n",
133
- " border: 1px solid #262626;\n",
134
- " border-radius: 10px;\n",
135
- " background-color: #1c1c1c;\n",
136
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
137
- " width: auto;\n",
138
- " font-family: cursive;\n",
139
- " color: #B2B2B2 !important;\n",
140
- " font-size: 14px;\n",
141
- " user-select: none;\n",
142
- " cursor: default\n",
143
- "}\n",
144
- "\n",
145
- "\n",
146
- "/* Button and storage info layout */\n",
147
- ".lower_information_panel_AC {\n",
148
- " display: flex;\n",
149
- " align-items: center;\n",
150
- " justify-content: space-between;\n",
151
- "}\n",
152
- "\n",
153
- "\n",
154
- "/* Button style */\n",
155
- "\n",
156
- ".button_AC {\n",
157
- " width: auto;\n",
158
- " font-family: cursive;\n",
159
- " color: white !important;\n",
160
- " font-size: 14px;\n",
161
- " font-weight: bold;\n",
162
- " height: 35px;\n",
163
- " border-radius: 15px;\n",
164
- " background-image: radial-gradient(circle at top left, purple 10%, violet 90%);\n",
165
- " background-size: 200% 200%;\n",
166
- " background-position: left bottom;\n",
167
- " transition: background 0.5s ease-in-out, transform 0.3s ease;\n",
168
- "}\n",
169
- "\n",
170
- ".button_AC:hover {\n",
171
- " cursor: pointer;\n",
172
- " background-size: 200% 200%;\n",
173
- " background-position: right bottom;\n",
174
- " transform: translateY(1px);\n",
175
- "}\n",
176
- "\n",
177
- ".button_execute_AC:hover {\n",
178
- " background-image: radial-gradient(circle at top left, purple 10%, #93ac47 90%);\n",
179
- "}\n",
180
- "\n",
181
- ".button_clear_AC:hover {\n",
182
- " background-image: radial-gradient(circle at top left, purple 10%, #fc3468 90%);\n",
183
- "}\n",
184
- "\n",
185
- ".button_execute_AC:active,\n",
186
- ".button_clear_AC:active {\n",
187
- " filter: brightness(0.75);\n",
188
- "}\n",
189
- "\n",
190
- ".jupyter-widgets.lm-Widget:focus {\n",
191
- " outline: none;\n",
192
- "}\n",
193
- "\n",
194
- "\n",
195
- "/* Animation of elements */\n",
196
- "\n",
197
- "/* Emergence */\n",
198
- ".container_AC {\n",
199
- " animation-name: slideInTopBlur;\n",
200
- " animation-duration: 0.7s;\n",
201
- " animation-fill-mode: forwards;\n",
202
- "}\n",
203
- "\n",
204
- "@keyframes slideInTopBlur {\n",
205
- " 0% {\n",
206
- " transform: translate3d(0, 50%, 0) scale(0.85) rotate3d(1, 0, 0, -85deg);\n",
207
- " filter: blur(5px) grayscale(1) brightness(0.5);\n",
208
- " opacity: 0;\n",
209
- " }\n",
210
- " 100% {\n",
211
- " transform: translate3d(0, 0, 0) scale(1) rotate3d(1, 0, 0, 0deg);\n",
212
- " filter: blur(0) grayscale(0) brightness(1);\n",
213
- " opacity: 1;\n",
214
- " }\n",
215
- "}\n",
216
- "\n",
217
- "/* Leaving */\n",
218
- ".container_AC.hide {\n",
219
- " animation-name: slideOutTopBlur;\n",
220
- " animation-duration: 0.5s;\n",
221
- " animation-fill-mode: forwards;\n",
222
- "}\n",
223
- "\n",
224
- "@keyframes slideOutTopBlur {\n",
225
- " 0% {\n",
226
- " transform: translate3d(0, 0, 0) scale(1);\n",
227
- " filter: blur(0) grayscale(0) brightness(1);\n",
228
- " opacity: 1;\n",
229
- " }\n",
230
- " 100% {\n",
231
- " transform: translate3d(0, -100%, 0);\n",
232
- " filter: blur(5px) grayscale(1) brightness(0);\n",
233
- " opacity: 0;\n",
234
- " }\n",
235
- "}\n",
236
- "</style>\n",
237
- "\"\"\"\n",
238
- "\n",
239
- "display(HTML(CSS))\n",
240
- "# ==================== CSS ====================\n",
241
- "\n",
242
- "\n",
243
- "# ================ AutoCleaner function ================\n",
244
- "directories = {\n",
245
- " \"Images\": f\"{webui_path}/output\",\n",
246
- " \"Models\": f\"{webui_path}/models/Stable-diffusion/\",\n",
247
- " \"Vae\": f\"{webui_path}/models/VAE/\",\n",
248
- " \"LoRa\": f\"{webui_path}/models/Lora/\",\n",
249
- " \"ControlNet Models\": f\"{webui_path}/models/ControlNet/\"\n",
250
- "}\n",
251
- "\n",
252
- "\"\"\" functions \"\"\"\n",
253
- "def clean_directory(directory):\n",
254
- " deleted_files = 0\n",
255
- " image_dir = directories['Images']\n",
256
- "\n",
257
- " for root, dirs, files in os.walk(directory):\n",
258
- " for file in files:\n",
259
- " file_path = os.path.join(root, file)\n",
260
- "\n",
261
- " if file.endswith(\".txt\"):\n",
262
- " continue\n",
263
- " if file.endswith((\".safetensors\", \".pt\")) or root == image_dir: # fix for image counter\n",
264
- " deleted_files += 1\n",
265
- "\n",
266
- " os.remove(file_path)\n",
267
- " return deleted_files\n",
268
- "\n",
269
- "def update_memory_info():\n",
270
- " disk_space = psutil.disk_usage(os.getcwd())\n",
271
- " total = disk_space.total / (1024 ** 3)\n",
272
- " used = disk_space.used / (1024 ** 3)\n",
273
- " free = disk_space.free / (1024 ** 3)\n",
274
- "\n",
275
- " storage_info.value = f'''\n",
276
- " <div class=\"storage_info_AC\">Total storage: {total:.2f} GB <span style=\"color: #555\">|</span> Used: {used:.2f} GB <span style=\"color: #555\">|</span> Free: {free:.2f} GB</div>\n",
277
- " '''\n",
278
- "\n",
279
- "def on_execute_button_press(button):\n",
280
- " selected_cleaners = auto_cleaner_widget.value\n",
281
- " deleted_files_dict = {}\n",
282
- "\n",
283
- " for option in selected_cleaners:\n",
284
- " if option in directories:\n",
285
- " deleted_files_dict[option] = clean_directory(directories[option])\n",
286
- "\n",
287
- " output.clear_output()\n",
288
- "\n",
289
- " with output:\n",
290
- " for message in generate_messages(deleted_files_dict):\n",
291
- " message_widget = HTML(f'<p class=\"output_message_AC\">{message}</p>')\n",
292
- " display(message_widget)\n",
293
- "\n",
294
- " update_memory_info()\n",
295
- "\n",
296
- "def on_clear_button_press(button):\n",
297
- " container.add_class(\"hide\")\n",
298
- " time.sleep(0.5)\n",
299
- " widgets.Widget.close_all()\n",
300
- "\n",
301
- "def generate_messages(deleted_files_dict):\n",
302
- " messages = []\n",
303
- " word_variants = {\n",
304
- " \"Images\": \"Images\",\n",
305
- " \"Models\": \"Models\",\n",
306
- " \"Vae\": \"Vae\",\n",
307
- " \"LoRa\": \"LoRa\",\n",
308
- " \"ControlNet Models\": \"ControlNet Models\"\n",
309
- " }\n",
310
- " for key, value in deleted_files_dict.items():\n",
311
- " object_word = word_variants.get(key)\n",
312
- " messages.append(f\"Deleted {value} {object_word}\")\n",
313
- " return messages\n",
314
- "# ================ AutoCleaner function ================\n",
315
- "\n",
316
- "\n",
317
- "# --- storage memory ---\n",
318
- "import psutil\n",
319
- "disk_space = psutil.disk_usage(os.getcwd())\n",
320
- "total = disk_space.total / (1024 ** 3)\n",
321
- "used = disk_space.used / (1024 ** 3)\n",
322
- "free = disk_space.free / (1024 ** 3)\n",
323
- "\n",
324
- "\n",
325
- "# UI Code\n",
326
- "AutoCleaner_options = AutoCleaner_options = list(directories.keys())\n",
327
- "instruction_label = widgets.HTML('''\n",
328
- "<span class=\"instruction_AC\">Use <span style=\"color: #B2B2B2;\">ctrl</span> or <span style=\"color: #B2B2B2;\">shift</span> for multiple selections.</span>\n",
329
- "''')\n",
330
- "auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='auto')).add_class(\"custom-select-multiple_AC\")\n",
331
- "output = widgets.Output().add_class(\"output_AC\")\n",
332
- "# ---\n",
333
- "execute_button = Button(description='Execute Cleaning').add_class(\"button_execute_AC\").add_class(\"button_AC\")\n",
334
- "execute_button.on_click(on_execute_button_press)\n",
335
- "clear_button = Button(description='Hide Widget').add_class(\"button_clear_AC\").add_class(\"button_AC\")\n",
336
- "clear_button.on_click(on_clear_button_press)\n",
337
- "# ---\n",
338
- "storage_info = widgets.HTML(f'''\n",
339
- "<div class=\"storage_info_AC\">Total storage: {total:.2f} GB <span style=\"color: #555\">|</span> Used: {used:.2f} GB <span style=\"color: #555\">|</span> Free: {free:.2f} GB</div>\n",
340
- "''')\n",
341
- "# ---\n",
342
- "buttons = widgets.HBox([execute_button, clear_button])\n",
343
- "lower_information_panel = widgets.HBox([buttons, storage_info]).add_class(\"lower_information_panel_AC\")\n",
344
- "\n",
345
- "container = VBox([instruction_label, widgets.HTML('<hr>'), auto_cleaner_widget, output, widgets.HTML('<hr>'), lower_information_panel]).add_class(\"container_AC\")\n",
346
- "\n",
347
- "display(container)"
348
- ],
349
- "metadata": {
350
- "id": "I22dFg7F2j3G"
351
- },
352
- "execution_count": null,
353
- "outputs": []
354
- }
355
- ]
356
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files_cells/notebooks/en/downloading_en.ipynb CHANGED
@@ -208,19 +208,19 @@
208
  "print(\"📦 Downloading models and stuff...\", end='')\n",
209
  "model_list = {\n",
210
  " \"1.Anime (by XpucT) + INP\": [\n",
211
- " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_v2.safetensors\"},\n",
212
- " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_v2-inpainting.safetensors\"}\n",
213
  " ],\n",
214
  " \"2.BluMix [Anime] [V7] + INP\": [\n",
215
- " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_v7.safetensors\"},\n",
216
- " {\"url\": \"https://civitai.com/api/download/models/363850\", \"name\": \"BluMix_v7-inpainting.safetensors\"}\n",
217
  " ],\n",
218
  " \"3.Cetus-Mix [Anime] [V4] + INP\": [\n",
219
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
220
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
221
  " ],\n",
222
  " \"4.Counterfeit [Anime] [V3] + INP\": [\n",
223
- " {\"url\": \"https://civitai.com/api/download/models/125050\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
224
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
225
  " ],\n",
226
  " \"5.CuteColor [Anime] [V3]\": [\n",
@@ -231,8 +231,8 @@
231
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
232
  " ],\n",
233
  " \"7.Deliberate [Realism] [V6] + INP\": [\n",
234
- " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors\", \"name\": \"Deliberate_v6.safetensors\"},\n",
235
- " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors\", \"name\": \"Deliberate_v6-inpainting.safetensors\"}\n",
236
  " ],\n",
237
  " \"8.Meina-Mix [Anime] [V11] + INP\": [\n",
238
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
@@ -246,8 +246,8 @@
246
  "\n",
247
  "vae_list = {\n",
248
  " \"1.Anime.vae\": [{\"url\": \"https://civitai.com/api/download/models/311162\", \"name\": \"vae-ft-mse-840000-ema-pruned.vae.safetensors\"}],\n",
249
- " \"2.Anything.vae\": [{\"url\": \"https://civitai.com/api/download/models/119279\", \"name\": \"Anything.vae.safetensors\"}],\n",
250
- " \"3.Blessed2.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/blessed_vae/resolve/main/blessed2.vae.pt\", \"name\": \"Blessed2.vae.safetensors\"}],\n",
251
  " \"4.ClearVae.vae\": [{\"url\": \"https://civitai.com/api/download/models/88156\", \"name\": \"ClearVae_23.vae.safetensors\"}],\n",
252
  " \"5.WD.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors\", \"name\": \"WD.vae.safetensors\"}]\n",
253
  "}\n",
 
208
  "print(\"📦 Downloading models and stuff...\", end='')\n",
209
  "model_list = {\n",
210
  " \"1.Anime (by XpucT) + INP\": [\n",
211
+ " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_V2.safetensors\"},\n",
212
+ " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_V2-inpainting.safetensors\"}\n",
213
  " ],\n",
214
  " \"2.BluMix [Anime] [V7] + INP\": [\n",
215
+ " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_V7.safetensors\"},\n",
216
+ " {\"url\": \"https://civitai.com/api/download/models/363850\", \"name\": \"BluMix_V7-inpainting.safetensors\"}\n",
217
  " ],\n",
218
  " \"3.Cetus-Mix [Anime] [V4] + INP\": [\n",
219
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
220
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
221
  " ],\n",
222
  " \"4.Counterfeit [Anime] [V3] + INP\": [\n",
223
+ " {\"url\": \"https://huggingface.co/gsdf/Counterfeit-V3.0/resolve/main/Counterfeit-V3.0_fix_fp16.safetensors\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
224
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
225
  " ],\n",
226
  " \"5.CuteColor [Anime] [V3]\": [\n",
 
231
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
232
  " ],\n",
233
  " \"7.Deliberate [Realism] [V6] + INP\": [\n",
234
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors\", \"name\": \"Deliberate_V6.safetensors\"},\n",
235
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors\", \"name\": \"Deliberate_V6-inpainting.safetensors\"}\n",
236
  " ],\n",
237
  " \"8.Meina-Mix [Anime] [V11] + INP\": [\n",
238
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
 
246
  "\n",
247
  "vae_list = {\n",
248
  " \"1.Anime.vae\": [{\"url\": \"https://civitai.com/api/download/models/311162\", \"name\": \"vae-ft-mse-840000-ema-pruned.vae.safetensors\"}],\n",
249
+ " \"2.Anything.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/any.vae.safetensors\", \"name\": \"Anything.vae.safetensors\"}],\n",
250
+ " \"3.Blessed2.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/blessed2.vae.safetensors\", \"name\": \"Blessed2.vae.safetensors\"}],\n",
251
  " \"4.ClearVae.vae\": [{\"url\": \"https://civitai.com/api/download/models/88156\", \"name\": \"ClearVae_23.vae.safetensors\"}],\n",
252
  " \"5.WD.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors\", \"name\": \"WD.vae.safetensors\"}]\n",
253
  "}\n",
files_cells/notebooks/en/main_dl_file_en.ipynb DELETED
@@ -1,74 +0,0 @@
1
- {
2
- "nbformat": 4,
3
- "nbformat_minor": 0,
4
- "metadata": {
5
- "colab": {
6
- "provenance": []
7
- },
8
- "kernelspec": {
9
- "name": "python3",
10
- "display_name": "Python 3"
11
- },
12
- "language_info": {
13
- "name": "python"
14
- }
15
- },
16
- "cells": [
17
- {
18
- "cell_type": "code",
19
- "source": [
20
- "import os\n",
21
- "from IPython.utils import capture\n",
22
- "\n",
23
- "def check_colab_subscription():\n",
24
- " return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)\n",
25
- "free_plan = check_colab_subscription()\n",
26
- "\n",
27
- "def detect_environment():\n",
28
- " environments = {\n",
29
- " 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
30
- " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
31
- " 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
32
- " }\n",
33
- "\n",
34
- " for env_var, (environment, path) in environments.items():\n",
35
- " if env_var in os.environ:\n",
36
- " return environment, path\n",
37
- "\n",
38
- " print(\"\\033[31mError: an unsupported runtime environment was detected.\\n\\033[34mSupported environments:\\033[0m Google Colab, Kaggle, Sagemaker Studio Lab\")\n",
39
- " return None, None\n",
40
- "\n",
41
- "env, root_path = detect_environment()\n",
42
- "if env and root_path:\n",
43
- " webui_path = f\"{root_path}/sdw\"\n",
44
- "\n",
45
- " print(f\"Runtime environment: \\033[33m{env}\\033[0m\")\n",
46
- " # Colab Plan\n",
47
- " if env == \"Google Colab\":\n",
48
- " print(f\"Colab Pro subscription: \\033[34m{not free_plan}\\033[0m\")\n",
49
- " print(f\"File location: \\033[32m{root_path}\\033[0m\")\n",
50
- "\n",
51
- " print(\"Please wait for the files to download.... 👀\", end='')\n",
52
- " with capture.capture_output() as cap:\n",
53
- " files = [f'widgets_{lang}.py', f'downloading_{lang}.py', f'launch_{lang}.py', f'auto-cleaner_{lang}.py']\n",
54
- " folder_path = f'{root_path}/file_cell'\n",
55
- "\n",
56
- " if os.path.exists(folder_path):\n",
57
- " !rm -rf {folder_path}\n",
58
- "\n",
59
- " !mkdir -p {folder_path}\n",
60
- "\n",
61
- " for file in files:\n",
62
- " !wget -q https://huggingface.co/NagisaNao/fast_repo/resolve/main/files_cells/python/{lang}/{file} -O {folder_path}/{file}\n",
63
- "\n",
64
- " del cap\n",
65
- " print(\"\\rDone! Now you can run the cells below. ☄️\" + \" \"*30)"
66
- ],
67
- "metadata": {
68
- "id": "osk658gR0Wu7"
69
- },
70
- "execution_count": null,
71
- "outputs": []
72
- }
73
- ]
74
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files_cells/notebooks/ru/auto-cleaner_ru.ipynb DELETED
@@ -1,356 +0,0 @@
1
- {
2
- "nbformat": 4,
3
- "nbformat_minor": 0,
4
- "metadata": {
5
- "colab": {
6
- "provenance": []
7
- },
8
- "kernelspec": {
9
- "name": "python3",
10
- "display_name": "Python 3"
11
- },
12
- "language_info": {
13
- "name": "python"
14
- }
15
- },
16
- "cells": [
17
- {
18
- "cell_type": "code",
19
- "source": [
20
- "##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##\n",
21
- "\n",
22
- "import os\n",
23
- "import time\n",
24
- "import ipywidgets as widgets\n",
25
- "from ipywidgets import Label, Button, VBox, HBox\n",
26
- "from IPython.display import display, HTML\n",
27
- "\n",
28
- "\n",
29
- "# ================= DETECT ENV =================\n",
30
- "def detect_environment():\n",
31
- " free_plan = (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024 ** 3) <= 20)\n",
32
- " environments = {\n",
33
- " 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
34
- " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\")\n",
35
- " }\n",
36
- "\n",
37
- " for env_var, (environment, path) in environments.items():\n",
38
- " if env_var in os.environ:\n",
39
- " return environment, path, free_plan\n",
40
- "\n",
41
- "env, root_path, free_plan = detect_environment()\n",
42
- "webui_path = f\"{root_path}/sdw\"\n",
43
- "# ----------------------------------------------\n",
44
- "\n",
45
- "\n",
46
- "# ==================== CSS ====================\n",
47
- "CSS_AC = \"\"\"\n",
48
- "<style>\n",
49
- "/* General Styles */\n",
50
- "\n",
51
- "hr {\n",
52
- " border-color: grey;\n",
53
- " background-color: grey;\n",
54
- " opacity: 0.25;\n",
55
- "}\n",
56
- "\n",
57
- ".instruction_AC {\n",
58
- " font-family: cursive;\n",
59
- " font-size: 18px;\n",
60
- " color: grey;\n",
61
- " user-select: none;\n",
62
- " cursor: default;\n",
63
- "}\n",
64
- "\n",
65
- "\n",
66
- "/* Container style */\n",
67
- "\n",
68
- ".container_AC {\n",
69
- " position: relative;\n",
70
- " background-color: #232323;\n",
71
- " width: 800px;\n",
72
- " height: auto;\n",
73
- " padding: 15px;\n",
74
- " border-radius: 15px;\n",
75
- " box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);\n",
76
- " margin-bottom: 5px;\n",
77
- " overflow: visible;\n",
78
- "}\n",
79
- "\n",
80
- ".container_AC::before {\n",
81
- " position: absolute;\n",
82
- " top: 5px;\n",
83
- " right: 10px;\n",
84
- " content: \"AutoCleanerV3.6\";\n",
85
- " font-weight: bold;\n",
86
- " font-size: 24px;\n",
87
- " color: rgba(0, 0, 0, 0.2);\n",
88
- "}\n",
89
- "\n",
90
- ".container_AC::after {\n",
91
- " position: absolute;\n",
92
- " top: 30px;\n",
93
- " right: 10px;\n",
94
- " content: \"ANXETY\";\n",
95
- " font-weight: bold;\n",
96
- " font-size: 18px;\n",
97
- " color: rgba(0, 0, 0, 0.2);\n",
98
- "}\n",
99
- "\n",
100
- ".custom-select-multiple_AC select {\n",
101
- " padding: 10px;\n",
102
- " font-family: cursive;\n",
103
- " border: 1px solid #262626 !important;\n",
104
- " border-radius: 10px;\n",
105
- " color: white;\n",
106
- " background-color: #1c1c1c;\n",
107
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
108
- "}\n",
109
- "\n",
110
- ".output_AC {\n",
111
- " padding: 10px;\n",
112
- " height: auto;\n",
113
- " border: 1px solid #262626;\n",
114
- " border-radius: 10px;\n",
115
- " background-color: #1c1c1c;\n",
116
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
117
- " width: auto;\n",
118
- " box-sizing: border-box;\n",
119
- "}\n",
120
- "\n",
121
- ".output_message_AC {\n",
122
- " font-family: cursive;\n",
123
- " color: white !important;\n",
124
- " font-size: 14px;\n",
125
- " user-select: none;\n",
126
- " cursor: default\n",
127
- "}\n",
128
- "\n",
129
- "\n",
130
- ".storage_info_AC {\n",
131
- " padding: 5px 20px;\n",
132
- " height: auto;\n",
133
- " border: 1px solid #262626;\n",
134
- " border-radius: 10px;\n",
135
- " background-color: #1c1c1c;\n",
136
- " box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);\n",
137
- " width: auto;\n",
138
- " font-family: cursive;\n",
139
- " color: #B2B2B2 !important;\n",
140
- " font-size: 14px;\n",
141
- " user-select: none;\n",
142
- " cursor: default\n",
143
- "}\n",
144
- "\n",
145
- "\n",
146
- "/* Button and storage info layout */\n",
147
- ".lower_information_panel_AC {\n",
148
- " display: flex;\n",
149
- " align-items: center;\n",
150
- " justify-content: space-between;\n",
151
- "}\n",
152
- "\n",
153
- "\n",
154
- "/* Button style */\n",
155
- "\n",
156
- ".button_AC {\n",
157
- " width: auto;\n",
158
- " font-family: cursive;\n",
159
- " color: white !important;\n",
160
- " font-size: 14px;\n",
161
- " font-weight: bold;\n",
162
- " height: 35px;\n",
163
- " border-radius: 15px;\n",
164
- " background-image: radial-gradient(circle at top left, purple 10%, violet 90%);\n",
165
- " background-size: 200% 200%;\n",
166
- " background-position: left bottom;\n",
167
- " transition: background 0.5s ease-in-out, transform 0.3s ease;\n",
168
- "}\n",
169
- "\n",
170
- ".button_AC:hover {\n",
171
- " cursor: pointer;\n",
172
- " background-size: 200% 200%;\n",
173
- " background-position: right bottom;\n",
174
- " transform: translateY(1px);\n",
175
- "}\n",
176
- "\n",
177
- ".button_execute_AC:hover {\n",
178
- " background-image: radial-gradient(circle at top left, purple 10%, #93ac47 90%);\n",
179
- "}\n",
180
- "\n",
181
- ".button_clear_AC:hover {\n",
182
- " background-image: radial-gradient(circle at top left, purple 10%, #fc3468 90%);\n",
183
- "}\n",
184
- "\n",
185
- ".button_execute_AC:active,\n",
186
- ".button_clear_AC:active {\n",
187
- " filter: brightness(0.75);\n",
188
- "}\n",
189
- "\n",
190
- ".jupyter-widgets.lm-Widget:focus {\n",
191
- " outline: none;\n",
192
- "}\n",
193
- "\n",
194
- "\n",
195
- "/* Animation of elements */\n",
196
- "\n",
197
- "/* Emergence */\n",
198
- ".container_AC {\n",
199
- " animation-name: slideInTopBlur;\n",
200
- " animation-duration: 0.7s;\n",
201
- " animation-fill-mode: forwards;\n",
202
- "}\n",
203
- "\n",
204
- "@keyframes slideInTopBlur {\n",
205
- " 0% {\n",
206
- " transform: translate3d(0, 50%, 0) scale(0.85) rotate3d(1, 0, 0, -85deg);\n",
207
- " filter: blur(5px) grayscale(1) brightness(0.5);\n",
208
- " opacity: 0;\n",
209
- " }\n",
210
- " 100% {\n",
211
- " transform: translate3d(0, 0, 0) scale(1) rotate3d(1, 0, 0, 0deg);\n",
212
- " filter: blur(0) grayscale(0) brightness(1);\n",
213
- " opacity: 1;\n",
214
- " }\n",
215
- "}\n",
216
- "\n",
217
- "/* Leaving */\n",
218
- ".container_AC.hide {\n",
219
- " animation-name: slideOutTopBlur;\n",
220
- " animation-duration: 0.3s;\n",
221
- " animation-fill-mode: forwards;\n",
222
- "}\n",
223
- "\n",
224
- "@keyframes slideOutTopBlur {\n",
225
- " 0% {\n",
226
- " transform: translate3d(0, 0, 0) scale(1);\n",
227
- " filter: blur(0) grayscale(0) brightness(1);\n",
228
- " opacity: 1;\n",
229
- " }\n",
230
- " 100% {\n",
231
- " transform: translate3d(0, -100%, 0);\n",
232
- " filter: blur(5px) grayscale(1) brightness(0);\n",
233
- " opacity: 0;\n",
234
- " }\n",
235
- "}\n",
236
- "</style>\n",
237
- "\"\"\"\n",
238
- "\n",
239
- "display(HTML(CSS_AC))\n",
240
- "# ==================== CSS ====================\n",
241
- "\n",
242
- "\n",
243
- "# ================ AutoCleaner function ================\n",
244
- "directories = {\n",
245
- " \"Изображения\": f\"{webui_path}/output\",\n",
246
- " \"Модели\": f\"{webui_path}/models/Stable-diffusion/\",\n",
247
- " \"Vae\": f\"{webui_path}/models/VAE/\",\n",
248
- " \"LoRa\": f\"{webui_path}/models/Lora/\",\n",
249
- " \"ControlNet Модели\": f\"{webui_path}/models/ControlNet/\"\n",
250
- "}\n",
251
- "\n",
252
- "\"\"\" functions \"\"\"\n",
253
- "def clean_directory(directory):\n",
254
- " deleted_files = 0\n",
255
- " image_dir = directories['Изображения']\n",
256
- "\n",
257
- " for root, dirs, files in os.walk(directory):\n",
258
- " for file in files:\n",
259
- " file_path = os.path.join(root, file)\n",
260
- "\n",
261
- " if file.endswith(\".txt\"):\n",
262
- " continue\n",
263
- " if file.endswith((\".safetensors\", \".pt\")) or root == image_dir: # fix for image counter\n",
264
- " deleted_files += 1\n",
265
- "\n",
266
- " os.remove(file_path)\n",
267
- " return deleted_files\n",
268
- "\n",
269
- "def update_memory_info():\n",
270
- " disk_space = psutil.disk_usage(os.getcwd())\n",
271
- " total = disk_space.total / (1024 ** 3)\n",
272
- " used = disk_space.used / (1024 ** 3)\n",
273
- " free = disk_space.free / (1024 ** 3)\n",
274
- "\n",
275
- " storage_info.value = f'''\n",
276
- " <div class=\"storage_info_AC\">Всего: {total:.2f} GB <span style=\"color: #555\">|</span> Используется: {used:.2f} GB <span style=\"color: #555\">|</span> Свободно: {free:.2f} GB</div>\n",
277
- " '''\n",
278
- "\n",
279
- "def on_execute_button_press(button):\n",
280
- " selected_cleaners = auto_cleaner_widget.value\n",
281
- " deleted_files_dict = {}\n",
282
- "\n",
283
- " for option in selected_cleaners:\n",
284
- " if option in directories:\n",
285
- " deleted_files_dict[option] = clean_directory(directories[option])\n",
286
- "\n",
287
- " output.clear_output()\n",
288
- "\n",
289
- " with output:\n",
290
- " for message in generate_messages(deleted_files_dict):\n",
291
- " message_widget = HTML(f'<p class=\"output_message_AC\">{message}</p>')\n",
292
- " display(message_widget)\n",
293
- "\n",
294
- " update_memory_info()\n",
295
- "\n",
296
- "def on_clear_button_press(button):\n",
297
- " container.add_class(\"hide\")\n",
298
- " time.sleep(0.5)\n",
299
- " widgets.Widget.close_all()\n",
300
- "\n",
301
- "def generate_messages(deleted_files_dict):\n",
302
- " messages = []\n",
303
- " word_variants = {\n",
304
- " \"Изображения\": \"Изображений\",\n",
305
- " \"Модели\": \"Моделей\",\n",
306
- " \"Vae\": \"Vae\",\n",
307
- " \"LoRa\": \"LoRa\",\n",
308
- " \"ControlNet Модели\": \"ControlNet Моделей\"\n",
309
- " }\n",
310
- " for key, value in deleted_files_dict.items():\n",
311
- " object_word = word_variants.get(key)\n",
312
- " messages.append(f\"Удалено {value} {object_word}\")\n",
313
- " return messages\n",
314
- "# ================ AutoCleaner function ================\n",
315
- "\n",
316
- "\n",
317
- "# --- storage memory ---\n",
318
- "import psutil\n",
319
- "disk_space = psutil.disk_usage(os.getcwd())\n",
320
- "total = disk_space.total / (1024 ** 3)\n",
321
- "used = disk_space.used / (1024 ** 3)\n",
322
- "free = disk_space.free / (1024 ** 3)\n",
323
- "\n",
324
- "\n",
325
- "# UI Code\n",
326
- "AutoCleaner_options = AutoCleaner_options = list(directories.keys())\n",
327
- "instruction_label = widgets.HTML('''\n",
328
- "<span class=\"instruction_AC\">Используйте <span style=\"color: #B2B2B2;\">ctrl</span> или <span style=\"color: #B2B2B2;\">shift</span> для множественного выбора.</span>\n",
329
- "''')\n",
330
- "auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width=\"auto\")).add_class(\"custom-select-multiple_AC\")\n",
331
- "output = widgets.Output().add_class(\"output_AC\")\n",
332
- "# ---\n",
333
- "execute_button = Button(description='Выполнить Очистку').add_class(\"button_execute_AC\").add_class(\"button_AC\")\n",
334
- "execute_button.on_click(on_execute_button_press)\n",
335
- "clear_button = Button(description='Скрыть Виджет').add_class(\"button_clear_AC\").add_class(\"button_AC\")\n",
336
- "clear_button.on_click(on_clear_button_press)\n",
337
- "# ---\n",
338
- "storage_info = widgets.HTML(f'''\n",
339
- "<div class=\"storage_info_AC\">Всего: {total:.2f} GB <span style=\"color: #555\">|</span> Используется: {used:.2f} GB <span style=\"color: #555\">|</span> Свободно: {free:.2f} GB</div>\n",
340
- "''')\n",
341
- "# ---\n",
342
- "buttons = widgets.HBox([execute_button, clear_button])\n",
343
- "lower_information_panel = widgets.HBox([buttons, storage_info]).add_class(\"lower_information_panel_AC\")\n",
344
- "\n",
345
- "container = VBox([instruction_label, widgets.HTML('<hr>'), auto_cleaner_widget, output, widgets.HTML('<hr>'), lower_information_panel]).add_class(\"container_AC\")\n",
346
- "\n",
347
- "display(container)"
348
- ],
349
- "metadata": {
350
- "id": "I22dFg7F2j3G"
351
- },
352
- "execution_count": null,
353
- "outputs": []
354
- }
355
- ]
356
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files_cells/notebooks/ru/downloading_ru.ipynb CHANGED
@@ -208,19 +208,19 @@
208
  "print(\"📦 Скачивание моделей и прочего...\", end='')\n",
209
  "model_list = {\n",
210
  " \"1.Anime (by XpucT) + INP\": [\n",
211
- " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_v2.safetensors\"},\n",
212
- " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_v2-inpainting.safetensors\"}\n",
213
  " ],\n",
214
  " \"2.BluMix [Anime] [V7] + INP\": [\n",
215
- " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_v7.safetensors\"},\n",
216
- " {\"url\": \"https://civitai.com/api/download/models/363850\", \"name\": \"BluMix_v7-inpainting.safetensors\"}\n",
217
  " ],\n",
218
  " \"3.Cetus-Mix [Anime] [V4] + INP\": [\n",
219
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
220
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
221
  " ],\n",
222
  " \"4.Counterfeit [Anime] [V3] + INP\": [\n",
223
- " {\"url\": \"https://civitai.com/api/download/models/125050\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
224
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
225
  " ],\n",
226
  " \"5.CuteColor [Anime] [V3]\": [\n",
@@ -231,8 +231,8 @@
231
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
232
  " ],\n",
233
  " \"7.Deliberate [Realism] [V6] + INP\": [\n",
234
- " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors\", \"name\": \"Deliberate_v6.safetensors\"},\n",
235
- " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors\", \"name\": \"Deliberate_v6-inpainting.safetensors\"}\n",
236
  " ],\n",
237
  " \"8.Meina-Mix [Anime] [V11] + INP\": [\n",
238
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
@@ -246,8 +246,8 @@
246
  "\n",
247
  "vae_list = {\n",
248
  " \"1.Anime.vae\": [{\"url\": \"https://civitai.com/api/download/models/311162\", \"name\": \"vae-ft-mse-840000-ema-pruned.vae.safetensors\"}],\n",
249
- " \"2.Anything.vae\": [{\"url\": \"https://civitai.com/api/download/models/119279\", \"name\": \"Anything.vae.safetensors\"}],\n",
250
- " \"3.Blessed2.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/blessed_vae/resolve/main/blessed2.vae.pt\", \"name\": \"Blessed2.vae.safetensors\"}],\n",
251
  " \"4.ClearVae.vae\": [{\"url\": \"https://civitai.com/api/download/models/88156\", \"name\": \"ClearVae_23.vae.safetensors\"}],\n",
252
  " \"5.WD.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors\", \"name\": \"WD.vae.safetensors\"}]\n",
253
  "}\n",
 
208
  "print(\"📦 Скачивание моделей и прочего...\", end='')\n",
209
  "model_list = {\n",
210
  " \"1.Anime (by XpucT) + INP\": [\n",
211
+ " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_V2.safetensors\"},\n",
212
+ " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_V2-inpainting.safetensors\"}\n",
213
  " ],\n",
214
  " \"2.BluMix [Anime] [V7] + INP\": [\n",
215
+ " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_V7.safetensors\"},\n",
216
+ " {\"url\": \"https://civitai.com/api/download/models/363850\", \"name\": \"BluMix_V7-inpainting.safetensors\"}\n",
217
  " ],\n",
218
  " \"3.Cetus-Mix [Anime] [V4] + INP\": [\n",
219
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
220
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
221
  " ],\n",
222
  " \"4.Counterfeit [Anime] [V3] + INP\": [\n",
223
+ " {\"url\": \"https://huggingface.co/gsdf/Counterfeit-V3.0/resolve/main/Counterfeit-V3.0_fix_fp16.safetensors\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
224
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
225
  " ],\n",
226
  " \"5.CuteColor [Anime] [V3]\": [\n",
 
231
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
232
  " ],\n",
233
  " \"7.Deliberate [Realism] [V6] + INP\": [\n",
234
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors\", \"name\": \"Deliberate_V6.safetensors\"},\n",
235
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors\", \"name\": \"Deliberate_V6-inpainting.safetensors\"}\n",
236
  " ],\n",
237
  " \"8.Meina-Mix [Anime] [V11] + INP\": [\n",
238
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
 
246
  "\n",
247
  "vae_list = {\n",
248
  " \"1.Anime.vae\": [{\"url\": \"https://civitai.com/api/download/models/311162\", \"name\": \"vae-ft-mse-840000-ema-pruned.vae.safetensors\"}],\n",
249
+ " \"2.Anything.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/any.vae.safetensors\", \"name\": \"Anything.vae.safetensors\"}],\n",
250
+ " \"3.Blessed2.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/blessed2.vae.safetensors\", \"name\": \"Blessed2.vae.safetensors\"}],\n",
251
  " \"4.ClearVae.vae\": [{\"url\": \"https://civitai.com/api/download/models/88156\", \"name\": \"ClearVae_23.vae.safetensors\"}],\n",
252
  " \"5.WD.vae\": [{\"url\": \"https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors\", \"name\": \"WD.vae.safetensors\"}]\n",
253
  "}\n",
files_cells/python/en/auto-cleaner_en.py DELETED
@@ -1,329 +0,0 @@
1
- ##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##
2
-
3
- import os
4
- import time
5
- import ipywidgets as widgets
6
- from ipywidgets import Label, Button, VBox, HBox
7
- from IPython.display import display, HTML, Javascript
8
-
9
-
10
- # ================= DETECT ENV =================
11
- def detect_environment():
12
- free_plan = (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
13
- environments = {
14
- 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
15
- 'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content")
16
- }
17
-
18
- for env_var, (environment, path) in environments.items():
19
- if env_var in os.environ:
20
- return environment, path, free_plan
21
-
22
- env, root_path, free_plan = detect_environment()
23
- webui_path = f"{root_path}/sdw"
24
- # ----------------------------------------------
25
-
26
-
27
- # ==================== CSS ====================
28
- CSS = """
29
- <style>
30
- /* General Styles */
31
-
32
- hr {
33
- border-color: grey;
34
- background-color: grey;
35
- opacity: 0.25;
36
- }
37
-
38
- .instruction_AC {
39
- font-family: cursive;
40
- font-size: 18px;
41
- color: grey;
42
- user-select: none;
43
- cursor: default;
44
- }
45
-
46
-
47
- /* Container style */
48
-
49
- .container_AC {
50
- position: relative;
51
- background-color: #232323;
52
- width: 800px;
53
- height: auto;
54
- padding: 15px;
55
- border-radius: 15px;
56
- box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
57
- margin-bottom: 5px;
58
- overflow: visible;
59
- }
60
-
61
- .container_AC::before {
62
- position: absolute;
63
- top: 5px;
64
- right: 10px;
65
- content: "AutoCleanerV3.6";
66
- font-weight: bold;
67
- font-size: 24px;
68
- color: rgba(0, 0, 0, 0.2);
69
- }
70
-
71
- .container_AC::after {
72
- position: absolute;
73
- top: 30px;
74
- right: 10px;
75
- content: "ANXETY";
76
- font-weight: bold;
77
- font-size: 18px;
78
- color: rgba(0, 0, 0, 0.2);
79
- }
80
-
81
- .custom-select-multiple_AC select {
82
- padding: 10px;
83
- font-family: cursive;
84
- border: 1px solid #262626 !important;
85
- border-radius: 10px;
86
- color: white;
87
- background-color: #1c1c1c;
88
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
89
- }
90
-
91
- .output_AC {
92
- padding: 10px;
93
- height: auto;
94
- border: 1px solid #262626;
95
- border-radius: 10px;
96
- background-color: #1c1c1c;
97
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
98
- width: auto;
99
- box-sizing: border-box;
100
- }
101
-
102
- .output_message_AC {
103
- font-family: cursive;
104
- color: white !important;
105
- font-size: 14px;
106
- user-select: none;
107
- cursor: default
108
- }
109
-
110
-
111
- .storage_info_AC {
112
- padding: 5px 20px;
113
- height: auto;
114
- border: 1px solid #262626;
115
- border-radius: 10px;
116
- background-color: #1c1c1c;
117
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
118
- width: auto;
119
- font-family: cursive;
120
- color: #B2B2B2 !important;
121
- font-size: 14px;
122
- user-select: none;
123
- cursor: default
124
- }
125
-
126
-
127
- /* Button and storage info layout */
128
- .lower_information_panel_AC {
129
- display: flex;
130
- align-items: center;
131
- justify-content: space-between;
132
- }
133
-
134
-
135
- /* Button style */
136
-
137
- .button_AC {
138
- width: auto;
139
- font-family: cursive;
140
- color: white !important;
141
- font-size: 14px;
142
- font-weight: bold;
143
- height: 35px;
144
- border-radius: 15px;
145
- background-image: radial-gradient(circle at top left, purple 10%, violet 90%);
146
- background-size: 200% 200%;
147
- background-position: left bottom;
148
- transition: background 0.5s ease-in-out, transform 0.3s ease;
149
- }
150
-
151
- .button_AC:hover {
152
- cursor: pointer;
153
- background-size: 200% 200%;
154
- background-position: right bottom;
155
- transform: translateY(1px);
156
- }
157
-
158
- .button_execute_AC:hover {
159
- background-image: radial-gradient(circle at top left, purple 10%, #93ac47 90%);
160
- }
161
-
162
- .button_clear_AC:hover {
163
- background-image: radial-gradient(circle at top left, purple 10%, #fc3468 90%);
164
- }
165
-
166
- .button_execute_AC:active,
167
- .button_clear_AC:active {
168
- filter: brightness(0.75);
169
- }
170
-
171
- .jupyter-widgets.lm-Widget:focus {
172
- outline: none;
173
- }
174
-
175
-
176
- /* Animation of elements */
177
-
178
- /* Emergence */
179
- .container_AC {
180
- animation-name: slideInTopBlur;
181
- animation-duration: 0.7s;
182
- animation-fill-mode: forwards;
183
- }
184
-
185
- @keyframes slideInTopBlur {
186
- 0% {
187
- transform: translate3d(0, 50%, 0) scale(0.85) rotate3d(1, 0, 0, -85deg);
188
- filter: blur(5px) grayscale(1) brightness(0.5);
189
- opacity: 0;
190
- }
191
- 100% {
192
- transform: translate3d(0, 0, 0) scale(1) rotate3d(1, 0, 0, 0deg);
193
- filter: blur(0) grayscale(0) brightness(1);
194
- opacity: 1;
195
- }
196
- }
197
-
198
- /* Leaving */
199
- .container_AC.hide {
200
- animation-name: slideOutTopBlur;
201
- animation-duration: 0.5s;
202
- animation-fill-mode: forwards;
203
- }
204
-
205
- @keyframes slideOutTopBlur {
206
- 0% {
207
- transform: translate3d(0, 0, 0) scale(1);
208
- filter: blur(0) grayscale(0) brightness(1);
209
- opacity: 1;
210
- }
211
- 100% {
212
- transform: translate3d(0, -100%, 0);
213
- filter: blur(5px) grayscale(1) brightness(0);
214
- opacity: 0;
215
- }
216
- }
217
- </style>
218
- """
219
-
220
- display(HTML(CSS))
221
- # ==================== CSS ====================
222
-
223
-
224
- # ================ AutoCleaner function ================
225
- directories = {
226
- "Images": f"{webui_path}/output",
227
- "Models": f"{webui_path}/models/Stable-diffusion/",
228
- "Vae": f"{webui_path}/models/VAE/",
229
- "LoRa": f"{webui_path}/models/Lora/",
230
- "ControlNet Models": f"{webui_path}/models/ControlNet/"
231
- }
232
-
233
- """ functions """
234
- def clean_directory(directory):
235
- deleted_files = 0
236
- image_dir = directories['Images']
237
-
238
- for root, dirs, files in os.walk(directory):
239
- for file in files:
240
- file_path = os.path.join(root, file)
241
-
242
- if file.endswith(".txt"):
243
- continue
244
- if file.endswith((".safetensors", ".pt")) or root == image_dir: # fix for image counter
245
- deleted_files += 1
246
-
247
- os.remove(file_path)
248
- return deleted_files
249
-
250
- def update_memory_info():
251
- disk_space = psutil.disk_usage(os.getcwd())
252
- total = disk_space.total / (1024 ** 3)
253
- used = disk_space.used / (1024 ** 3)
254
- free = disk_space.free / (1024 ** 3)
255
-
256
- storage_info.value = f'''
257
- <div class="storage_info_AC">Total storage: {total:.2f} GB <span style="color: #555">|</span> Used: {used:.2f} GB <span style="color: #555">|</span> Free: {free:.2f} GB</div>
258
- '''
259
-
260
- def on_execute_button_press(button):
261
- selected_cleaners = auto_cleaner_widget.value
262
- deleted_files_dict = {}
263
-
264
- for option in selected_cleaners:
265
- if option in directories:
266
- deleted_files_dict[option] = clean_directory(directories[option])
267
-
268
- output.clear_output()
269
-
270
- with output:
271
- for message in generate_messages(deleted_files_dict):
272
- message_widget = HTML(f'<p class="output_message_AC">{message}</p>')
273
- display(message_widget)
274
-
275
- update_memory_info()
276
-
277
- def on_clear_button_press(button):
278
- container.add_class("hide")
279
- time.sleep(0.5)
280
- widgets.Widget.close_all()
281
-
282
- def generate_messages(deleted_files_dict):
283
- messages = []
284
- word_variants = {
285
- "Images": "Images",
286
- "Models": "Models",
287
- "Vae": "Vae",
288
- "LoRa": "LoRa",
289
- "ControlNet Models": "ControlNet Models"
290
- }
291
- for key, value in deleted_files_dict.items():
292
- object_word = word_variants.get(key)
293
- messages.append(f"Deleted {value} {object_word}")
294
- return messages
295
- # ================ AutoCleaner function ================
296
-
297
-
298
- # --- storage memory ---
299
- import psutil
300
- disk_space = psutil.disk_usage(os.getcwd())
301
- total = disk_space.total / (1024 ** 3)
302
- used = disk_space.used / (1024 ** 3)
303
- free = disk_space.free / (1024 ** 3)
304
-
305
-
306
- # UI Code
307
- AutoCleaner_options = AutoCleaner_options = list(directories.keys())
308
- instruction_label = widgets.HTML('''
309
- <span class="instruction_AC">Use <span style="color: #B2B2B2;">ctrl</span> or <span style="color: #B2B2B2;">shift</span> for multiple selections.</span>
310
- ''')
311
- auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width='auto')).add_class("custom-select-multiple_AC")
312
- output = widgets.Output().add_class("output_AC")
313
- # ---
314
- execute_button = Button(description='Execute Cleaning').add_class("button_execute_AC").add_class("button_AC")
315
- execute_button.on_click(on_execute_button_press)
316
- clear_button = Button(description='Hide Widget').add_class("button_clear_AC").add_class("button_AC")
317
- clear_button.on_click(on_clear_button_press)
318
- # ---
319
- storage_info = widgets.HTML(f'''
320
- <div class="storage_info_AC">Total storage: {total:.2f} GB <span style="color: #555">|</span> Used: {used:.2f} GB <span style="color: #555">|</span> Free: {free:.2f} GB</div>
321
- ''')
322
- # ---
323
- buttons = widgets.HBox([execute_button, clear_button])
324
- lower_information_panel = widgets.HBox([buttons, storage_info]).add_class("lower_information_panel_AC")
325
-
326
- container = VBox([instruction_label, widgets.HTML('<hr>'), auto_cleaner_widget, output, widgets.HTML('<hr>'), lower_information_panel]).add_class("container_AC")
327
-
328
- display(container)
329
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files_cells/python/en/downloading_en.py CHANGED
@@ -198,19 +198,19 @@ if commit_hash:
198
  print("📦 Downloading models and stuff...", end='')
199
  model_list = {
200
  "1.Anime (by XpucT) + INP": [
201
- {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_v2.safetensors"},
202
- {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_v2-inpainting.safetensors"}
203
  ],
204
  "2.BluMix [Anime] [V7] + INP": [
205
- {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_v7.safetensors"},
206
- {"url": "https://civitai.com/api/download/models/363850", "name": "BluMix_v7-inpainting.safetensors"}
207
  ],
208
  "3.Cetus-Mix [Anime] [V4] + INP": [
209
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
210
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
211
  ],
212
  "4.Counterfeit [Anime] [V3] + INP": [
213
- {"url": "https://civitai.com/api/download/models/125050", "name": "Counterfeit_V3.safetensors"},
214
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
215
  ],
216
  "5.CuteColor [Anime] [V3]": [
@@ -221,8 +221,8 @@ model_list = {
221
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
222
  ],
223
  "7.Deliberate [Realism] [V6] + INP": [
224
- {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors", "name": "Deliberate_v6.safetensors"},
225
- {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors", "name": "Deliberate_v6-inpainting.safetensors"}
226
  ],
227
  "8.Meina-Mix [Anime] [V11] + INP": [
228
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
@@ -236,8 +236,8 @@ model_list = {
236
 
237
  vae_list = {
238
  "1.Anime.vae": [{"url": "https://civitai.com/api/download/models/311162", "name": "vae-ft-mse-840000-ema-pruned.vae.safetensors"}],
239
- "2.Anything.vae": [{"url": "https://civitai.com/api/download/models/119279", "name": "Anything.vae.safetensors"}],
240
- "3.Blessed2.vae": [{"url": "https://huggingface.co/NoCrypt/blessed_vae/resolve/main/blessed2.vae.pt", "name": "Blessed2.vae.safetensors"}],
241
  "4.ClearVae.vae": [{"url": "https://civitai.com/api/download/models/88156", "name": "ClearVae_23.vae.safetensors"}],
242
  "5.WD.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors", "name": "WD.vae.safetensors"}]
243
  }
 
198
  print("📦 Downloading models and stuff...", end='')
199
  model_list = {
200
  "1.Anime (by XpucT) + INP": [
201
+ {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_V2.safetensors"},
202
+ {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_V2-inpainting.safetensors"}
203
  ],
204
  "2.BluMix [Anime] [V7] + INP": [
205
+ {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_V7.safetensors"},
206
+ {"url": "https://civitai.com/api/download/models/363850", "name": "BluMix_V7-inpainting.safetensors"}
207
  ],
208
  "3.Cetus-Mix [Anime] [V4] + INP": [
209
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
210
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
211
  ],
212
  "4.Counterfeit [Anime] [V3] + INP": [
213
+ {"url": "https://huggingface.co/gsdf/Counterfeit-V3.0/resolve/main/Counterfeit-V3.0_fix_fp16.safetensors", "name": "Counterfeit_V3.safetensors"},
214
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
215
  ],
216
  "5.CuteColor [Anime] [V3]": [
 
221
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
222
  ],
223
  "7.Deliberate [Realism] [V6] + INP": [
224
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors", "name": "Deliberate_V6.safetensors"},
225
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors", "name": "Deliberate_V6-inpainting.safetensors"}
226
  ],
227
  "8.Meina-Mix [Anime] [V11] + INP": [
228
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
 
236
 
237
  vae_list = {
238
  "1.Anime.vae": [{"url": "https://civitai.com/api/download/models/311162", "name": "vae-ft-mse-840000-ema-pruned.vae.safetensors"}],
239
+ "2.Anything.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/any.vae.safetensors", "name": "Anything.vae.safetensors"}],
240
+ "3.Blessed2.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/blessed2.vae.safetensors", "name": "Blessed2.vae.safetensors"}],
241
  "4.ClearVae.vae": [{"url": "https://civitai.com/api/download/models/88156", "name": "ClearVae_23.vae.safetensors"}],
242
  "5.WD.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors", "name": "WD.vae.safetensors"}]
243
  }
files_cells/python/en/main_dl_file_en.py DELETED
@@ -1,47 +0,0 @@
1
- import os
2
- from IPython.utils import capture
3
-
4
- def check_colab_subscription():
5
- return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
6
- free_plan = check_colab_subscription()
7
-
8
- def detect_environment():
9
- environments = {
10
- 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
11
- 'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
12
- 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
13
- }
14
-
15
- for env_var, (environment, path) in environments.items():
16
- if env_var in os.environ:
17
- return environment, path
18
-
19
- print("\033[31mError: an unsupported runtime environment was detected.\n\033[34mSupported environments:\033[0m Google Colab, Kaggle, Sagemaker Studio Lab")
20
- return None, None
21
-
22
- env, root_path = detect_environment()
23
- if env and root_path:
24
- webui_path = f"{root_path}/sdw"
25
-
26
- print(f"Runtime environment: \033[33m{env}\033[0m")
27
- # Colab Plan
28
- if env == "Google Colab":
29
- print(f"Colab Pro subscription: \033[34m{not free_plan}\033[0m")
30
- print(f"File location: \033[32m{root_path}\033[0m")
31
-
32
- print("Please wait for the files to download.... 👀", end='')
33
- with capture.capture_output() as cap:
34
- files = [f'widgets_{lang}.py', f'downloading_{lang}.py', f'launch_{lang}.py', f'auto-cleaner_{lang}.py']
35
- folder_path = f'{root_path}/file_cell'
36
-
37
- if os.path.exists(folder_path):
38
- get_ipython().system('rm -rf {folder_path}')
39
-
40
- get_ipython().system('mkdir -p {folder_path}')
41
-
42
- for file in files:
43
- get_ipython().system('wget -q https://huggingface.co/NagisaNao/fast_repo/resolve/main/files_cells/python/{lang}/{file} -O {folder_path}/{file}')
44
-
45
- del cap
46
- print("\rDone! Now you can run the cells below. ☄️" + " "*30)
47
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files_cells/python/ru/auto-cleaner_ru.py DELETED
@@ -1,329 +0,0 @@
1
- ##~ AutoCleaner V3.6 CODE | BY: ANXETY ~##
2
-
3
- import os
4
- import time
5
- import ipywidgets as widgets
6
- from ipywidgets import Label, Button, VBox, HBox
7
- from IPython.display import display, HTML
8
-
9
-
10
- # ================= DETECT ENV =================
11
- def detect_environment():
12
- free_plan = (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
13
- environments = {
14
- 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
15
- 'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content")
16
- }
17
-
18
- for env_var, (environment, path) in environments.items():
19
- if env_var in os.environ:
20
- return environment, path, free_plan
21
-
22
- env, root_path, free_plan = detect_environment()
23
- webui_path = f"{root_path}/sdw"
24
- # ----------------------------------------------
25
-
26
-
27
- # ==================== CSS ====================
28
- CSS_AC = """
29
- <style>
30
- /* General Styles */
31
-
32
- hr {
33
- border-color: grey;
34
- background-color: grey;
35
- opacity: 0.25;
36
- }
37
-
38
- .instruction_AC {
39
- font-family: cursive;
40
- font-size: 18px;
41
- color: grey;
42
- user-select: none;
43
- cursor: default;
44
- }
45
-
46
-
47
- /* Container style */
48
-
49
- .container_AC {
50
- position: relative;
51
- background-color: #232323;
52
- width: 800px;
53
- height: auto;
54
- padding: 15px;
55
- border-radius: 15px;
56
- box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
57
- margin-bottom: 5px;
58
- overflow: visible;
59
- }
60
-
61
- .container_AC::before {
62
- position: absolute;
63
- top: 5px;
64
- right: 10px;
65
- content: "AutoCleanerV3.6";
66
- font-weight: bold;
67
- font-size: 24px;
68
- color: rgba(0, 0, 0, 0.2);
69
- }
70
-
71
- .container_AC::after {
72
- position: absolute;
73
- top: 30px;
74
- right: 10px;
75
- content: "ANXETY";
76
- font-weight: bold;
77
- font-size: 18px;
78
- color: rgba(0, 0, 0, 0.2);
79
- }
80
-
81
- .custom-select-multiple_AC select {
82
- padding: 10px;
83
- font-family: cursive;
84
- border: 1px solid #262626 !important;
85
- border-radius: 10px;
86
- color: white;
87
- background-color: #1c1c1c;
88
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
89
- }
90
-
91
- .output_AC {
92
- padding: 10px;
93
- height: auto;
94
- border: 1px solid #262626;
95
- border-radius: 10px;
96
- background-color: #1c1c1c;
97
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
98
- width: auto;
99
- box-sizing: border-box;
100
- }
101
-
102
- .output_message_AC {
103
- font-family: cursive;
104
- color: white !important;
105
- font-size: 14px;
106
- user-select: none;
107
- cursor: default
108
- }
109
-
110
-
111
- .storage_info_AC {
112
- padding: 5px 20px;
113
- height: auto;
114
- border: 1px solid #262626;
115
- border-radius: 10px;
116
- background-color: #1c1c1c;
117
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
118
- width: auto;
119
- font-family: cursive;
120
- color: #B2B2B2 !important;
121
- font-size: 14px;
122
- user-select: none;
123
- cursor: default
124
- }
125
-
126
-
127
- /* Button and storage info layout */
128
- .lower_information_panel_AC {
129
- display: flex;
130
- align-items: center;
131
- justify-content: space-between;
132
- }
133
-
134
-
135
- /* Button style */
136
-
137
- .button_AC {
138
- width: auto;
139
- font-family: cursive;
140
- color: white !important;
141
- font-size: 14px;
142
- font-weight: bold;
143
- height: 35px;
144
- border-radius: 15px;
145
- background-image: radial-gradient(circle at top left, purple 10%, violet 90%);
146
- background-size: 200% 200%;
147
- background-position: left bottom;
148
- transition: background 0.5s ease-in-out, transform 0.3s ease;
149
- }
150
-
151
- .button_AC:hover {
152
- cursor: pointer;
153
- background-size: 200% 200%;
154
- background-position: right bottom;
155
- transform: translateY(1px);
156
- }
157
-
158
- .button_execute_AC:hover {
159
- background-image: radial-gradient(circle at top left, purple 10%, #93ac47 90%);
160
- }
161
-
162
- .button_clear_AC:hover {
163
- background-image: radial-gradient(circle at top left, purple 10%, #fc3468 90%);
164
- }
165
-
166
- .button_execute_AC:active,
167
- .button_clear_AC:active {
168
- filter: brightness(0.75);
169
- }
170
-
171
- .jupyter-widgets.lm-Widget:focus {
172
- outline: none;
173
- }
174
-
175
-
176
- /* Animation of elements */
177
-
178
- /* Emergence */
179
- .container_AC {
180
- animation-name: slideInTopBlur;
181
- animation-duration: 0.7s;
182
- animation-fill-mode: forwards;
183
- }
184
-
185
- @keyframes slideInTopBlur {
186
- 0% {
187
- transform: translate3d(0, 50%, 0) scale(0.85) rotate3d(1, 0, 0, -85deg);
188
- filter: blur(5px) grayscale(1) brightness(0.5);
189
- opacity: 0;
190
- }
191
- 100% {
192
- transform: translate3d(0, 0, 0) scale(1) rotate3d(1, 0, 0, 0deg);
193
- filter: blur(0) grayscale(0) brightness(1);
194
- opacity: 1;
195
- }
196
- }
197
-
198
- /* Leaving */
199
- .container_AC.hide {
200
- animation-name: slideOutTopBlur;
201
- animation-duration: 0.3s;
202
- animation-fill-mode: forwards;
203
- }
204
-
205
- @keyframes slideOutTopBlur {
206
- 0% {
207
- transform: translate3d(0, 0, 0) scale(1);
208
- filter: blur(0) grayscale(0) brightness(1);
209
- opacity: 1;
210
- }
211
- 100% {
212
- transform: translate3d(0, -100%, 0);
213
- filter: blur(5px) grayscale(1) brightness(0);
214
- opacity: 0;
215
- }
216
- }
217
- </style>
218
- """
219
-
220
- display(HTML(CSS_AC))
221
- # ==================== CSS ====================
222
-
223
-
224
- # ================ AutoCleaner function ================
225
- directories = {
226
- "Изображения": f"{webui_path}/output",
227
- "Модели": f"{webui_path}/models/Stable-diffusion/",
228
- "Vae": f"{webui_path}/models/VAE/",
229
- "LoRa": f"{webui_path}/models/Lora/",
230
- "ControlNet Модели": f"{webui_path}/models/ControlNet/"
231
- }
232
-
233
- """ functions """
234
- def clean_directory(directory):
235
- deleted_files = 0
236
- image_dir = directories['Изображения']
237
-
238
- for root, dirs, files in os.walk(directory):
239
- for file in files:
240
- file_path = os.path.join(root, file)
241
-
242
- if file.endswith(".txt"):
243
- continue
244
- if file.endswith((".safetensors", ".pt")) or root == image_dir: # fix for image counter
245
- deleted_files += 1
246
-
247
- os.remove(file_path)
248
- return deleted_files
249
-
250
- def update_memory_info():
251
- disk_space = psutil.disk_usage(os.getcwd())
252
- total = disk_space.total / (1024 ** 3)
253
- used = disk_space.used / (1024 ** 3)
254
- free = disk_space.free / (1024 ** 3)
255
-
256
- storage_info.value = f'''
257
- <div class="storage_info_AC">Всего: {total:.2f} GB <span style="color: #555">|</span> Используется: {used:.2f} GB <span style="color: #555">|</span> Свободно: {free:.2f} GB</div>
258
- '''
259
-
260
- def on_execute_button_press(button):
261
- selected_cleaners = auto_cleaner_widget.value
262
- deleted_files_dict = {}
263
-
264
- for option in selected_cleaners:
265
- if option in directories:
266
- deleted_files_dict[option] = clean_directory(directories[option])
267
-
268
- output.clear_output()
269
-
270
- with output:
271
- for message in generate_messages(deleted_files_dict):
272
- message_widget = HTML(f'<p class="output_message_AC">{message}</p>')
273
- display(message_widget)
274
-
275
- update_memory_info()
276
-
277
- def on_clear_button_press(button):
278
- container.add_class("hide")
279
- time.sleep(0.5)
280
- widgets.Widget.close_all()
281
-
282
- def generate_messages(deleted_files_dict):
283
- messages = []
284
- word_variants = {
285
- "Изображения": "Изображений",
286
- "Модели": "Моделей",
287
- "Vae": "Vae",
288
- "LoRa": "LoRa",
289
- "ControlNet Модели": "ControlNet Моделей"
290
- }
291
- for key, value in deleted_files_dict.items():
292
- object_word = word_variants.get(key)
293
- messages.append(f"Удалено {value} {object_word}")
294
- return messages
295
- # ================ AutoCleaner function ================
296
-
297
-
298
- # --- storage memory ---
299
- import psutil
300
- disk_space = psutil.disk_usage(os.getcwd())
301
- total = disk_space.total / (1024 ** 3)
302
- used = disk_space.used / (1024 ** 3)
303
- free = disk_space.free / (1024 ** 3)
304
-
305
-
306
- # UI Code
307
- AutoCleaner_options = AutoCleaner_options = list(directories.keys())
308
- instruction_label = widgets.HTML('''
309
- <span class="instruction_AC">Используйте <span style="color: #B2B2B2;">ctrl</span> или <span style="color: #B2B2B2;">shift</span> для множественного выбора.</span>
310
- ''')
311
- auto_cleaner_widget = widgets.SelectMultiple(options=AutoCleaner_options, layout=widgets.Layout(width="auto")).add_class("custom-select-multiple_AC")
312
- output = widgets.Output().add_class("output_AC")
313
- # ---
314
- execute_button = Button(description='Выполнить Очистку').add_class("button_execute_AC").add_class("button_AC")
315
- execute_button.on_click(on_execute_button_press)
316
- clear_button = Button(description='Скрыть Виджет').add_class("button_clear_AC").add_class("button_AC")
317
- clear_button.on_click(on_clear_button_press)
318
- # ---
319
- storage_info = widgets.HTML(f'''
320
- <div class="storage_info_AC">Всего: {total:.2f} GB <span style="color: #555">|</span> Используется: {used:.2f} GB <span style="color: #555">|</span> Свободно: {free:.2f} GB</div>
321
- ''')
322
- # ---
323
- buttons = widgets.HBox([execute_button, clear_button])
324
- lower_information_panel = widgets.HBox([buttons, storage_info]).add_class("lower_information_panel_AC")
325
-
326
- container = VBox([instruction_label, widgets.HTML('<hr>'), auto_cleaner_widget, output, widgets.HTML('<hr>'), lower_information_panel]).add_class("container_AC")
327
-
328
- display(container)
329
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files_cells/python/ru/downloading_ru.py CHANGED
@@ -198,19 +198,19 @@ if commit_hash:
198
  print("📦 Скачивание моделей и прочего...", end='')
199
  model_list = {
200
  "1.Anime (by XpucT) + INP": [
201
- {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_v2.safetensors"},
202
- {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_v2-inpainting.safetensors"}
203
  ],
204
  "2.BluMix [Anime] [V7] + INP": [
205
- {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_v7.safetensors"},
206
- {"url": "https://civitai.com/api/download/models/363850", "name": "BluMix_v7-inpainting.safetensors"}
207
  ],
208
  "3.Cetus-Mix [Anime] [V4] + INP": [
209
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
210
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
211
  ],
212
  "4.Counterfeit [Anime] [V3] + INP": [
213
- {"url": "https://civitai.com/api/download/models/125050", "name": "Counterfeit_V3.safetensors"},
214
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
215
  ],
216
  "5.CuteColor [Anime] [V3]": [
@@ -221,8 +221,8 @@ model_list = {
221
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
222
  ],
223
  "7.Deliberate [Realism] [V6] + INP": [
224
- {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors", "name": "Deliberate_v6.safetensors"},
225
- {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors", "name": "Deliberate_v6-inpainting.safetensors"}
226
  ],
227
  "8.Meina-Mix [Anime] [V11] + INP": [
228
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
@@ -236,8 +236,8 @@ model_list = {
236
 
237
  vae_list = {
238
  "1.Anime.vae": [{"url": "https://civitai.com/api/download/models/311162", "name": "vae-ft-mse-840000-ema-pruned.vae.safetensors"}],
239
- "2.Anything.vae": [{"url": "https://civitai.com/api/download/models/119279", "name": "Anything.vae.safetensors"}],
240
- "3.Blessed2.vae": [{"url": "https://huggingface.co/NoCrypt/blessed_vae/resolve/main/blessed2.vae.pt", "name": "Blessed2.vae.safetensors"}],
241
  "4.ClearVae.vae": [{"url": "https://civitai.com/api/download/models/88156", "name": "ClearVae_23.vae.safetensors"}],
242
  "5.WD.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors", "name": "WD.vae.safetensors"}]
243
  }
 
198
  print("📦 Скачивание моделей и прочего...", end='')
199
  model_list = {
200
  "1.Anime (by XpucT) + INP": [
201
+ {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_V2.safetensors"},
202
+ {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_V2-inpainting.safetensors"}
203
  ],
204
  "2.BluMix [Anime] [V7] + INP": [
205
+ {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_V7.safetensors"},
206
+ {"url": "https://civitai.com/api/download/models/363850", "name": "BluMix_V7-inpainting.safetensors"}
207
  ],
208
  "3.Cetus-Mix [Anime] [V4] + INP": [
209
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
210
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
211
  ],
212
  "4.Counterfeit [Anime] [V3] + INP": [
213
+ {"url": "https://huggingface.co/gsdf/Counterfeit-V3.0/resolve/main/Counterfeit-V3.0_fix_fp16.safetensors", "name": "Counterfeit_V3.safetensors"},
214
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
215
  ],
216
  "5.CuteColor [Anime] [V3]": [
 
221
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
222
  ],
223
  "7.Deliberate [Realism] [V6] + INP": [
224
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors", "name": "Deliberate_V6.safetensors"},
225
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors", "name": "Deliberate_V6-inpainting.safetensors"}
226
  ],
227
  "8.Meina-Mix [Anime] [V11] + INP": [
228
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
 
236
 
237
  vae_list = {
238
  "1.Anime.vae": [{"url": "https://civitai.com/api/download/models/311162", "name": "vae-ft-mse-840000-ema-pruned.vae.safetensors"}],
239
+ "2.Anything.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/any.vae.safetensors", "name": "Anything.vae.safetensors"}],
240
+ "3.Blessed2.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/blessed2.vae.safetensors", "name": "Blessed2.vae.safetensors"}],
241
  "4.ClearVae.vae": [{"url": "https://civitai.com/api/download/models/88156", "name": "ClearVae_23.vae.safetensors"}],
242
  "5.WD.vae": [{"url": "https://huggingface.co/NoCrypt/resources/resolve/main/VAE/wd.vae.safetensors", "name": "WD.vae.safetensors"}]
243
  }
files_cells/special/notebooks/dl_display_results.ipynb DELETED
@@ -1,416 +0,0 @@
1
- {
2
- "nbformat": 4,
3
- "nbformat_minor": 0,
4
- "metadata": {
5
- "colab": {
6
- "provenance": []
7
- },
8
- "kernelspec": {
9
- "name": "python3",
10
- "display_name": "Python 3"
11
- },
12
- "language_info": {
13
- "name": "python"
14
- }
15
- },
16
- "cells": [
17
- {
18
- "cell_type": "code",
19
- "source": [
20
- "##~ Display Download Results Widgets | by: ANXETY ~##\n",
21
- "\n",
22
- "import re\n",
23
- "import os\n",
24
- "import json\n",
25
- "import time\n",
26
- "import ipywidgets as widgets\n",
27
- "from ipywidgets import widgets, Layout, Label, Button, VBox, HBox\n",
28
- "from IPython.display import display, HTML, Javascript, clear_output\n",
29
- "\n",
30
- "\n",
31
- "# ================= DETECT ENV =================\n",
32
- "def detect_environment():\n",
33
- " free_plan = (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)\n",
34
- " environments = {\n",
35
- " 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
36
- " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\")\n",
37
- " }\n",
38
- "\n",
39
- " for env_var, (environment, path) in environments.items():\n",
40
- " if env_var in os.environ:\n",
41
- " return environment, path, free_plan\n",
42
- "\n",
43
- "env, root_path, free_plan = detect_environment()\n",
44
- "webui_path = f\"{root_path}/sdw\"\n",
45
- "# ----------------------------------------------\n",
46
- "\n",
47
- "\n",
48
- "# CONFIG DIR\n",
49
- "models_dir = f\"{webui_path}/models/Stable-diffusion\"\n",
50
- "vaes_dir = f\"{webui_path}/models/VAE\"\n",
51
- "embeddings_dir = f\"{webui_path}/embeddings\"\n",
52
- "loras_dir = f\"{webui_path}/models/Lora\"\n",
53
- "extensions_dir = f\"{webui_path}/extensions\"\n",
54
- "control_dir = f\"{webui_path}/models/ControlNet\"\n",
55
- "adetailer_dir = f\"{webui_path}/models/adetailer\"\n",
56
- "\n",
57
- "\n",
58
- "# ==================== CSS ====================\n",
59
- "CSS = \"\"\"\n",
60
- "<style>\n",
61
- "/* General Styles */\n",
62
- ".header_dl,\n",
63
- ".header_outputs_dl {\n",
64
- " font-family: cursive;\n",
65
- " font-size: 20px;\n",
66
- " font-weight: bold;\n",
67
- " text-align: center;\n",
68
- "}\n",
69
- ".header_dl {\n",
70
- " color: #8b9dc3;\n",
71
- " margin-bottom: 15px;\n",
72
- "}\n",
73
- ".header_outputs_dl {\n",
74
- " color: #0083c0;\n",
75
- " align-self: center;\n",
76
- "}\n",
77
- "\n",
78
- "hr {\n",
79
- " border-color: grey;\n",
80
- " background-color: grey;\n",
81
- " opacity: 0.25;\n",
82
- " width: 1000px;\n",
83
- "}\n",
84
- "\n",
85
- "/* Element text style */\n",
86
- ".widget-html {\n",
87
- " font-family: cursive;\n",
88
- " font-size: 14px;\n",
89
- " color: white !important;\n",
90
- " user-select: none;\n",
91
- "}\n",
92
- "\n",
93
- "\n",
94
- "/* Container style */\n",
95
- ".container_dl {\n",
96
- " position: relative;\n",
97
- " flex-direction: column;\n",
98
- " justify-content: flex-start;\n",
99
- " align-items: center; /* Center horizontally */\n",
100
- " position: relative;\n",
101
- " background-color: #232323;\n",
102
- " width: 1200px;\n",
103
- " height: auto;\n",
104
- " margin: 40px 10px 10px 10px;\n",
105
- " padding: 10px 15px;\n",
106
- " border-radius: 15px;\n",
107
- " box-shadow: 0 0 50px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
108
- " overflow: visible;\n",
109
- " transition: all 0.5s ease-in-out;\n",
110
- "}\n",
111
- ".container_dl::after {\n",
112
- " position: absolute;\n",
113
- " top: 5px;\n",
114
- " right: 10px;\n",
115
- " content: \"ANXETY\";\n",
116
- " font-weight: bold;\n",
117
- " font-size: 24px;\n",
118
- " color: rgba(0, 0, 0, 0.2);\n",
119
- "}\n",
120
- "\n",
121
- ".result_output_dl {\n",
122
- " flex-direction: row;\n",
123
- " /* align-items: flex-start; */\n",
124
- " flex-wrap: wrap;\n",
125
- " overflow: visible;\n",
126
- " box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
127
- " border-radius: 8px;\n",
128
- " background-color: #1f1f1f;\n",
129
- " width: 95%;\n",
130
- " padding: 10px 15px;\n",
131
- "}\n",
132
- "\n",
133
- ".outputs_dl {\n",
134
- " display: flex;\n",
135
- " flex-wrap: wrap;\n",
136
- " background-color: #181818;\n",
137
- " padding: 10px 15px;\n",
138
- " border-radius: 15px;\n",
139
- " box-shadow: 0 0 8px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
140
- " color: #c1c1c1;\n",
141
- " margin: 8px;\n",
142
- " transition: all 0.15s ease;\n",
143
- " flex-grow: 1;\n",
144
- "}\n",
145
- ".outputs_dl:hover {\n",
146
- " /* transform: scale(1.02); */\n",
147
- " background-color: #181718;\n",
148
- "}\n",
149
- "\n",
150
- "/* setting the height of \"outputs\" containers */\n",
151
- ".outputs_dl { max-height: 400px; }\n",
152
- ".extension { height: 300px; }\n",
153
- "\n",
154
- "\n",
155
- "/* Animation of elements */\n",
156
- "\n",
157
- ".container_dl,\n",
158
- ".outputs_dl {\n",
159
- " animation-name: showedResult;\n",
160
- " animation-duration: 1s;\n",
161
- "}\n",
162
- ".items_dl {\n",
163
- " animation-name: showedText;\n",
164
- " animation-duration: 1s;\n",
165
- "}\n",
166
- "\n",
167
- "@keyframes showedResult {\n",
168
- " 0% {\n",
169
- " transform: translate3d(0, 15%, 0) scale(0.98);\n",
170
- " opacity: 0;\n",
171
- " }\n",
172
- " 100% {\n",
173
- " transform: translate3d(0, 0, 0) scale(1);\n",
174
- " opacity: 1;\n",
175
- " }\n",
176
- "}\n",
177
- "\n",
178
- "@keyframes showedText {\n",
179
- " 0% {\n",
180
- " transform: translate3d(-30%, 0, 0);\n",
181
- " opacity: 0;\n",
182
- " }\n",
183
- " 100% {\n",
184
- " transform: translate3d(0, 0, 0);\n",
185
- " opacity: 1;\n",
186
- " }\n",
187
- "}\n",
188
- "</style>\n",
189
- "\"\"\"\n",
190
- "\n",
191
- "display(HTML(CSS))\n",
192
- "# ==================== CSS ====================\n",
193
- "\n",
194
- "\n",
195
- "# ==================== WIDGETS ====================\n",
196
- "# --- global widgets ---\n",
197
- "HR = widgets.HTML('<hr>')\n",
198
- "\n",
199
- "header_widget = widgets.HTML(value='<div class=\"header_dl\">DOWNLOAD RESULTS | v0.2<div>')\n",
200
- "\n",
201
- "# Adding content to \"outputs_widgets_list\"\n",
202
- "def output_container_generator(header, items):\n",
203
- " header_widget = widgets.HTML(value=f'<div class=\"header_outputs_dl\">{header} ➤</div>')\n",
204
- " content = [widgets.HTML(value=f'<div class=\"items_dl\">{item}</div>') for item in items]\n",
205
- " container_widget = widgets.VBox([header_widget] + content).add_class(\"outputs_dl\")\n",
206
- " return container_widget\n",
207
- "\n",
208
- "\n",
209
- "# Models\n",
210
- "models_list = [file for file in os.listdir(models_dir) if not file.endswith('.txt')]\n",
211
- "models_widget = output_container_generator('Models', models_list).add_class(\"model\")\n",
212
- "# Vaes\n",
213
- "vaes_list = [file for file in os.listdir(vaes_dir) if not file.endswith('.txt')]\n",
214
- "vaes_widget = output_container_generator('VAEs', vaes_list).add_class(\"vae\")\n",
215
- "# Embeddings\n",
216
- "embeddings_list = [file for file in os.listdir(embeddings_dir) if not file.endswith('.txt') and not os.path.isdir(os.path.join(embeddings_dir, file))]\n",
217
- "embeddings_widget = output_container_generator('Embeddings', embeddings_list).add_class(\"embedding\")\n",
218
- "# LoRAs\n",
219
- "loras_list = [file for file in os.listdir(loras_dir) if not file.endswith('.txt')]\n",
220
- "loras_widget = output_container_generator('LoRAs', loras_list).add_class(\"lora\")\n",
221
- "# Extensions\n",
222
- "extensions_list = [folder for folder in os.listdir(extensions_dir) if os.path.isdir(os.path.join(extensions_dir, folder))]\n",
223
- "extensions_widget = output_container_generator('Extensions', extensions_list).add_class(\"extension\")\n",
224
- "# ControlNet\n",
225
- "# controlnets_list = [file for file in os.listdir(control_dir) if not file.endswith(('.txt', '.yaml'))]\n",
226
- "filter_name = re.compile(r'^[^_]*_[^_]*_[^_]*_(.*)_fp16\\.safetensors$')\n",
227
- "controlnets_list = [\n",
228
- " filter_name.match(file).group(1) if filter_name.match(file) else file\n",
229
- " for file in os.listdir(control_dir)\n",
230
- " if not file.endswith(('.txt', '.yaml'))\n",
231
- "]\n",
232
- "controlnets_widget = output_container_generator('ControlNets', controlnets_list).add_class(\"controlnet\")\n",
233
- "\n",
234
- "\n",
235
- "## Sorting and Output\n",
236
- "widgets_dict = {\n",
237
- " models_widget: models_list,\n",
238
- " vaes_widget: vaes_list,\n",
239
- " embeddings_widget: embeddings_list,\n",
240
- " loras_widget: loras_list,\n",
241
- " extensions_widget: extensions_list,\n",
242
- " controlnets_widget: controlnets_list\n",
243
- "}\n",
244
- "outputs_widgets_list = [widget for widget, widget_list in widgets_dict.items() if widget_list]\n",
245
- "result_output_widget = widgets.HBox(outputs_widgets_list).add_class(\"result_output_dl\")\n",
246
- "\n",
247
- "container_widget = widgets.VBox([header_widget, HR, result_output_widget, HR]).add_class(\"container_dl\")\n",
248
- "\n",
249
- "display(container_widget)"
250
- ],
251
- "metadata": {
252
- "id": "2lJmbqrs3Mu8",
253
- "colab": {
254
- "base_uri": "https://localhost:8080/",
255
- "height": 211
256
- },
257
- "outputId": "9574e5d7-033a-46e1-99f5-3ca7f7aa456c"
258
- },
259
- "execution_count": 1,
260
- "outputs": [
261
- {
262
- "output_type": "display_data",
263
- "data": {
264
- "text/plain": [
265
- "<IPython.core.display.HTML object>"
266
- ],
267
- "text/html": [
268
- "\n",
269
- "<style>\n",
270
- "/* General Styles */\n",
271
- ".header,\n",
272
- ".header_outputs {\n",
273
- " font-family: cursive;\n",
274
- " font-size: 20px;\n",
275
- " font-weight: bold;\n",
276
- " text-align: center;\n",
277
- "}\n",
278
- ".header {\n",
279
- " color: #8b9dc3;\n",
280
- " margin-bottom: 15px;\n",
281
- "}\n",
282
- ".header_outputs {\n",
283
- " color: #0083c0;\n",
284
- " align-self: center;\n",
285
- "}\n",
286
- "\n",
287
- "hr {\n",
288
- " border-color: grey;\n",
289
- " background-color: grey;\n",
290
- " opacity: 0.25;\n",
291
- " width: 1000px;\n",
292
- "}\n",
293
- "\n",
294
- "/* Element text style */\n",
295
- ".widget-html {\n",
296
- " font-family: cursive;\n",
297
- " font-size: 14px;\n",
298
- " color: white !important;\n",
299
- " user-select: none;\n",
300
- "}\n",
301
- "\n",
302
- "\n",
303
- "/* Container style */\n",
304
- ".container_dl {\n",
305
- " position: relative;\n",
306
- " flex-direction: column;\n",
307
- " justify-content: flex-start;\n",
308
- " align-items: center; /* Center horizontally */\n",
309
- " position: relative;\n",
310
- " background-color: #232323;\n",
311
- " width: 1200px;\n",
312
- " height: auto;\n",
313
- " margin: 40px 10px 10px 10px;\n",
314
- " padding: 10px 15px;\n",
315
- " border-radius: 15px;\n",
316
- " box-shadow: 0 0 50px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
317
- " overflow: visible;\n",
318
- " transition: all 0.5s ease-in-out;\n",
319
- "}\n",
320
- ".container_dl::after {\n",
321
- " position: absolute;\n",
322
- " top: 5px;\n",
323
- " right: 10px;\n",
324
- " content: \"ANXETY\";\n",
325
- " font-weight: bold;\n",
326
- " font-size: 24px;\n",
327
- " color: rgba(0, 0, 0, 0.2);\n",
328
- "}\n",
329
- "\n",
330
- ".result_output_dl {\n",
331
- " flex-direction: row;\n",
332
- " /* align-items: flex-start; */\n",
333
- " flex-wrap: wrap;\n",
334
- " overflow: visible;\n",
335
- " box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
336
- " border-radius: 8px;\n",
337
- " background-color: #1f1f1f;\n",
338
- " width: 95%;\n",
339
- " padding: 10px 15px;\n",
340
- "}\n",
341
- "\n",
342
- ".outputs_dl {\n",
343
- " display: flex;\n",
344
- " flex-wrap: wrap;\n",
345
- " background-color: #181818;\n",
346
- " padding: 10px 15px;\n",
347
- " border-radius: 15px;\n",
348
- " box-shadow: 0 0 8px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
349
- " color: #c1c1c1;\n",
350
- " margin: 8px;\n",
351
- " transition: all 0.15s ease;\n",
352
- " flex-grow: 1;\n",
353
- "}\n",
354
- ".outputs_dl:hover {\n",
355
- " transform: scale(1.02);\n",
356
- " background-color: #181718;\n",
357
- "}\n",
358
- "\n",
359
- "/* setting the height of \"outputs\" containers */\n",
360
- ".outputs_dl { max-height: 400px; }\n",
361
- ".extension { height: 300px; }\n",
362
- "\n",
363
- "\n",
364
- "/* Animation of elements */\n",
365
- "\n",
366
- ".container_dl,\n",
367
- ".outputs_dl {\n",
368
- " animation-name: showedResult;\n",
369
- " animation-duration: 1s;\n",
370
- "}\n",
371
- ".items_dl {\n",
372
- " animation-name: showedText;\n",
373
- " animation-duration: 1s;\n",
374
- "}\n",
375
- "\n",
376
- "@keyframes showedResult {\n",
377
- " 0% {\n",
378
- " transform: translate3d(0, 15%, 0) scale(0.98);\n",
379
- " opacity: 0;\n",
380
- " }\n",
381
- " 100% {\n",
382
- " transform: translate3d(0, 0, 0) scale(1);\n",
383
- " opacity: 1;\n",
384
- " }\n",
385
- "}\n",
386
- "\n",
387
- "@keyframes showedText {\n",
388
- " 0% {\n",
389
- " transform: translate3d(-30%, 0, 0);\n",
390
- " opacity: 0;\n",
391
- " }\n",
392
- " 100% {\n",
393
- " transform: translate3d(0, 0, 0);\n",
394
- " opacity: 1;\n",
395
- " }\n",
396
- "}\n",
397
- "</style>\n"
398
- ]
399
- },
400
- "metadata": {}
401
- },
402
- {
403
- "output_type": "error",
404
- "ename": "FileNotFoundError",
405
- "evalue": "[Errno 2] No such file or directory: '/root/sdw/models/Stable-diffusion'",
406
- "traceback": [
407
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
408
- "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
409
- "\u001b[0;32m<ipython-input-1-57e06ef02d42>\u001b[0m in \u001b[0;36m<cell line: 191>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 190\u001b[0m \u001b[0;31m# Models\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 191\u001b[0;31m \u001b[0mmodels_list\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mfile\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0mfile\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlistdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodels_dir\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mfile\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mendswith\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'.txt'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 192\u001b[0m \u001b[0mmodels_widget\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0moutput_container_generator\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'Models'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodels_list\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd_class\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"model\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 193\u001b[0m \u001b[0;31m# Vaes\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
410
- "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/root/sdw/models/Stable-diffusion'"
411
- ]
412
- }
413
- ]
414
- }
415
- ]
416
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
files_cells/special/python/dl_display_results.py DELETED
@@ -1,231 +0,0 @@
1
- ##~ Display Download Results Widgets | by: ANXETY ~##
2
-
3
- import re
4
- import os
5
- import json
6
- import time
7
- import ipywidgets as widgets
8
- from ipywidgets import widgets, Layout, Label, Button, VBox, HBox
9
- from IPython.display import display, HTML, Javascript, clear_output
10
-
11
-
12
- # ================= DETECT ENV =================
13
- def detect_environment():
14
- free_plan = (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
15
- environments = {
16
- 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
17
- 'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content")
18
- }
19
-
20
- for env_var, (environment, path) in environments.items():
21
- if env_var in os.environ:
22
- return environment, path, free_plan
23
-
24
- env, root_path, free_plan = detect_environment()
25
- webui_path = f"{root_path}/sdw"
26
- # ----------------------------------------------
27
-
28
-
29
- # CONFIG DIR
30
- models_dir = f"{webui_path}/models/Stable-diffusion"
31
- vaes_dir = f"{webui_path}/models/VAE"
32
- embeddings_dir = f"{webui_path}/embeddings"
33
- loras_dir = f"{webui_path}/models/Lora"
34
- extensions_dir = f"{webui_path}/extensions"
35
- control_dir = f"{webui_path}/models/ControlNet"
36
- adetailer_dir = f"{webui_path}/models/adetailer"
37
-
38
-
39
- # ==================== CSS ====================
40
- CSS = """
41
- <style>
42
- /* General Styles */
43
- .header_dl,
44
- .header_outputs_dl {
45
- font-family: cursive;
46
- font-size: 20px;
47
- font-weight: bold;
48
- text-align: center;
49
- }
50
- .header_dl {
51
- color: #8b9dc3;
52
- margin-bottom: 15px;
53
- }
54
- .header_outputs_dl {
55
- color: #0083c0;
56
- align-self: center;
57
- }
58
-
59
- hr {
60
- border-color: grey;
61
- background-color: grey;
62
- opacity: 0.25;
63
- width: 1000px;
64
- }
65
-
66
- /* Element text style */
67
- .widget-html {
68
- font-family: cursive;
69
- font-size: 14px;
70
- color: white !important;
71
- user-select: none;
72
- }
73
-
74
-
75
- /* Container style */
76
- .container_dl {
77
- position: relative;
78
- flex-direction: column;
79
- justify-content: flex-start;
80
- align-items: center; /* Center horizontally */
81
- position: relative;
82
- background-color: #232323;
83
- width: 1200px;
84
- height: auto;
85
- margin: 40px 10px 10px 10px;
86
- padding: 10px 15px;
87
- border-radius: 15px;
88
- box-shadow: 0 0 50px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);
89
- overflow: visible;
90
- transition: all 0.5s ease-in-out;
91
- }
92
- .container_dl::after {
93
- position: absolute;
94
- top: 5px;
95
- right: 10px;
96
- content: "ANXETY";
97
- font-weight: bold;
98
- font-size: 24px;
99
- color: rgba(0, 0, 0, 0.2);
100
- }
101
-
102
- .result_output_dl {
103
- flex-direction: row;
104
- /* align-items: flex-start; */
105
- flex-wrap: wrap;
106
- overflow: visible;
107
- box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
108
- border-radius: 8px;
109
- background-color: #1f1f1f;
110
- width: 95%;
111
- padding: 10px 15px;
112
- }
113
-
114
- .outputs_dl {
115
- display: flex;
116
- flex-wrap: wrap;
117
- background-color: #181818;
118
- padding: 10px 15px;
119
- border-radius: 15px;
120
- box-shadow: 0 0 8px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.3);
121
- color: #c1c1c1;
122
- margin: 8px;
123
- transition: all 0.15s ease;
124
- flex-grow: 1;
125
- }
126
- .outputs_dl:hover {
127
- /* transform: scale(1.02); */
128
- background-color: #181718;
129
- }
130
-
131
- /* setting the height of "outputs" containers */
132
- .outputs_dl { max-height: 400px; }
133
- .extension { height: 300px; }
134
-
135
-
136
- /* Animation of elements */
137
-
138
- .container_dl,
139
- .outputs_dl {
140
- animation-name: showedResult;
141
- animation-duration: 1s;
142
- }
143
- .items_dl {
144
- animation-name: showedText;
145
- animation-duration: 1s;
146
- }
147
-
148
- @keyframes showedResult {
149
- 0% {
150
- transform: translate3d(0, 15%, 0) scale(0.98);
151
- opacity: 0;
152
- }
153
- 100% {
154
- transform: translate3d(0, 0, 0) scale(1);
155
- opacity: 1;
156
- }
157
- }
158
-
159
- @keyframes showedText {
160
- 0% {
161
- transform: translate3d(-30%, 0, 0);
162
- opacity: 0;
163
- }
164
- 100% {
165
- transform: translate3d(0, 0, 0);
166
- opacity: 1;
167
- }
168
- }
169
- </style>
170
- """
171
-
172
- display(HTML(CSS))
173
- # ==================== CSS ====================
174
-
175
-
176
- # ==================== WIDGETS ====================
177
- # --- global widgets ---
178
- HR = widgets.HTML('<hr>')
179
-
180
- header_widget = widgets.HTML(value='<div class="header_dl">DOWNLOAD RESULTS | v0.2<div>')
181
-
182
- # Adding content to "outputs_widgets_list"
183
- def output_container_generator(header, items):
184
- header_widget = widgets.HTML(value=f'<div class="header_outputs_dl">{header} ➤</div>')
185
- content = [widgets.HTML(value=f'<div class="items_dl">{item}</div>') for item in items]
186
- container_widget = widgets.VBox([header_widget] + content).add_class("outputs_dl")
187
- return container_widget
188
-
189
-
190
- # Models
191
- models_list = [file for file in os.listdir(models_dir) if not file.endswith('.txt')]
192
- models_widget = output_container_generator('Models', models_list).add_class("model")
193
- # Vaes
194
- vaes_list = [file for file in os.listdir(vaes_dir) if not file.endswith('.txt')]
195
- vaes_widget = output_container_generator('VAEs', vaes_list).add_class("vae")
196
- # Embeddings
197
- embeddings_list = [file for file in os.listdir(embeddings_dir) if not file.endswith('.txt') and not os.path.isdir(os.path.join(embeddings_dir, file))]
198
- embeddings_widget = output_container_generator('Embeddings', embeddings_list).add_class("embedding")
199
- # LoRAs
200
- loras_list = [file for file in os.listdir(loras_dir) if not file.endswith('.txt')]
201
- loras_widget = output_container_generator('LoRAs', loras_list).add_class("lora")
202
- # Extensions
203
- extensions_list = [folder for folder in os.listdir(extensions_dir) if os.path.isdir(os.path.join(extensions_dir, folder))]
204
- extensions_widget = output_container_generator('Extensions', extensions_list).add_class("extension")
205
- # ControlNet
206
- # controlnets_list = [file for file in os.listdir(control_dir) if not file.endswith(('.txt', '.yaml'))]
207
- filter_name = re.compile(r'^[^_]*_[^_]*_[^_]*_(.*)_fp16\.safetensors$')
208
- controlnets_list = [
209
- filter_name.match(file).group(1) if filter_name.match(file) else file
210
- for file in os.listdir(control_dir)
211
- if not file.endswith(('.txt', '.yaml'))
212
- ]
213
- controlnets_widget = output_container_generator('ControlNets', controlnets_list).add_class("controlnet")
214
-
215
-
216
- ## Sorting and Output
217
- widgets_dict = {
218
- models_widget: models_list,
219
- vaes_widget: vaes_list,
220
- embeddings_widget: embeddings_list,
221
- loras_widget: loras_list,
222
- extensions_widget: extensions_list,
223
- controlnets_widget: controlnets_list
224
- }
225
- outputs_widgets_list = [widget for widget, widget_list in widgets_dict.items() if widget_list]
226
- result_output_widget = widgets.HBox(outputs_widgets_list).add_class("result_output_dl")
227
-
228
- container_widget = widgets.VBox([header_widget, HR, result_output_widget, HR]).add_class("container_dl")
229
-
230
- display(container_widget)
231
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
preview_img_bg_widget.png DELETED
Binary file (434 kB)