NagisaNao commited on
Commit
c8ce98f
1 Parent(s): ebf292d

add hide main widgets animation

Browse files
files_cells/notebooks/en/downloading_en.ipynb CHANGED
@@ -68,7 +68,7 @@
68
  " xformers = \"xformers==0.0.23.post1 triton==2.1.0\"\n",
69
  " torch = \"torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121\"\n",
70
  "\n",
71
- " print(\"Installing the libraries, it's going to take a while....\", end='')\n",
72
  " with capture.capture_output() as cap:\n",
73
  " !pip install -U gdown\n",
74
  " !apt-get update && apt -y install aria2\n",
@@ -87,7 +87,7 @@
87
  " !wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb\n",
88
  "\n",
89
  " if env == \"Google Colab\":\n",
90
- " !pip install -q pip install xformers==0.0.26.dev769 -U\n",
91
  " else:\n",
92
  " !pip install -q {torch} -U\n",
93
  " !pip install -q {xformers} -U\n",
@@ -95,25 +95,19 @@
95
  " with open(flag_file, \"w\") as f:\n",
96
  " f.write(\"hey ;3\")\n",
97
  " del cap\n",
98
- " print(\"\\rLibraries are installed!\" + \" \"*35)\n",
99
  " time.sleep(2)\n",
100
  " clear_output()\n",
101
  "\n",
102
  "\n",
103
- "# ================= loading settings V5 =================\n",
104
- "import toml\n",
105
- "\n",
106
  "def load_settings(path):\n",
107
  " if os.path.exists(path):\n",
108
  " with open(path, 'r') as file:\n",
109
- " settings = toml.load(file)\n",
110
- " flat_settings = {}\n",
111
- " for section, keys in settings.items():\n",
112
- " flat_settings.update(keys)\n",
113
- " return flat_settings\n",
114
  " return {}\n",
115
  "\n",
116
- "settings = load_settings(f'{root_path}/settings.toml')\n",
117
  "\n",
118
  "variables = [\n",
119
  " 'Model', 'Model_Num', 'Inpainting_Model',\n",
@@ -167,7 +161,8 @@
167
  " install_time = timedelta(seconds=time.time()-start_install)\n",
168
  " print(\"\\r🚀 Unpacking is complete! For\",\"%02d:%02d:%02d ⚡\\n\" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)\n",
169
  "else:\n",
170
- " !echo -n {start_colab} > {webui_path}/static/colabTimer.txt\n",
 
171
  " print(\"🚀 All unpacked... Skip. ⚡\")\n",
172
  " start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())\n",
173
  " time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]\n",
@@ -234,35 +229,39 @@
234
  "## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )\n",
235
  "print(\"📦 Downloading models and stuff...\", end='')\n",
236
  "model_list = {\n",
237
- " \"1.Anime (by Xpuct) + INP\": [\n",
238
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_v2.safetensors\"},\n",
239
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_v2-inpainting.safetensors\"}\n",
240
  " ],\n",
241
- " \"2.Cetus-Mix [Anime] [V4] + INP\": [\n",
 
 
 
242
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
243
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
244
  " ],\n",
245
- " \"3.Counterfeit [Anime] [V3] + INP\": [\n",
246
  " {\"url\": \"https://civitai.com/api/download/models/125050\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
247
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
248
  " ],\n",
249
- " \"4.CuteColor [Anime] [V3]\": [\n",
250
  " {\"url\": \"https://civitai.com/api/download/models/138754\", \"name\": \"CuteColor_V3.safetensors\"}\n",
251
  " ],\n",
252
- " \"5.Dark-Sushi-Mix [Anime]\": [\n",
253
  " {\"url\": \"https://civitai.com/api/download/models/101640\", \"name\": \"DarkSushiMix_2_5D.safetensors\"},\n",
254
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
255
  " ],\n",
256
- " \"6.Meina-Mix [Anime] [V11] + INP\": [\n",
 
 
 
 
257
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
258
  " {\"url\": \"https://civitai.com/api/download/models/120702\", \"name\": \"MeinaMix_V11-inpainting.safetensors\"}\n",
259
  " ],\n",
260
- " \"7.Mix-Pro [Anime] [V4] + INP\": [\n",
261
  " {\"url\": \"https://civitai.com/api/download/models/125668\", \"name\": \"MixPro_V4.safetensors\"},\n",
262
  " {\"url\": \"https://civitai.com/api/download/models/139878\", \"name\": \"MixPro_V4-inpainting.safetensors\"}\n",
263
- " ],\n",
264
- " \"8.BluMix [Anime] [V7]\": [\n",
265
- " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_v7.safetensors\"}\n",
266
  " ]\n",
267
  "}\n",
268
  "\n",
@@ -342,8 +341,8 @@
342
  " \"model\": [models_dir, \"Model_url\"],\n",
343
  " \"vae\": [vaes_dir, \"Vae_url\"],\n",
344
  " \"lora\": [loras_dir, \"LoRA_url\"],\n",
345
- " \"embeddings\": [embeddings_dir, \"Embedding_url\"],\n",
346
- " \"extensions\": [extensions_dir, \"Extensions_url\"],\n",
347
  " \"control\": [control_dir, \"ControlNet_url\"]\n",
348
  "}\n",
349
  "\n",
@@ -353,7 +352,6 @@
353
  "ControlNet_url = \"\"\n",
354
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
355
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
356
- "# user_header = f\"\\\"Authorization: Bearer {optional_huggingface_token}\\\"\"\n",
357
  "\n",
358
  "def handle_manual(url):\n",
359
  " original_url = url\n",
@@ -365,22 +363,22 @@
365
  "\n",
366
  " for prefix, (dir, _) in prefixes.items():\n",
367
  " if original_url.startswith(f\"{prefix}:\"):\n",
368
- " if prefix != \"extensions\":\n",
369
  " manual_download(url, dir, file_name=file_name)\n",
370
  " else:\n",
371
  " extension_repo.append((url, file_name))\n",
372
  "\n",
373
  "def manual_download(url, dst_dir, file_name):\n",
374
  " basename = url.split(\"/\")[-1] if file_name is None else file_name\n",
375
- " header_option = f\"--header={user_header}\" # if optional_huggingface_token else \"\"\n",
 
 
376
  "\n",
377
  " # I do it at my own risk..... Fucking CivitAi >:(\n",
378
  " civitai_token = \"62c0c5956b2f9defbd844d754000180b\"\n",
379
  " if 'civitai' in url and civitai_token:\n",
380
  " url = f\"{url}?token={civitai_token}\"\n",
381
  "\n",
382
- " print(\"\\033[32m---\"*45 + f\"\\n\\033[33mURL: \\033[34m{url}\\n\\033[33mSAVE DIR: \\033[34m{dst_dir}\\n\\033[33mFILE NAME: \\033[34m{file_name}\\033[32m\\n~~~\\033[0m\")\n",
383
- "\n",
384
  " # -- GDrive --\n",
385
  " if 'drive.google' in url:\n",
386
  " if 'folders' in url:\n",
 
68
  " xformers = \"xformers==0.0.23.post1 triton==2.1.0\"\n",
69
  " torch = \"torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121\"\n",
70
  "\n",
71
+ " print(\"💿 Installing the libraries, it's going to take a while...\", end='')\n",
72
  " with capture.capture_output() as cap:\n",
73
  " !pip install -U gdown\n",
74
  " !apt-get update && apt -y install aria2\n",
 
87
  " !wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb\n",
88
  "\n",
89
  " if env == \"Google Colab\":\n",
90
+ " !pip install -q pip install xformers==0.0.26.dev778 -U\n",
91
  " else:\n",
92
  " !pip install -q {torch} -U\n",
93
  " !pip install -q {xformers} -U\n",
 
95
  " with open(flag_file, \"w\") as f:\n",
96
  " f.write(\"hey ;3\")\n",
97
  " del cap\n",
98
+ " print(\"\\r🍪 Libraries are installed!\" + \" \"*35)\n",
99
  " time.sleep(2)\n",
100
  " clear_output()\n",
101
  "\n",
102
  "\n",
103
+ "# ================= loading settings V4 =================\n",
 
 
104
  "def load_settings(path):\n",
105
  " if os.path.exists(path):\n",
106
  " with open(path, 'r') as file:\n",
107
+ " return json.load(file)\n",
 
 
 
 
108
  " return {}\n",
109
  "\n",
110
+ "settings = load_settings(f'{root_path}/settings.json')\n",
111
  "\n",
112
  "variables = [\n",
113
  " 'Model', 'Model_Num', 'Inpainting_Model',\n",
 
161
  " install_time = timedelta(seconds=time.time()-start_install)\n",
162
  " print(\"\\r🚀 Unpacking is complete! For\",\"%02d:%02d:%02d ⚡\\n\" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)\n",
163
  "else:\n",
164
+ " if env == \"SageMaker Studio Lab\":\n",
165
+ " !echo -n {start_colab} > {webui_path}/static/colabTimer.txt\n",
166
  " print(\"🚀 All unpacked... Skip. ⚡\")\n",
167
  " start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())\n",
168
  " time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]\n",
 
229
  "## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )\n",
230
  "print(\"📦 Downloading models and stuff...\", end='')\n",
231
  "model_list = {\n",
232
+ " \"1.Anime (by XpucT) + INP\": [\n",
233
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_v2.safetensors\"},\n",
234
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_v2-inpainting.safetensors\"}\n",
235
  " ],\n",
236
+ " \"2.BluMix [Anime] [V7]\": [\n",
237
+ " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_v7.safetensors\"}\n",
238
+ " ],\n",
239
+ " \"3.Cetus-Mix [Anime] [V4] + INP\": [\n",
240
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
241
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
242
  " ],\n",
243
+ " \"4.Counterfeit [Anime] [V3] + INP\": [\n",
244
  " {\"url\": \"https://civitai.com/api/download/models/125050\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
245
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
246
  " ],\n",
247
+ " \"5.CuteColor [Anime] [V3]\": [\n",
248
  " {\"url\": \"https://civitai.com/api/download/models/138754\", \"name\": \"CuteColor_V3.safetensors\"}\n",
249
  " ],\n",
250
+ " \"6.Dark-Sushi-Mix [Anime]\": [\n",
251
  " {\"url\": \"https://civitai.com/api/download/models/101640\", \"name\": \"DarkSushiMix_2_5D.safetensors\"},\n",
252
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
253
  " ],\n",
254
+ " \"7.Deliberate [Realism] [V6] + INP\": [\n",
255
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors\", \"name\": \"Deliberate_v6.safetensors\"},\n",
256
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors\", \"name\": \"Deliberate_v6-inpainting.safetensors\"}\n",
257
+ " ],\n",
258
+ " \"8.Meina-Mix [Anime] [V11] + INP\": [\n",
259
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
260
  " {\"url\": \"https://civitai.com/api/download/models/120702\", \"name\": \"MeinaMix_V11-inpainting.safetensors\"}\n",
261
  " ],\n",
262
+ " \"9.Mix-Pro [Anime] [V4] + INP\": [\n",
263
  " {\"url\": \"https://civitai.com/api/download/models/125668\", \"name\": \"MixPro_V4.safetensors\"},\n",
264
  " {\"url\": \"https://civitai.com/api/download/models/139878\", \"name\": \"MixPro_V4-inpainting.safetensors\"}\n",
 
 
 
265
  " ]\n",
266
  "}\n",
267
  "\n",
 
341
  " \"model\": [models_dir, \"Model_url\"],\n",
342
  " \"vae\": [vaes_dir, \"Vae_url\"],\n",
343
  " \"lora\": [loras_dir, \"LoRA_url\"],\n",
344
+ " \"embed\": [embeddings_dir, \"Embedding_url\"],\n",
345
+ " \"extension\": [extensions_dir, \"Extensions_url\"],\n",
346
  " \"control\": [control_dir, \"ControlNet_url\"]\n",
347
  "}\n",
348
  "\n",
 
352
  "ControlNet_url = \"\"\n",
353
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
354
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
 
355
  "\n",
356
  "def handle_manual(url):\n",
357
  " original_url = url\n",
 
363
  "\n",
364
  " for prefix, (dir, _) in prefixes.items():\n",
365
  " if original_url.startswith(f\"{prefix}:\"):\n",
366
+ " if prefix != \"extension\":\n",
367
  " manual_download(url, dir, file_name=file_name)\n",
368
  " else:\n",
369
  " extension_repo.append((url, file_name))\n",
370
  "\n",
371
  "def manual_download(url, dst_dir, file_name):\n",
372
  " basename = url.split(\"/\")[-1] if file_name is None else file_name\n",
373
+ " header_option = f\"--header={user_header}\"\n",
374
+ "\n",
375
+ " print(\"\\033[32m---\"*45 + f\"\\n\\033[33mURL: \\033[34m{url}\\n\\033[33mSAVE DIR: \\033[34m{dst_dir}\\n\\033[33mFILE NAME: \\033[34m{file_name}\\033[32m\\n~~~\\033[0m\")\n",
376
  "\n",
377
  " # I do it at my own risk..... Fucking CivitAi >:(\n",
378
  " civitai_token = \"62c0c5956b2f9defbd844d754000180b\"\n",
379
  " if 'civitai' in url and civitai_token:\n",
380
  " url = f\"{url}?token={civitai_token}\"\n",
381
  "\n",
 
 
382
  " # -- GDrive --\n",
383
  " if 'drive.google' in url:\n",
384
  " if 'folders' in url:\n",
files_cells/notebooks/en/widgets_en.ipynb CHANGED
@@ -21,6 +21,7 @@
21
  "\n",
22
  "import os\n",
23
  "import json\n",
 
24
  "import ipywidgets as widgets\n",
25
  "from ipywidgets import widgets, Layout, Label, Button, VBox, HBox\n",
26
  "from IPython.display import display, HTML, Javascript, clear_output\n",
@@ -62,6 +63,11 @@
62
  "# ---\n",
63
  "url_img, opacity_img, blur_img, y_img, x_img, scale_img, mode_img = args.image, args.opacity, args.blur, args.y, args.x, args.scale, args.mode\n",
64
  "\n",
 
 
 
 
 
65
  "container_background = f'''\n",
66
  "<style>\n",
67
  ":root {{\n",
@@ -72,6 +78,7 @@
72
  " --image_x: {x_img}px;\n",
73
  " --img_scale: {scale_img}%;\n",
74
  " --img_mode: {mode_img};\n",
 
75
  "}}\n",
76
  "\n",
77
  ".widget-dropdown select,\n",
@@ -131,7 +138,7 @@
131
  " content: \"ANXETY\";\n",
132
  " font-weight: bold;\n",
133
  " font-size: 24px;\n",
134
- " color: rgba(0, 0, 0, 0.15);\n",
135
  "}\n",
136
  "\n",
137
  "/* background img */\n",
@@ -161,7 +168,7 @@
161
  " background-position: var(--image_x) calc(-430px - var(--image_y));\n",
162
  "}\n",
163
  ".image_4::before {\n",
164
- " background-position: var(--image_x) calc(-740px - var(--image_y));\n",
165
  "}\n",
166
  "\n",
167
  ".container_custom_downlad {\n",
@@ -220,6 +227,43 @@
220
  "}\n",
221
  "\n",
222
  "\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  "/* Button styles */\n",
224
  "\n",
225
  ".button_save {\n",
@@ -338,6 +382,14 @@
338
  ".button_save {\n",
339
  " animation-name: showedWidgets;\n",
340
  " animation-duration: 1s;\n",
 
 
 
 
 
 
 
 
341
  "}\n",
342
  "\n",
343
  "@keyframes showedWidgets {\n",
@@ -352,6 +404,19 @@
352
  " opacity: 1;\n",
353
  " }\n",
354
  "}\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  "</style>\n",
356
  "\n",
357
  "<!-- TOGGLE 'CustomDL' SCRIPT -->\n",
@@ -380,20 +445,23 @@
380
  "# --- MODEL ---\n",
381
  "model_header = widgets.HTML('<div class=\"header\">Model Selection<div>')\n",
382
  "model_options = ['none',\n",
383
- " '1.Anime (by Xpuct) + INP',\n",
384
- " '2.Cetus-Mix [Anime] [V4] + INP',\n",
385
- " '3.Counterfeit [Anime] [V3] + INP',\n",
386
- " '4.CuteColor [Anime] [V3]',\n",
387
- " '5.Dark-Sushi-Mix [Anime]',\n",
388
- " '6.Meina-Mix [Anime] [V11] + INP',\n",
389
- " '7.Mix-Pro [Anime] [V4] + INP',\n",
390
- " '8.BluMix [Anime] [V7]']\n",
 
391
  "# ---\n",
392
- "Model_widget = widgets.Dropdown(options=model_options, value='3.Counterfeit [Anime] [V3] + INP', description='Model:', style=style, layout=layout)\n",
393
  "Model_Num_widget = widgets.Text(description='Model Number:', placeholder='Enter the model numbers to be downloaded using comma/space.', style=style, layout=layout)\n",
394
  "Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Models', style=style)\n",
395
  "\n",
396
- "display(widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class(\"container\").add_class(\"image_1\"))\n",
 
 
397
  "\n",
398
  "# --- VAE ---\n",
399
  "vae_header = widgets.HTML('<div class=\"header\" >VAE Selection</div>')\n",
@@ -404,9 +472,11 @@
404
  " '4.ClearVae.vae',\n",
405
  " '5.WD.vae']\n",
406
  "Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)\n",
407
- "Vae_Num_widget = widgets.Text(description='Vae number:', placeholder='Enter the vae numbers to be downloaded using comma/space.', style=style, layout=layout)\n",
408
  "\n",
409
- "display(widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class(\"container\").add_class(\"image_2\"))\n",
 
 
410
  "\n",
411
  "# --- ADDITIONAL ---\n",
412
  "additional_header = widgets.HTML('<div class=\"header\">Additional</div>')\n",
@@ -425,18 +495,21 @@
425
  "controlnet_widget = widgets.Dropdown(options=controlnet_options, value='none', description='ControlNet:', style=style, layout=layout)\n",
426
  "controlnet_Num_widget = widgets.Text(description='ControlNet Number:', placeholder='Enter the ControlNet model numbers to be downloaded using comma/space.', style=style, layout=layout)\n",
427
  "commit_hash_widget = widgets.Text(description='Commit Hash:', style=style, layout=layout)\n",
428
- "optional_huggingface_token_widget = widgets.Text(description='Huggingface token:', style=style, layout=layout)\n",
429
- "ngrok_token_widget = widgets.Text(description='Ngrok token:', style=style, layout=widgets.Layout(width='1047px'))\n",
430
  "ngrock_button = widgets.HTML('<a href=\"https://dashboard.ngrok.com/get-started/your-authtoken\" target=\"_blank\">Get Ngrok Token</a>').add_class(\"button_ngrok\")\n",
431
  "ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, layout=layout)\n",
432
  "# ---\n",
433
  "commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
434
  "commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)\n",
435
  "\n",
 
436
  "additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]\n",
437
  "if free_plan and env == \"Google Colab\":\n",
438
  " additional_widget_list.remove(ngrok_widget)\n",
439
- "display(widgets.VBox(additional_widget_list).add_class(\"container\").add_class(\"image_3\"))\n",
 
 
440
  "\n",
441
  "# --- CUSTOM DOWNLOAD ---\n",
442
  "custom_download_header_popup = widgets.HTML('''\n",
@@ -450,7 +523,7 @@
450
  "\n",
451
  "<div class=\"header\" style=\"cursor: pointer;\" onclick=\"toggleContainer()\">Custom Download</div>\n",
452
  "<!-- PopUp Window -->\n",
453
- "<div class=\"info\">FAQ?</div>\n",
454
  "<div class=\"popup\">\n",
455
  " Separate multiple URLs with a comma/space. For a <span class=\"file_name\">custom name</span> file/extension, specify it with <span class=\"braces\">[]</span>\n",
456
  " after the URL without spaces.\n",
@@ -472,9 +545,11 @@
472
  "Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)\n",
473
  "custom_file_urls_widget = widgets.Text(description='File (txt):', style=style, layout=layout)\n",
474
  "\n",
475
- "display(widgets.VBox([\n",
 
476
  " custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget\n",
477
- " ]).add_class(\"container\").add_class(\"image_4\").add_class(\"container_custom_downlad\"))\n",
 
478
  "\n",
479
  "# --- Save Button ---\n",
480
  "save_button = widgets.Button(description='Save').add_class(\"button_save\")\n",
@@ -482,39 +557,38 @@
482
  "\n",
483
  "\n",
484
  "# ============ Load / Save - Settings V2 ============\n",
485
- "try:\n",
486
- " import toml\n",
487
- "except ImportError: # SageMaker - only for you...\n",
488
- " !pip install toml > /dev/null 2>&1\n",
489
- " import toml\n",
490
  "\n",
491
- "SETTINGS_FILE = f'{root_path}/settings.toml'\n",
492
- "\n",
493
- "settings_structure = {\n",
494
- " \"Model\": ['Model', 'Model_Num', 'Inpainting_Model'],\n",
495
- " \"Vae\": ['Vae', 'Vae_Num'],\n",
496
- " \"Additional\": ['latest_webui', 'latest_exstensions', 'detailed_download', 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token', 'ngrok_token', 'commandline_arguments'],\n",
497
- " \"CustomUrl\": ['Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls']\n",
498
- "}\n",
499
  "\n",
500
  "def save_settings():\n",
501
- " settings = {}\n",
502
- " for section, keys in settings_structure.items():\n",
503
- " settings[section] = {key: globals()[f\"{key}_widget\"].value for key in keys}\n",
504
  " with open(SETTINGS_FILE, 'w') as f:\n",
505
- " toml.dump(settings, f)\n",
506
  "\n",
507
  "def load_settings():\n",
508
  " if os.path.exists(SETTINGS_FILE):\n",
509
  " with open(SETTINGS_FILE, 'r') as f:\n",
510
- " loaded_settings = toml.load(f)\n",
511
- " for section, keys in settings_structure.items():\n",
512
- " for key in keys:\n",
513
- " if key in loaded_settings[section]:\n",
514
- " globals()[f\"{key}_widget\"].value = loaded_settings[section][key]\n",
515
  "\n",
516
  "def save_data(button):\n",
517
  " save_settings()\n",
 
 
 
 
 
 
 
518
  " widgets.Widget.close_all()\n",
519
  "\n",
520
  "settings = load_settings()\n",
 
21
  "\n",
22
  "import os\n",
23
  "import json\n",
24
+ "import time\n",
25
  "import ipywidgets as widgets\n",
26
  "from ipywidgets import widgets, Layout, Label, Button, VBox, HBox\n",
27
  "from IPython.display import display, HTML, Javascript, clear_output\n",
 
63
  "# ---\n",
64
  "url_img, opacity_img, blur_img, y_img, x_img, scale_img, mode_img = args.image, args.opacity, args.blur, args.y, args.x, args.scale, args.mode\n",
65
  "\n",
66
+ "# WTF COLAB - WHAT THE FUCK IS THE DIFFERENCE OF 40 PIXELS!?!?!?\n",
67
+ "fix_heigh_img = \"-780px\"\n",
68
+ "if env == \"Google Colab\": # betrayal..\n",
69
+ " fix_heigh_img = \"-740px\"\n",
70
+ "\n",
71
  "container_background = f'''\n",
72
  "<style>\n",
73
  ":root {{\n",
 
78
  " --image_x: {x_img}px;\n",
79
  " --img_scale: {scale_img}%;\n",
80
  " --img_mode: {mode_img};\n",
81
+ " --img_height_dif: {fix_heigh_img}\n",
82
  "}}\n",
83
  "\n",
84
  ".widget-dropdown select,\n",
 
138
  " content: \"ANXETY\";\n",
139
  " font-weight: bold;\n",
140
  " font-size: 24px;\n",
141
+ " color: rgba(0, 0, 0, 0.2);\n",
142
  "}\n",
143
  "\n",
144
  "/* background img */\n",
 
168
  " background-position: var(--image_x) calc(-430px - var(--image_y));\n",
169
  "}\n",
170
  ".image_4::before {\n",
171
+ " background-position: var(--image_x) calc(var(--img_height_dif) - var(--image_y));\n",
172
  "}\n",
173
  "\n",
174
  ".container_custom_downlad {\n",
 
227
  "}\n",
228
  "\n",
229
  "\n",
230
+ "/* Slider Checkbox style */\n",
231
+ "\n",
232
+ ".widget-checkbox input[type=\"checkbox\"] {\n",
233
+ " appearance: none;\n",
234
+ " position: relative;\n",
235
+ " top: 4px; /* Why is he taller?! */\n",
236
+ " width: 40px;\n",
237
+ " height: 20px;\n",
238
+ " border: none;\n",
239
+ " border-radius: 10px;\n",
240
+ " background-color: #20b2aa;\n",
241
+ " cursor: pointer;\n",
242
+ " box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
243
+ " transition: background-color 0.3s ease;\n",
244
+ "}\n",
245
+ ".widget-checkbox input[type=\"checkbox\"]:checked {\n",
246
+ " background-color: #2196F3;\n",
247
+ "}\n",
248
+ "\n",
249
+ ".widget-checkbox input[type=\"checkbox\"]:before {\n",
250
+ " content: '';\n",
251
+ " position: absolute;\n",
252
+ " top: 50%;\n",
253
+ " left: 3px;\n",
254
+ " width: 16px;\n",
255
+ " height: 16px;\n",
256
+ " border-radius: inherit;\n",
257
+ " background-color: white;\n",
258
+ " box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);\n",
259
+ " transform: translateY(-50%);\n",
260
+ " transition: left 0.3s ease;\n",
261
+ "}\n",
262
+ ".widget-checkbox input[type=\"checkbox\"]:checked:before {\n",
263
+ " left: 21px;\n",
264
+ "}\n",
265
+ "\n",
266
+ "\n",
267
  "/* Button styles */\n",
268
  "\n",
269
  ".button_save {\n",
 
382
  ".button_save {\n",
383
  " animation-name: showedWidgets;\n",
384
  " animation-duration: 1s;\n",
385
+ " animation-fill-mode: forwards;\n",
386
+ "}\n",
387
+ "\n",
388
+ ".container.hide,\n",
389
+ ".button_save.hide {\n",
390
+ " animation-name: hideWidgets;\n",
391
+ " animation-duration: 0.5s;\n",
392
+ " animation-fill-mode: forwards;\n",
393
  "}\n",
394
  "\n",
395
  "@keyframes showedWidgets {\n",
 
404
  " opacity: 1;\n",
405
  " }\n",
406
  "}\n",
407
+ "\n",
408
+ "@keyframes hideWidgets {\n",
409
+ " 0% {\n",
410
+ " transform: translate3d(0, 0, 0) scale(1);\n",
411
+ " filter: blur(0) grayscale(0) brightness(1);\n",
412
+ " opacity: 1;\n",
413
+ " }\n",
414
+ " 100% {\n",
415
+ " transform: translate3d(0, 5%, 0) scale(0.9);\n",
416
+ " filter: blur(15px) grayscale(1) brightness(0.5);\n",
417
+ " opacity: 0;\n",
418
+ " }\n",
419
+ "}\n",
420
  "</style>\n",
421
  "\n",
422
  "<!-- TOGGLE 'CustomDL' SCRIPT -->\n",
 
445
  "# --- MODEL ---\n",
446
  "model_header = widgets.HTML('<div class=\"header\">Model Selection<div>')\n",
447
  "model_options = ['none',\n",
448
+ " '1.Anime (by XpucT) + INP',\n",
449
+ " '2.BluMix [Anime] [V7]',\n",
450
+ " '3.Cetus-Mix [Anime] [V4] + INP',\n",
451
+ " '4.Counterfeit [Anime] [V3] + INP',\n",
452
+ " '5.CuteColor [Anime] [V3]',\n",
453
+ " '6.Dark-Sushi-Mix [Anime]',\n",
454
+ " '7.Deliberate [Realism] [V6] + INP',\n",
455
+ " '8.Meina-Mix [Anime] [V11] + INP',\n",
456
+ " '9.Mix-Pro [Anime] [V4] + INP']\n",
457
  "# ---\n",
458
+ "Model_widget = widgets.Dropdown(options=model_options, value='4.Counterfeit [Anime] [V3] + INP', description='Model:', style=style, layout=layout)\n",
459
  "Model_Num_widget = widgets.Text(description='Model Number:', placeholder='Enter the model numbers to be downloaded using comma/space.', style=style, layout=layout)\n",
460
  "Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Models', style=style)\n",
461
  "\n",
462
+ "''' Display Model'''\n",
463
+ "all_model_box = widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class(\"container\").add_class(\"image_1\")\n",
464
+ "display(all_model_box)\n",
465
  "\n",
466
  "# --- VAE ---\n",
467
  "vae_header = widgets.HTML('<div class=\"header\" >VAE Selection</div>')\n",
 
472
  " '4.ClearVae.vae',\n",
473
  " '5.WD.vae']\n",
474
  "Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)\n",
475
+ "Vae_Num_widget = widgets.Text(description='Vae Number:', placeholder='Enter the vae numbers to be downloaded using comma/space.', style=style, layout=layout)\n",
476
  "\n",
477
+ "''' Display Vae'''\n",
478
+ "all_vae_box= widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class(\"container\").add_class(\"image_2\")\n",
479
+ "display(all_vae_box)\n",
480
  "\n",
481
  "# --- ADDITIONAL ---\n",
482
  "additional_header = widgets.HTML('<div class=\"header\">Additional</div>')\n",
 
495
  "controlnet_widget = widgets.Dropdown(options=controlnet_options, value='none', description='ControlNet:', style=style, layout=layout)\n",
496
  "controlnet_Num_widget = widgets.Text(description='ControlNet Number:', placeholder='Enter the ControlNet model numbers to be downloaded using comma/space.', style=style, layout=layout)\n",
497
  "commit_hash_widget = widgets.Text(description='Commit Hash:', style=style, layout=layout)\n",
498
+ "optional_huggingface_token_widget = widgets.Text(description='HuggingFace Token:', style=style, layout=layout)\n",
499
+ "ngrok_token_widget = widgets.Text(description='Ngrok Token:', style=style, layout=widgets.Layout(width='1047px'))\n",
500
  "ngrock_button = widgets.HTML('<a href=\"https://dashboard.ngrok.com/get-started/your-authtoken\" target=\"_blank\">Get Ngrok Token</a>').add_class(\"button_ngrok\")\n",
501
  "ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, layout=layout)\n",
502
  "# ---\n",
503
  "commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
504
  "commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)\n",
505
  "\n",
506
+ "''' Display Additional'''\n",
507
  "additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]\n",
508
  "if free_plan and env == \"Google Colab\":\n",
509
  " additional_widget_list.remove(ngrok_widget)\n",
510
+ "# ```\n",
511
+ "all_additional_box = widgets.VBox(additional_widget_list).add_class(\"container\").add_class(\"image_3\")\n",
512
+ "display(all_additional_box)\n",
513
  "\n",
514
  "# --- CUSTOM DOWNLOAD ---\n",
515
  "custom_download_header_popup = widgets.HTML('''\n",
 
523
  "\n",
524
  "<div class=\"header\" style=\"cursor: pointer;\" onclick=\"toggleContainer()\">Custom Download</div>\n",
525
  "<!-- PopUp Window -->\n",
526
+ "<div class=\"info\">INFO</div>\n",
527
  "<div class=\"popup\">\n",
528
  " Separate multiple URLs with a comma/space. For a <span class=\"file_name\">custom name</span> file/extension, specify it with <span class=\"braces\">[]</span>\n",
529
  " after the URL without spaces.\n",
 
545
  "Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)\n",
546
  "custom_file_urls_widget = widgets.Text(description='File (txt):', style=style, layout=layout)\n",
547
  "\n",
548
+ "''' Display CustomDl'''\n",
549
+ "all_custom_box = widgets.VBox([\n",
550
  " custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget\n",
551
+ " ]).add_class(\"container\").add_class(\"image_4\").add_class(\"container_custom_downlad\")\n",
552
+ "display(all_custom_box)\n",
553
  "\n",
554
  "# --- Save Button ---\n",
555
  "save_button = widgets.Button(description='Save').add_class(\"button_save\")\n",
 
557
  "\n",
558
  "\n",
559
  "# ============ Load / Save - Settings V2 ============\n",
560
+ "SETTINGS_FILE = f'{root_path}/settings.json'\n",
 
 
 
 
561
  "\n",
562
+ "settings_keys = [\n",
563
+ " 'Model', 'Model_Num', 'Inpainting_Model',\n",
564
+ " 'Vae', 'Vae_Num',\n",
565
+ " 'latest_webui', 'latest_exstensions', 'detailed_download',\n",
566
+ " 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',\n",
567
+ " 'ngrok_token', 'commandline_arguments',\n",
568
+ " 'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'\n",
569
+ "]\n",
570
  "\n",
571
  "def save_settings():\n",
572
+ " settings = {key: globals()[f\"{key}_widget\"].value for key in settings_keys}\n",
 
 
573
  " with open(SETTINGS_FILE, 'w') as f:\n",
574
+ " json.dump(settings, f)\n",
575
  "\n",
576
  "def load_settings():\n",
577
  " if os.path.exists(SETTINGS_FILE):\n",
578
  " with open(SETTINGS_FILE, 'r') as f:\n",
579
+ " settings = json.load(f)\n",
580
+ " for key in settings_keys:\n",
581
+ " globals()[f\"{key}_widget\"].value = settings.get(key)\n",
 
 
582
  "\n",
583
  "def save_data(button):\n",
584
  " save_settings()\n",
585
+ "\n",
586
+ " # --- uhh - hide... ---\n",
587
+ " widgets_list = [all_model_box, all_vae_box, all_additional_box, all_custom_box, save_button]\n",
588
+ " for widget in widgets_list:\n",
589
+ " widget.add_class(\"hide\")\n",
590
+ " time.sleep(0.5)\n",
591
+ "\n",
592
  " widgets.Widget.close_all()\n",
593
  "\n",
594
  "settings = load_settings()\n",
files_cells/notebooks/ru/downloading_ru.ipynb CHANGED
@@ -68,7 +68,7 @@
68
  " xformers = \"xformers==0.0.23.post1 triton==2.1.0\"\n",
69
  " torch = \"torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121\"\n",
70
  "\n",
71
- " print(\"Установка библиотек, это займет какое-то время...\", end='')\n",
72
  " with capture.capture_output() as cap:\n",
73
  " !pip install -U gdown\n",
74
  " !apt-get update && apt -y install aria2\n",
@@ -87,7 +87,7 @@
87
  " !wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb\n",
88
  "\n",
89
  " if env == \"Google Colab\":\n",
90
- " !pip install -q pip install xformers==0.0.26.dev769 -U\n",
91
  " else:\n",
92
  " !pip install -q {torch} -U\n",
93
  " !pip install -q {xformers} -U\n",
@@ -95,25 +95,19 @@
95
  " with open(flag_file, \"w\") as f:\n",
96
  " f.write(\"hey ;3\")\n",
97
  " del cap\n",
98
- " print(\"\\rБиблиотеки установлены!\" + \" \"*35)\n",
99
  " time.sleep(2)\n",
100
  " clear_output()\n",
101
  "\n",
102
  "\n",
103
- "# ================= loading settings V5 =================\n",
104
- "import toml\n",
105
- "\n",
106
  "def load_settings(path):\n",
107
  " if os.path.exists(path):\n",
108
  " with open(path, 'r') as file:\n",
109
- " settings = toml.load(file)\n",
110
- " flat_settings = {}\n",
111
- " for section, keys in settings.items():\n",
112
- " flat_settings.update(keys)\n",
113
- " return flat_settings\n",
114
  " return {}\n",
115
  "\n",
116
- "settings = load_settings(f'{root_path}/settings.toml')\n",
117
  "\n",
118
  "variables = [\n",
119
  " 'Model', 'Model_Num', 'Inpainting_Model',\n",
@@ -167,7 +161,8 @@
167
  " install_time = timedelta(seconds=time.time()-start_install)\n",
168
  " print(\"\\r🚀 Распаковка Завершена! За\",\"%02d:%02d:%02d ⚡\\n\" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)\n",
169
  "else:\n",
170
- " !echo -n {start_colab} > {webui_path}/static/colabTimer.txt\n",
 
171
  " print(\"🚀 Все распакованно... Пропуск. ⚡\")\n",
172
  " start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())\n",
173
  " time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]\n",
@@ -234,35 +229,39 @@
234
  "## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )\n",
235
  "print(\"📦 Скачивание моделей и прочего...\", end='')\n",
236
  "model_list = {\n",
237
- " \"1.Anime (by Xpuct) + INP\": [\n",
238
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_v2.safetensors\"},\n",
239
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_v2-inpainting.safetensors\"}\n",
240
  " ],\n",
241
- " \"2.Cetus-Mix [Anime] [V4] + INP\": [\n",
 
 
 
242
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
243
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
244
  " ],\n",
245
- " \"3.Counterfeit [Anime] [V3] + INP\": [\n",
246
  " {\"url\": \"https://civitai.com/api/download/models/125050\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
247
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
248
  " ],\n",
249
- " \"4.CuteColor [Anime] [V3]\": [\n",
250
  " {\"url\": \"https://civitai.com/api/download/models/138754\", \"name\": \"CuteColor_V3.safetensors\"}\n",
251
  " ],\n",
252
- " \"5.Dark-Sushi-Mix [Anime]\": [\n",
253
  " {\"url\": \"https://civitai.com/api/download/models/101640\", \"name\": \"DarkSushiMix_2_5D.safetensors\"},\n",
254
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
255
  " ],\n",
256
- " \"6.Meina-Mix [Anime] [V11] + INP\": [\n",
 
 
 
 
257
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
258
  " {\"url\": \"https://civitai.com/api/download/models/120702\", \"name\": \"MeinaMix_V11-inpainting.safetensors\"}\n",
259
  " ],\n",
260
- " \"7.Mix-Pro [Anime] [V4] + INP\": [\n",
261
  " {\"url\": \"https://civitai.com/api/download/models/125668\", \"name\": \"MixPro_V4.safetensors\"},\n",
262
  " {\"url\": \"https://civitai.com/api/download/models/139878\", \"name\": \"MixPro_V4-inpainting.safetensors\"}\n",
263
- " ],\n",
264
- " \"8.BluMix [Anime] [V7]\": [\n",
265
- " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_v7.safetensors\"}\n",
266
  " ]\n",
267
  "}\n",
268
  "\n",
@@ -342,8 +341,8 @@
342
  " \"model\": [models_dir, \"Model_url\"],\n",
343
  " \"vae\": [vaes_dir, \"Vae_url\"],\n",
344
  " \"lora\": [loras_dir, \"LoRA_url\"],\n",
345
- " \"embeddings\": [embeddings_dir, \"Embedding_url\"],\n",
346
- " \"extensions\": [extensions_dir, \"Extensions_url\"],\n",
347
  " \"control\": [control_dir, \"ControlNet_url\"]\n",
348
  "}\n",
349
  "\n",
@@ -353,7 +352,6 @@
353
  "ControlNet_url = \"\"\n",
354
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
355
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
356
- "# user_header = f\"\\\"Authorization: Bearer {optional_huggingface_token}\\\"\"\n",
357
  "\n",
358
  "def handle_manual(url):\n",
359
  " original_url = url\n",
@@ -365,22 +363,22 @@
365
  "\n",
366
  " for prefix, (dir, _) in prefixes.items():\n",
367
  " if original_url.startswith(f\"{prefix}:\"):\n",
368
- " if prefix != \"extensions\":\n",
369
  " manual_download(url, dir, file_name=file_name)\n",
370
  " else:\n",
371
  " extension_repo.append((url, file_name))\n",
372
  "\n",
373
  "def manual_download(url, dst_dir, file_name):\n",
374
  " basename = url.split(\"/\")[-1] if file_name is None else file_name\n",
375
- " header_option = f\"--header={user_header}\" # if optional_huggingface_token else \"\"\n",
 
 
376
  "\n",
377
  " # I do it at my own risk..... Fucking CivitAi >:(\n",
378
  " civitai_token = \"62c0c5956b2f9defbd844d754000180b\"\n",
379
  " if 'civitai' in url and civitai_token:\n",
380
  " url = f\"{url}?token={civitai_token}\"\n",
381
  "\n",
382
- " print(\"\\033[32m---\"*45 + f\"\\n\\033[33mURL: \\033[34m{url}\\n\\033[33mSAVE DIR: \\033[34m{dst_dir}\\n\\033[33mFILE NAME: \\033[34m{file_name}\\033[32m\\n~~~\\033[0m\")\n",
383
- "\n",
384
  " # -- GDrive --\n",
385
  " if 'drive.google' in url:\n",
386
  " if 'folders' in url:\n",
 
68
  " xformers = \"xformers==0.0.23.post1 triton==2.1.0\"\n",
69
  " torch = \"torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121\"\n",
70
  "\n",
71
+ " print(\"💿 Установка библиотек, это займет какое-то время...\", end='')\n",
72
  " with capture.capture_output() as cap:\n",
73
  " !pip install -U gdown\n",
74
  " !apt-get update && apt -y install aria2\n",
 
87
  " !wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb\n",
88
  "\n",
89
  " if env == \"Google Colab\":\n",
90
+ " !pip install -q pip install xformers==0.0.26.dev778 -U\n",
91
  " else:\n",
92
  " !pip install -q {torch} -U\n",
93
  " !pip install -q {xformers} -U\n",
 
95
  " with open(flag_file, \"w\") as f:\n",
96
  " f.write(\"hey ;3\")\n",
97
  " del cap\n",
98
+ " print(\"\\r🍪 Библиотеки установлены!\" + \" \"*35)\n",
99
  " time.sleep(2)\n",
100
  " clear_output()\n",
101
  "\n",
102
  "\n",
103
+ "# ================= loading settings V4 =================\n",
 
 
104
  "def load_settings(path):\n",
105
  " if os.path.exists(path):\n",
106
  " with open(path, 'r') as file:\n",
107
+ " return json.load(file)\n",
 
 
 
 
108
  " return {}\n",
109
  "\n",
110
+ "settings = load_settings(f'{root_path}/settings.json')\n",
111
  "\n",
112
  "variables = [\n",
113
  " 'Model', 'Model_Num', 'Inpainting_Model',\n",
 
161
  " install_time = timedelta(seconds=time.time()-start_install)\n",
162
  " print(\"\\r🚀 Распаковка Завершена! За\",\"%02d:%02d:%02d ⚡\\n\" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)\n",
163
  "else:\n",
164
+ " if env == \"SageMaker Studio Lab\":\n",
165
+ " !echo -n {start_colab} > {webui_path}/static/colabTimer.txt\n",
166
  " print(\"🚀 Все распакованно... Пропуск. ⚡\")\n",
167
  " start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())\n",
168
  " time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]\n",
 
229
  "## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )\n",
230
  "print(\"📦 Скачивание моделей и прочего...\", end='')\n",
231
  "model_list = {\n",
232
+ " \"1.Anime (by XpucT) + INP\": [\n",
233
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors\", \"name\": \"Anime_v2.safetensors\"},\n",
234
  " {\"url\": \"https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors\", \"name\": \"Anime_v2-inpainting.safetensors\"}\n",
235
  " ],\n",
236
+ " \"2.BluMix [Anime] [V7]\": [\n",
237
+ " {\"url\": \"https://civitai.com/api/download/models/361779\", \"name\": \"BluMix_v7.safetensors\"}\n",
238
+ " ],\n",
239
+ " \"3.Cetus-Mix [Anime] [V4] + INP\": [\n",
240
  " {\"url\": \"https://civitai.com/api/download/models/130298\", \"name\": \"CetusMix_V4.safetensors\"},\n",
241
  " {\"url\": \"https://civitai.com/api/download/models/139882\", \"name\": \"CetusMix_V4-inpainting.safetensors\"}\n",
242
  " ],\n",
243
+ " \"4.Counterfeit [Anime] [V3] + INP\": [\n",
244
  " {\"url\": \"https://civitai.com/api/download/models/125050\", \"name\": \"Counterfeit_V3.safetensors\"},\n",
245
  " {\"url\": \"https://civitai.com/api/download/models/137911\", \"name\": \"Counterfeit_V3-inpainting.safetensors\"}\n",
246
  " ],\n",
247
+ " \"5.CuteColor [Anime] [V3]\": [\n",
248
  " {\"url\": \"https://civitai.com/api/download/models/138754\", \"name\": \"CuteColor_V3.safetensors\"}\n",
249
  " ],\n",
250
+ " \"6.Dark-Sushi-Mix [Anime]\": [\n",
251
  " {\"url\": \"https://civitai.com/api/download/models/101640\", \"name\": \"DarkSushiMix_2_5D.safetensors\"},\n",
252
  " {\"url\": \"https://civitai.com/api/download/models/56071\", \"name\": \"DarkSushiMix_colorful.safetensors\"}\n",
253
  " ],\n",
254
+ " \"7.Deliberate [Realism] [V6] + INP\": [\n",
255
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors\", \"name\": \"Deliberate_v6.safetensors\"},\n",
256
+ " {\"url\": \"https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors\", \"name\": \"Deliberate_v6-inpainting.safetensors\"}\n",
257
+ " ],\n",
258
+ " \"8.Meina-Mix [Anime] [V11] + INP\": [\n",
259
  " {\"url\": \"https://civitai.com/api/download/models/119057\", \"name\": \"MeinaMix_V11.safetensors\"},\n",
260
  " {\"url\": \"https://civitai.com/api/download/models/120702\", \"name\": \"MeinaMix_V11-inpainting.safetensors\"}\n",
261
  " ],\n",
262
+ " \"9.Mix-Pro [Anime] [V4] + INP\": [\n",
263
  " {\"url\": \"https://civitai.com/api/download/models/125668\", \"name\": \"MixPro_V4.safetensors\"},\n",
264
  " {\"url\": \"https://civitai.com/api/download/models/139878\", \"name\": \"MixPro_V4-inpainting.safetensors\"}\n",
 
 
 
265
  " ]\n",
266
  "}\n",
267
  "\n",
 
341
  " \"model\": [models_dir, \"Model_url\"],\n",
342
  " \"vae\": [vaes_dir, \"Vae_url\"],\n",
343
  " \"lora\": [loras_dir, \"LoRA_url\"],\n",
344
+ " \"embed\": [embeddings_dir, \"Embedding_url\"],\n",
345
+ " \"extension\": [extensions_dir, \"Extensions_url\"],\n",
346
  " \"control\": [control_dir, \"ControlNet_url\"]\n",
347
  "}\n",
348
  "\n",
 
352
  "ControlNet_url = \"\"\n",
353
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
354
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
 
355
  "\n",
356
  "def handle_manual(url):\n",
357
  " original_url = url\n",
 
363
  "\n",
364
  " for prefix, (dir, _) in prefixes.items():\n",
365
  " if original_url.startswith(f\"{prefix}:\"):\n",
366
+ " if prefix != \"extension\":\n",
367
  " manual_download(url, dir, file_name=file_name)\n",
368
  " else:\n",
369
  " extension_repo.append((url, file_name))\n",
370
  "\n",
371
  "def manual_download(url, dst_dir, file_name):\n",
372
  " basename = url.split(\"/\")[-1] if file_name is None else file_name\n",
373
+ " header_option = f\"--header={user_header}\"\n",
374
+ "\n",
375
+ " print(\"\\033[32m---\"*45 + f\"\\n\\033[33mURL: \\033[34m{url}\\n\\033[33mSAVE DIR: \\033[34m{dst_dir}\\n\\033[33mFILE NAME: \\033[34m{file_name}\\033[32m\\n~~~\\033[0m\")\n",
376
  "\n",
377
  " # I do it at my own risk..... Fucking CivitAi >:(\n",
378
  " civitai_token = \"62c0c5956b2f9defbd844d754000180b\"\n",
379
  " if 'civitai' in url and civitai_token:\n",
380
  " url = f\"{url}?token={civitai_token}\"\n",
381
  "\n",
 
 
382
  " # -- GDrive --\n",
383
  " if 'drive.google' in url:\n",
384
  " if 'folders' in url:\n",
files_cells/notebooks/ru/widgets_ru.ipynb CHANGED
@@ -21,6 +21,7 @@
21
  "\n",
22
  "import os\n",
23
  "import json\n",
 
24
  "import ipywidgets as widgets\n",
25
  "from ipywidgets import widgets, Layout, Label, Button, VBox, HBox\n",
26
  "from IPython.display import display, HTML, Javascript, clear_output\n",
@@ -62,6 +63,11 @@
62
  "# ---\n",
63
  "url_img, opacity_img, blur_img, y_img, x_img, scale_img, mode_img = args.image, args.opacity, args.blur, args.y, args.x, args.scale, args.mode\n",
64
  "\n",
 
 
 
 
 
65
  "container_background = f'''\n",
66
  "<style>\n",
67
  ":root {{\n",
@@ -72,6 +78,7 @@
72
  " --image_x: {x_img}px;\n",
73
  " --img_scale: {scale_img}%;\n",
74
  " --img_mode: {mode_img};\n",
 
75
  "}}\n",
76
  "\n",
77
  ".widget-dropdown select,\n",
@@ -131,7 +138,7 @@
131
  " content: \"ANXETY\";\n",
132
  " font-weight: bold;\n",
133
  " font-size: 24px;\n",
134
- " color: rgba(0, 0, 0, 0.15);\n",
135
  "}\n",
136
  "\n",
137
  "/* background img */\n",
@@ -161,7 +168,7 @@
161
  " background-position: var(--image_x) calc(-430px - var(--image_y));\n",
162
  "}\n",
163
  ".image_4::before {\n",
164
- " background-position: var(--image_x) calc(-740px - var(--image_y));\n",
165
  "}\n",
166
  "\n",
167
  ".container_custom_downlad {\n",
@@ -220,6 +227,43 @@
220
  "}\n",
221
  "\n",
222
  "\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  "/* Button styles */\n",
224
  "\n",
225
  ".button_save {\n",
@@ -338,6 +382,14 @@
338
  ".button_save {\n",
339
  " animation-name: showedWidgets;\n",
340
  " animation-duration: 1s;\n",
 
 
 
 
 
 
 
 
341
  "}\n",
342
  "\n",
343
  "@keyframes showedWidgets {\n",
@@ -352,6 +404,19 @@
352
  " opacity: 1;\n",
353
  " }\n",
354
  "}\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
355
  "</style>\n",
356
  "\n",
357
  "<!-- TOGGLE 'CustomDL' SCRIPT -->\n",
@@ -380,20 +445,23 @@
380
  "# --- MODEL ---\n",
381
  "model_header = widgets.HTML('<div class=\"header\">Выбор Модели<div>')\n",
382
  "model_options = ['none',\n",
383
- " '1.Anime (by Xpuct) + INP',\n",
384
- " '2.Cetus-Mix [Anime] [V4] + INP',\n",
385
- " '3.Counterfeit [Anime] [V3] + INP',\n",
386
- " '4.CuteColor [Anime] [V3]',\n",
387
- " '5.Dark-Sushi-Mix [Anime]',\n",
388
- " '6.Meina-Mix [Anime] [V11] + INP',\n",
389
- " '7.Mix-Pro [Anime] [V4] + INP',\n",
390
- " '8.BluMix [Anime] [V7]']\n",
 
391
  "# ---\n",
392
- "Model_widget = widgets.Dropdown(options=model_options, value='3.Counterfeit [Anime] [V3] + INP', description='Модель:', style=style, layout=layout)\n",
393
  "Model_Num_widget = widgets.Text(description='Номер Модели:', placeholder='Введите номера моделей для скачивания через запятую/пробел.', style=style, layout=layout)\n",
394
  "Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Модели', style=style)\n",
395
  "\n",
396
- "display(widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class(\"container\").add_class(\"image_1\"))\n",
 
 
397
  "\n",
398
  "# --- VAE ---\n",
399
  "vae_header = widgets.HTML('<div class=\"header\" >Выбор VAE</div>')\n",
@@ -406,7 +474,9 @@
406
  "Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)\n",
407
  "Vae_Num_widget = widgets.Text(description='Номер Vae:', placeholder='Введите номера vae для скачивания через запятую/пробел.', style=style, layout=layout)\n",
408
  "\n",
409
- "display(widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class(\"container\").add_class(\"image_2\"))\n",
 
 
410
  "\n",
411
  "# --- ADDITIONAL ---\n",
412
  "additional_header = widgets.HTML('<div class=\"header\">Дополнительно</div>')\n",
@@ -433,10 +503,13 @@
433
  "commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
434
  "commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)\n",
435
  "\n",
 
436
  "additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]\n",
437
  "if free_plan and env == \"Google Colab\":\n",
438
  " additional_widget_list.remove(ngrok_widget)\n",
439
- "display(widgets.VBox(additional_widget_list).add_class(\"container\").add_class(\"image_3\"))\n",
 
 
440
  "\n",
441
  "# --- CUSTOM DOWNLOAD ---\n",
442
  "custom_download_header_popup = widgets.HTML('''\n",
@@ -450,7 +523,7 @@
450
  "\n",
451
  "<div class=\"header\" style=\"cursor: pointer;\" onclick=\"toggleContainer()\">Кастомная Загрузка</div>\n",
452
  "<!-- PopUp window -->\n",
453
- "<div class=\"info\" id=\"info_dl\">FAQ?</div>\n",
454
  "<div class=\"popup\">\n",
455
  " Разделите несколько URL-адресов запятой/пробелом. Для <span class=\"file_name\">пользовательского имени</span> файла/расширения укажите его через <span class=\"braces\">[]</span>\n",
456
  " после URL без пробелов.\n",
@@ -472,49 +545,50 @@
472
  "Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)\n",
473
  "custom_file_urls_widget = widgets.Text(description='Файл (txt):', style=style, layout=layout)\n",
474
  "\n",
475
- "display(widgets.VBox([\n",
 
476
  " custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget\n",
477
- " ]).add_class(\"container\").add_class(\"image_4\").add_class(\"container_custom_downlad\"))\n",
 
478
  "\n",
479
  "# --- Save Button ---\n",
480
  "save_button = widgets.Button(description='Сохранить').add_class(\"button_save\")\n",
481
  "display(save_button)\n",
482
  "\n",
483
  "\n",
484
- "# ============ Load / Save - Settings V3 ============\n",
485
- "try:\n",
486
- " import toml\n",
487
- "except ImportError: # SageMaker - only for you...\n",
488
- " !pip install toml > /dev/null 2>&1\n",
489
- " import toml\n",
490
  "\n",
491
- "SETTINGS_FILE = f'{root_path}/settings.toml'\n",
492
- "\n",
493
- "settings_structure = {\n",
494
- " \"Model\": ['Model', 'Model_Num', 'Inpainting_Model'],\n",
495
- " \"Vae\": ['Vae', 'Vae_Num'],\n",
496
- " \"Additional\": ['latest_webui', 'latest_exstensions', 'detailed_download', 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token', 'ngrok_token', 'commandline_arguments'],\n",
497
- " \"CustomUrl\": ['Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls']\n",
498
- "}\n",
499
  "\n",
500
  "def save_settings():\n",
501
- " settings = {}\n",
502
- " for section, keys in settings_structure.items():\n",
503
- " settings[section] = {key: globals()[f\"{key}_widget\"].value for key in keys}\n",
504
  " with open(SETTINGS_FILE, 'w') as f:\n",
505
- " toml.dump(settings, f)\n",
506
  "\n",
507
  "def load_settings():\n",
508
  " if os.path.exists(SETTINGS_FILE):\n",
509
  " with open(SETTINGS_FILE, 'r') as f:\n",
510
- " loaded_settings = toml.load(f)\n",
511
- " for section, keys in settings_structure.items():\n",
512
- " for key in keys:\n",
513
- " if key in loaded_settings[section]:\n",
514
- " globals()[f\"{key}_widget\"].value = loaded_settings[section][key]\n",
515
  "\n",
516
  "def save_data(button):\n",
517
  " save_settings()\n",
 
 
 
 
 
 
 
518
  " widgets.Widget.close_all()\n",
519
  "\n",
520
  "settings = load_settings()\n",
 
21
  "\n",
22
  "import os\n",
23
  "import json\n",
24
+ "import time\n",
25
  "import ipywidgets as widgets\n",
26
  "from ipywidgets import widgets, Layout, Label, Button, VBox, HBox\n",
27
  "from IPython.display import display, HTML, Javascript, clear_output\n",
 
63
  "# ---\n",
64
  "url_img, opacity_img, blur_img, y_img, x_img, scale_img, mode_img = args.image, args.opacity, args.blur, args.y, args.x, args.scale, args.mode\n",
65
  "\n",
66
+ "# WTF COLAB - WHAT THE FUCK IS THE DIFFERENCE OF 40 PIXELS!?!?!?\n",
67
+ "fix_heigh_img = \"-780px\"\n",
68
+ "if env == \"Google Colab\": # betrayal..\n",
69
+ " fix_heigh_img = \"-740px\"\n",
70
+ "\n",
71
  "container_background = f'''\n",
72
  "<style>\n",
73
  ":root {{\n",
 
78
  " --image_x: {x_img}px;\n",
79
  " --img_scale: {scale_img}%;\n",
80
  " --img_mode: {mode_img};\n",
81
+ " --img_height_dif: {fix_heigh_img}\n",
82
  "}}\n",
83
  "\n",
84
  ".widget-dropdown select,\n",
 
138
  " content: \"ANXETY\";\n",
139
  " font-weight: bold;\n",
140
  " font-size: 24px;\n",
141
+ " color: rgba(0, 0, 0, 0.2);\n",
142
  "}\n",
143
  "\n",
144
  "/* background img */\n",
 
168
  " background-position: var(--image_x) calc(-430px - var(--image_y));\n",
169
  "}\n",
170
  ".image_4::before {\n",
171
+ " background-position: var(--image_x) calc(var(--img_height_dif) - var(--image_y));\n",
172
  "}\n",
173
  "\n",
174
  ".container_custom_downlad {\n",
 
227
  "}\n",
228
  "\n",
229
  "\n",
230
+ "/* Slider Checkbox style */\n",
231
+ "\n",
232
+ ".widget-checkbox input[type=\"checkbox\"] {\n",
233
+ " appearance: none;\n",
234
+ " position: relative;\n",
235
+ " top: 4px; /* Why is he taller?! */\n",
236
+ " width: 40px;\n",
237
+ " height: 20px;\n",
238
+ " border: none;\n",
239
+ " border-radius: 10px;\n",
240
+ " background-color: #20b2aa;\n",
241
+ " cursor: pointer;\n",
242
+ " box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);\n",
243
+ " transition: background-color 0.3s ease;\n",
244
+ "}\n",
245
+ ".widget-checkbox input[type=\"checkbox\"]:checked {\n",
246
+ " background-color: #2196F3;\n",
247
+ "}\n",
248
+ "\n",
249
+ ".widget-checkbox input[type=\"checkbox\"]:before {\n",
250
+ " content: '';\n",
251
+ " position: absolute;\n",
252
+ " top: 50%;\n",
253
+ " left: 3px;\n",
254
+ " width: 16px;\n",
255
+ " height: 16px;\n",
256
+ " border-radius: inherit;\n",
257
+ " background-color: white;\n",
258
+ " box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);\n",
259
+ " transform: translateY(-50%);\n",
260
+ " transition: left 0.3s ease;\n",
261
+ "}\n",
262
+ ".widget-checkbox input[type=\"checkbox\"]:checked:before {\n",
263
+ " left: 21px;\n",
264
+ "}\n",
265
+ "\n",
266
+ "\n",
267
  "/* Button styles */\n",
268
  "\n",
269
  ".button_save {\n",
 
382
  ".button_save {\n",
383
  " animation-name: showedWidgets;\n",
384
  " animation-duration: 1s;\n",
385
+ " animation-fill-mode: forwards;\n",
386
+ "}\n",
387
+ "\n",
388
+ ".container.hide,\n",
389
+ ".button_save.hide {\n",
390
+ " animation-name: hideWidgets;\n",
391
+ " animation-duration: 0.5s;\n",
392
+ " animation-fill-mode: forwards;\n",
393
  "}\n",
394
  "\n",
395
  "@keyframes showedWidgets {\n",
 
404
  " opacity: 1;\n",
405
  " }\n",
406
  "}\n",
407
+ "\n",
408
+ "@keyframes hideWidgets {\n",
409
+ " 0% {\n",
410
+ " transform: translate3d(0, 0, 0) scale(1);\n",
411
+ " filter: blur(0) grayscale(0) brightness(1);\n",
412
+ " opacity: 1;\n",
413
+ " }\n",
414
+ " 100% {\n",
415
+ " transform: translate3d(0, 5%, 0) scale(0.9);\n",
416
+ " filter: blur(15px) grayscale(1) brightness(0.5);\n",
417
+ " opacity: 0;\n",
418
+ " }\n",
419
+ "}\n",
420
  "</style>\n",
421
  "\n",
422
  "<!-- TOGGLE 'CustomDL' SCRIPT -->\n",
 
445
  "# --- MODEL ---\n",
446
  "model_header = widgets.HTML('<div class=\"header\">Выбор Модели<div>')\n",
447
  "model_options = ['none',\n",
448
+ " '1.Anime (by XpucT) + INP',\n",
449
+ " '2.BluMix [Anime] [V7]',\n",
450
+ " '3.Cetus-Mix [Anime] [V4] + INP',\n",
451
+ " '4.Counterfeit [Anime] [V3] + INP',\n",
452
+ " '5.CuteColor [Anime] [V3]',\n",
453
+ " '6.Dark-Sushi-Mix [Anime]',\n",
454
+ " '7.Deliberate [Realism] [V6] + INP',\n",
455
+ " '8.Meina-Mix [Anime] [V11] + INP',\n",
456
+ " '9.Mix-Pro [Anime] [V4] + INP']\n",
457
  "# ---\n",
458
+ "Model_widget = widgets.Dropdown(options=model_options, value='4.Counterfeit [Anime] [V3] + INP', description='Модель:', style=style, layout=layout)\n",
459
  "Model_Num_widget = widgets.Text(description='Номер Модели:', placeholder='Введите номера моделей для скачивания через запятую/пробел.', style=style, layout=layout)\n",
460
  "Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Модели', style=style)\n",
461
  "\n",
462
+ "''' Display Model'''\n",
463
+ "all_model_box = widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class(\"container\").add_class(\"image_1\")\n",
464
+ "display(all_model_box)\n",
465
  "\n",
466
  "# --- VAE ---\n",
467
  "vae_header = widgets.HTML('<div class=\"header\" >Выбор VAE</div>')\n",
 
474
  "Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)\n",
475
  "Vae_Num_widget = widgets.Text(description='Номер Vae:', placeholder='Введите номера vae для скачивания через запятую/пробел.', style=style, layout=layout)\n",
476
  "\n",
477
+ "''' Display Vae'''\n",
478
+ "all_vae_box= widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class(\"container\").add_class(\"image_2\")\n",
479
+ "display(all_vae_box)\n",
480
  "\n",
481
  "# --- ADDITIONAL ---\n",
482
  "additional_header = widgets.HTML('<div class=\"header\">Дополнительно</div>')\n",
 
503
  "commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
504
  "commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)\n",
505
  "\n",
506
+ "''' Display Additional'''\n",
507
  "additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]\n",
508
  "if free_plan and env == \"Google Colab\":\n",
509
  " additional_widget_list.remove(ngrok_widget)\n",
510
+ "# ```\n",
511
+ "all_additional_box = widgets.VBox(additional_widget_list).add_class(\"container\").add_class(\"image_3\")\n",
512
+ "display(all_additional_box)\n",
513
  "\n",
514
  "# --- CUSTOM DOWNLOAD ---\n",
515
  "custom_download_header_popup = widgets.HTML('''\n",
 
523
  "\n",
524
  "<div class=\"header\" style=\"cursor: pointer;\" onclick=\"toggleContainer()\">Кастомная Загрузка</div>\n",
525
  "<!-- PopUp window -->\n",
526
+ "<div class=\"info\" id=\"info_dl\">INFO</div>\n",
527
  "<div class=\"popup\">\n",
528
  " Разделите несколько URL-адресов запятой/пробелом. Для <span class=\"file_name\">пользовательского имени</span> файла/расширения укажите его через <span class=\"braces\">[]</span>\n",
529
  " после URL без пробелов.\n",
 
545
  "Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)\n",
546
  "custom_file_urls_widget = widgets.Text(description='Файл (txt):', style=style, layout=layout)\n",
547
  "\n",
548
+ "''' Display CustomDl'''\n",
549
+ "all_custom_box = widgets.VBox([\n",
550
  " custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget\n",
551
+ " ]).add_class(\"container\").add_class(\"image_4\").add_class(\"container_custom_downlad\")\n",
552
+ "display(all_custom_box)\n",
553
  "\n",
554
  "# --- Save Button ---\n",
555
  "save_button = widgets.Button(description='Сохранить').add_class(\"button_save\")\n",
556
  "display(save_button)\n",
557
  "\n",
558
  "\n",
559
+ "# ============ Load / Save - Settings V2 ============\n",
560
+ "SETTINGS_FILE = f'{root_path}/settings.json'\n",
 
 
 
 
561
  "\n",
562
+ "settings_keys = [\n",
563
+ " 'Model', 'Model_Num', 'Inpainting_Model',\n",
564
+ " 'Vae', 'Vae_Num',\n",
565
+ " 'latest_webui', 'latest_exstensions', 'detailed_download',\n",
566
+ " 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',\n",
567
+ " 'ngrok_token', 'commandline_arguments',\n",
568
+ " 'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'\n",
569
+ "]\n",
570
  "\n",
571
  "def save_settings():\n",
572
+ " settings = {key: globals()[f\"{key}_widget\"].value for key in settings_keys}\n",
 
 
573
  " with open(SETTINGS_FILE, 'w') as f:\n",
574
+ " json.dump(settings, f)\n",
575
  "\n",
576
  "def load_settings():\n",
577
  " if os.path.exists(SETTINGS_FILE):\n",
578
  " with open(SETTINGS_FILE, 'r') as f:\n",
579
+ " settings = json.load(f)\n",
580
+ " for key in settings_keys:\n",
581
+ " globals()[f\"{key}_widget\"].value = settings.get(key)\n",
 
 
582
  "\n",
583
  "def save_data(button):\n",
584
  " save_settings()\n",
585
+ "\n",
586
+ " # --- uhh - hide... ---\n",
587
+ " widgets_list = [all_model_box, all_vae_box, all_additional_box, all_custom_box, save_button]\n",
588
+ " for widget in widgets_list:\n",
589
+ " widget.add_class(\"hide\")\n",
590
+ " time.sleep(0.5)\n",
591
+ "\n",
592
  " widgets.Widget.close_all()\n",
593
  "\n",
594
  "settings = load_settings()\n",
files_cells/python/en/downloading_en.py CHANGED
@@ -49,7 +49,7 @@ if not os.path.exists(flag_file):
49
  xformers = "xformers==0.0.23.post1 triton==2.1.0"
50
  torch = "torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121"
51
 
52
- print("Installing the libraries, it's going to take a while....", end='')
53
  with capture.capture_output() as cap:
54
  get_ipython().system('pip install -U gdown')
55
  get_ipython().system('apt-get update && apt -y install aria2')
@@ -68,7 +68,7 @@ if not os.path.exists(flag_file):
68
  get_ipython().system('wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb')
69
 
70
  if env == "Google Colab":
71
- get_ipython().system('pip install -q pip install xformers==0.0.26.dev769 -U')
72
  else:
73
  get_ipython().system('pip install -q {torch} -U')
74
  get_ipython().system('pip install -q {xformers} -U')
@@ -76,25 +76,19 @@ if not os.path.exists(flag_file):
76
  with open(flag_file, "w") as f:
77
  f.write("hey ;3")
78
  del cap
79
- print("\rLibraries are installed!" + " "*35)
80
  time.sleep(2)
81
  clear_output()
82
 
83
 
84
- # ================= loading settings V5 =================
85
- import toml
86
-
87
  def load_settings(path):
88
  if os.path.exists(path):
89
  with open(path, 'r') as file:
90
- settings = toml.load(file)
91
- flat_settings = {}
92
- for section, keys in settings.items():
93
- flat_settings.update(keys)
94
- return flat_settings
95
  return {}
96
 
97
- settings = load_settings(f'{root_path}/settings.toml')
98
 
99
  variables = [
100
  'Model', 'Model_Num', 'Inpainting_Model',
@@ -148,7 +142,8 @@ if not os.path.exists(webui_path):
148
  install_time = timedelta(seconds=time.time()-start_install)
149
  print("\r🚀 Unpacking is complete! For","%02d:%02d:%02d ⚡\n" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)
150
  else:
151
- get_ipython().system('echo -n {start_colab} > {webui_path}/static/colabTimer.txt')
 
152
  print("🚀 All unpacked... Skip. ⚡")
153
  start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())
154
  time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]
@@ -215,35 +210,39 @@ if commit_hash:
215
  ## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )
216
  print("📦 Downloading models and stuff...", end='')
217
  model_list = {
218
- "1.Anime (by Xpuct) + INP": [
219
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_v2.safetensors"},
220
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_v2-inpainting.safetensors"}
221
  ],
222
- "2.Cetus-Mix [Anime] [V4] + INP": [
 
 
 
223
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
224
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
225
  ],
226
- "3.Counterfeit [Anime] [V3] + INP": [
227
  {"url": "https://civitai.com/api/download/models/125050", "name": "Counterfeit_V3.safetensors"},
228
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
229
  ],
230
- "4.CuteColor [Anime] [V3]": [
231
  {"url": "https://civitai.com/api/download/models/138754", "name": "CuteColor_V3.safetensors"}
232
  ],
233
- "5.Dark-Sushi-Mix [Anime]": [
234
  {"url": "https://civitai.com/api/download/models/101640", "name": "DarkSushiMix_2_5D.safetensors"},
235
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
236
  ],
237
- "6.Meina-Mix [Anime] [V11] + INP": [
 
 
 
 
238
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
239
  {"url": "https://civitai.com/api/download/models/120702", "name": "MeinaMix_V11-inpainting.safetensors"}
240
  ],
241
- "7.Mix-Pro [Anime] [V4] + INP": [
242
  {"url": "https://civitai.com/api/download/models/125668", "name": "MixPro_V4.safetensors"},
243
  {"url": "https://civitai.com/api/download/models/139878", "name": "MixPro_V4-inpainting.safetensors"}
244
- ],
245
- "8.BluMix [Anime] [V7]": [
246
- {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_v7.safetensors"}
247
  ]
248
  }
249
 
@@ -323,8 +322,8 @@ prefixes = {
323
  "model": [models_dir, "Model_url"],
324
  "vae": [vaes_dir, "Vae_url"],
325
  "lora": [loras_dir, "LoRA_url"],
326
- "embeddings": [embeddings_dir, "Embedding_url"],
327
- "extensions": [extensions_dir, "Extensions_url"],
328
  "control": [control_dir, "ControlNet_url"]
329
  }
330
 
@@ -334,7 +333,6 @@ url = ""
334
  ControlNet_url = ""
335
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
336
  user_header = f"\"Authorization: Bearer {hf_token}\""
337
- # user_header = f"\"Authorization: Bearer {optional_huggingface_token}\""
338
 
339
  def handle_manual(url):
340
  original_url = url
@@ -346,22 +344,22 @@ def handle_manual(url):
346
 
347
  for prefix, (dir, _) in prefixes.items():
348
  if original_url.startswith(f"{prefix}:"):
349
- if prefix != "extensions":
350
  manual_download(url, dir, file_name=file_name)
351
  else:
352
  extension_repo.append((url, file_name))
353
 
354
  def manual_download(url, dst_dir, file_name):
355
  basename = url.split("/")[-1] if file_name is None else file_name
356
- header_option = f"--header={user_header}" # if optional_huggingface_token else ""
 
 
357
 
358
  # I do it at my own risk..... Fucking CivitAi >:(
359
  civitai_token = "62c0c5956b2f9defbd844d754000180b"
360
  if 'civitai' in url and civitai_token:
361
  url = f"{url}?token={civitai_token}"
362
 
363
- print("\033[32m---"*45 + f"\n\033[33mURL: \033[34m{url}\n\033[33mSAVE DIR: \033[34m{dst_dir}\n\033[33mFILE NAME: \033[34m{file_name}\033[32m\n~~~\033[0m")
364
-
365
  # -- GDrive --
366
  if 'drive.google' in url:
367
  if 'folders' in url:
 
49
  xformers = "xformers==0.0.23.post1 triton==2.1.0"
50
  torch = "torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121"
51
 
52
+ print("💿 Installing the libraries, it's going to take a while...", end='')
53
  with capture.capture_output() as cap:
54
  get_ipython().system('pip install -U gdown')
55
  get_ipython().system('apt-get update && apt -y install aria2')
 
68
  get_ipython().system('wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb')
69
 
70
  if env == "Google Colab":
71
+ get_ipython().system('pip install -q pip install xformers==0.0.26.dev778 -U')
72
  else:
73
  get_ipython().system('pip install -q {torch} -U')
74
  get_ipython().system('pip install -q {xformers} -U')
 
76
  with open(flag_file, "w") as f:
77
  f.write("hey ;3")
78
  del cap
79
+ print("\r🍪 Libraries are installed!" + " "*35)
80
  time.sleep(2)
81
  clear_output()
82
 
83
 
84
+ # ================= loading settings V4 =================
 
 
85
  def load_settings(path):
86
  if os.path.exists(path):
87
  with open(path, 'r') as file:
88
+ return json.load(file)
 
 
 
 
89
  return {}
90
 
91
+ settings = load_settings(f'{root_path}/settings.json')
92
 
93
  variables = [
94
  'Model', 'Model_Num', 'Inpainting_Model',
 
142
  install_time = timedelta(seconds=time.time()-start_install)
143
  print("\r🚀 Unpacking is complete! For","%02d:%02d:%02d ⚡\n" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)
144
  else:
145
+ if env == "SageMaker Studio Lab":
146
+ get_ipython().system('echo -n {start_colab} > {webui_path}/static/colabTimer.txt')
147
  print("🚀 All unpacked... Skip. ⚡")
148
  start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())
149
  time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]
 
210
  ## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )
211
  print("📦 Downloading models and stuff...", end='')
212
  model_list = {
213
+ "1.Anime (by XpucT) + INP": [
214
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_v2.safetensors"},
215
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_v2-inpainting.safetensors"}
216
  ],
217
+ "2.BluMix [Anime] [V7]": [
218
+ {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_v7.safetensors"}
219
+ ],
220
+ "3.Cetus-Mix [Anime] [V4] + INP": [
221
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
222
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
223
  ],
224
+ "4.Counterfeit [Anime] [V3] + INP": [
225
  {"url": "https://civitai.com/api/download/models/125050", "name": "Counterfeit_V3.safetensors"},
226
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
227
  ],
228
+ "5.CuteColor [Anime] [V3]": [
229
  {"url": "https://civitai.com/api/download/models/138754", "name": "CuteColor_V3.safetensors"}
230
  ],
231
+ "6.Dark-Sushi-Mix [Anime]": [
232
  {"url": "https://civitai.com/api/download/models/101640", "name": "DarkSushiMix_2_5D.safetensors"},
233
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
234
  ],
235
+ "7.Deliberate [Realism] [V6] + INP": [
236
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors", "name": "Deliberate_v6.safetensors"},
237
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors", "name": "Deliberate_v6-inpainting.safetensors"}
238
+ ],
239
+ "8.Meina-Mix [Anime] [V11] + INP": [
240
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
241
  {"url": "https://civitai.com/api/download/models/120702", "name": "MeinaMix_V11-inpainting.safetensors"}
242
  ],
243
+ "9.Mix-Pro [Anime] [V4] + INP": [
244
  {"url": "https://civitai.com/api/download/models/125668", "name": "MixPro_V4.safetensors"},
245
  {"url": "https://civitai.com/api/download/models/139878", "name": "MixPro_V4-inpainting.safetensors"}
 
 
 
246
  ]
247
  }
248
 
 
322
  "model": [models_dir, "Model_url"],
323
  "vae": [vaes_dir, "Vae_url"],
324
  "lora": [loras_dir, "LoRA_url"],
325
+ "embed": [embeddings_dir, "Embedding_url"],
326
+ "extension": [extensions_dir, "Extensions_url"],
327
  "control": [control_dir, "ControlNet_url"]
328
  }
329
 
 
333
  ControlNet_url = ""
334
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
335
  user_header = f"\"Authorization: Bearer {hf_token}\""
 
336
 
337
  def handle_manual(url):
338
  original_url = url
 
344
 
345
  for prefix, (dir, _) in prefixes.items():
346
  if original_url.startswith(f"{prefix}:"):
347
+ if prefix != "extension":
348
  manual_download(url, dir, file_name=file_name)
349
  else:
350
  extension_repo.append((url, file_name))
351
 
352
  def manual_download(url, dst_dir, file_name):
353
  basename = url.split("/")[-1] if file_name is None else file_name
354
+ header_option = f"--header={user_header}"
355
+
356
+ print("\033[32m---"*45 + f"\n\033[33mURL: \033[34m{url}\n\033[33mSAVE DIR: \033[34m{dst_dir}\n\033[33mFILE NAME: \033[34m{file_name}\033[32m\n~~~\033[0m")
357
 
358
  # I do it at my own risk..... Fucking CivitAi >:(
359
  civitai_token = "62c0c5956b2f9defbd844d754000180b"
360
  if 'civitai' in url and civitai_token:
361
  url = f"{url}?token={civitai_token}"
362
 
 
 
363
  # -- GDrive --
364
  if 'drive.google' in url:
365
  if 'folders' in url:
files_cells/python/en/widgets_en.py CHANGED
@@ -2,6 +2,7 @@
2
 
3
  import os
4
  import json
 
5
  import ipywidgets as widgets
6
  from ipywidgets import widgets, Layout, Label, Button, VBox, HBox
7
  from IPython.display import display, HTML, Javascript, clear_output
@@ -43,6 +44,11 @@ args = parser.parse_args()
43
  # ---
44
  url_img, opacity_img, blur_img, y_img, x_img, scale_img, mode_img = args.image, args.opacity, args.blur, args.y, args.x, args.scale, args.mode
45
 
 
 
 
 
 
46
  container_background = f'''
47
  <style>
48
  :root {{
@@ -53,6 +59,7 @@ container_background = f'''
53
  --image_x: {x_img}px;
54
  --img_scale: {scale_img}%;
55
  --img_mode: {mode_img};
 
56
  }}
57
 
58
  .widget-dropdown select,
@@ -112,7 +119,7 @@ hr {
112
  content: "ANXETY";
113
  font-weight: bold;
114
  font-size: 24px;
115
- color: rgba(0, 0, 0, 0.15);
116
  }
117
 
118
  /* background img */
@@ -142,7 +149,7 @@ hr {
142
  background-position: var(--image_x) calc(-430px - var(--image_y));
143
  }
144
  .image_4::before {
145
- background-position: var(--image_x) calc(-740px - var(--image_y));
146
  }
147
 
148
  .container_custom_downlad {
@@ -201,6 +208,43 @@ hr {
201
  }
202
 
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  /* Button styles */
205
 
206
  .button_save {
@@ -319,6 +363,14 @@ hr {
319
  .button_save {
320
  animation-name: showedWidgets;
321
  animation-duration: 1s;
 
 
 
 
 
 
 
 
322
  }
323
 
324
  @keyframes showedWidgets {
@@ -333,6 +385,19 @@ hr {
333
  opacity: 1;
334
  }
335
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
336
  </style>
337
 
338
  <!-- TOGGLE 'CustomDL' SCRIPT -->
@@ -361,20 +426,23 @@ HR = widgets.HTML('<hr>')
361
  # --- MODEL ---
362
  model_header = widgets.HTML('<div class="header">Model Selection<div>')
363
  model_options = ['none',
364
- '1.Anime (by Xpuct) + INP',
365
- '2.Cetus-Mix [Anime] [V4] + INP',
366
- '3.Counterfeit [Anime] [V3] + INP',
367
- '4.CuteColor [Anime] [V3]',
368
- '5.Dark-Sushi-Mix [Anime]',
369
- '6.Meina-Mix [Anime] [V11] + INP',
370
- '7.Mix-Pro [Anime] [V4] + INP',
371
- '8.BluMix [Anime] [V7]']
 
372
  # ---
373
- Model_widget = widgets.Dropdown(options=model_options, value='3.Counterfeit [Anime] [V3] + INP', description='Model:', style=style, layout=layout)
374
  Model_Num_widget = widgets.Text(description='Model Number:', placeholder='Enter the model numbers to be downloaded using comma/space.', style=style, layout=layout)
375
  Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Models', style=style)
376
 
377
- display(widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class("container").add_class("image_1"))
 
 
378
 
379
  # --- VAE ---
380
  vae_header = widgets.HTML('<div class="header" >VAE Selection</div>')
@@ -385,9 +453,11 @@ vae_options = ['none',
385
  '4.ClearVae.vae',
386
  '5.WD.vae']
387
  Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)
388
- Vae_Num_widget = widgets.Text(description='Vae number:', placeholder='Enter the vae numbers to be downloaded using comma/space.', style=style, layout=layout)
389
 
390
- display(widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class("container").add_class("image_2"))
 
 
391
 
392
  # --- ADDITIONAL ---
393
  additional_header = widgets.HTML('<div class="header">Additional</div>')
@@ -406,18 +476,21 @@ controlnet_options = ['none', 'ALL', '1.canny',
406
  controlnet_widget = widgets.Dropdown(options=controlnet_options, value='none', description='ControlNet:', style=style, layout=layout)
407
  controlnet_Num_widget = widgets.Text(description='ControlNet Number:', placeholder='Enter the ControlNet model numbers to be downloaded using comma/space.', style=style, layout=layout)
408
  commit_hash_widget = widgets.Text(description='Commit Hash:', style=style, layout=layout)
409
- optional_huggingface_token_widget = widgets.Text(description='Huggingface token:', style=style, layout=layout)
410
- ngrok_token_widget = widgets.Text(description='Ngrok token:', style=style, layout=widgets.Layout(width='1047px'))
411
  ngrock_button = widgets.HTML('<a href="https://dashboard.ngrok.com/get-started/your-authtoken" target="_blank">Get Ngrok Token</a>').add_class("button_ngrok")
412
  ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, layout=layout)
413
  # ---
414
  commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
415
  commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)
416
 
 
417
  additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]
418
  if free_plan and env == "Google Colab":
419
  additional_widget_list.remove(ngrok_widget)
420
- display(widgets.VBox(additional_widget_list).add_class("container").add_class("image_3"))
 
 
421
 
422
  # --- CUSTOM DOWNLOAD ---
423
  custom_download_header_popup = widgets.HTML('''
@@ -431,7 +504,7 @@ custom_download_header_popup = widgets.HTML('''
431
 
432
  <div class="header" style="cursor: pointer;" onclick="toggleContainer()">Custom Download</div>
433
  <!-- PopUp Window -->
434
- <div class="info">FAQ?</div>
435
  <div class="popup">
436
  Separate multiple URLs with a comma/space. For a <span class="file_name">custom name</span> file/extension, specify it with <span class="braces">[]</span>
437
  after the URL without spaces.
@@ -453,9 +526,11 @@ Embedding_url_widget = widgets.Text(description='Embedding:', style=style, layou
453
  Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)
454
  custom_file_urls_widget = widgets.Text(description='File (txt):', style=style, layout=layout)
455
 
456
- display(widgets.VBox([
 
457
  custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget
458
- ]).add_class("container").add_class("image_4").add_class("container_custom_downlad"))
 
459
 
460
  # --- Save Button ---
461
  save_button = widgets.Button(description='Save').add_class("button_save")
@@ -463,39 +538,38 @@ display(save_button)
463
 
464
 
465
  # ============ Load / Save - Settings V2 ============
466
- try:
467
- import toml
468
- except ImportError: # SageMaker - only for you...
469
- get_ipython().system('pip install toml > /dev/null 2>&1')
470
- import toml
471
 
472
- SETTINGS_FILE = f'{root_path}/settings.toml'
473
-
474
- settings_structure = {
475
- "Model": ['Model', 'Model_Num', 'Inpainting_Model'],
476
- "Vae": ['Vae', 'Vae_Num'],
477
- "Additional": ['latest_webui', 'latest_exstensions', 'detailed_download', 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token', 'ngrok_token', 'commandline_arguments'],
478
- "CustomUrl": ['Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls']
479
- }
480
 
481
  def save_settings():
482
- settings = {}
483
- for section, keys in settings_structure.items():
484
- settings[section] = {key: globals()[f"{key}_widget"].value for key in keys}
485
  with open(SETTINGS_FILE, 'w') as f:
486
- toml.dump(settings, f)
487
 
488
  def load_settings():
489
  if os.path.exists(SETTINGS_FILE):
490
  with open(SETTINGS_FILE, 'r') as f:
491
- loaded_settings = toml.load(f)
492
- for section, keys in settings_structure.items():
493
- for key in keys:
494
- if key in loaded_settings[section]:
495
- globals()[f"{key}_widget"].value = loaded_settings[section][key]
496
 
497
  def save_data(button):
498
  save_settings()
 
 
 
 
 
 
 
499
  widgets.Widget.close_all()
500
 
501
  settings = load_settings()
 
2
 
3
  import os
4
  import json
5
+ import time
6
  import ipywidgets as widgets
7
  from ipywidgets import widgets, Layout, Label, Button, VBox, HBox
8
  from IPython.display import display, HTML, Javascript, clear_output
 
44
  # ---
45
  url_img, opacity_img, blur_img, y_img, x_img, scale_img, mode_img = args.image, args.opacity, args.blur, args.y, args.x, args.scale, args.mode
46
 
47
+ # WTF COLAB - WHAT THE FUCK IS THE DIFFERENCE OF 40 PIXELS!?!?!?
48
+ fix_heigh_img = "-780px"
49
+ if env == "Google Colab": # betrayal..
50
+ fix_heigh_img = "-740px"
51
+
52
  container_background = f'''
53
  <style>
54
  :root {{
 
59
  --image_x: {x_img}px;
60
  --img_scale: {scale_img}%;
61
  --img_mode: {mode_img};
62
+ --img_height_dif: {fix_heigh_img}
63
  }}
64
 
65
  .widget-dropdown select,
 
119
  content: "ANXETY";
120
  font-weight: bold;
121
  font-size: 24px;
122
+ color: rgba(0, 0, 0, 0.2);
123
  }
124
 
125
  /* background img */
 
149
  background-position: var(--image_x) calc(-430px - var(--image_y));
150
  }
151
  .image_4::before {
152
+ background-position: var(--image_x) calc(var(--img_height_dif) - var(--image_y));
153
  }
154
 
155
  .container_custom_downlad {
 
208
  }
209
 
210
 
211
+ /* Slider Checkbox style */
212
+
213
+ .widget-checkbox input[type="checkbox"] {
214
+ appearance: none;
215
+ position: relative;
216
+ top: 4px; /* Why is he taller?! */
217
+ width: 40px;
218
+ height: 20px;
219
+ border: none;
220
+ border-radius: 10px;
221
+ background-color: #20b2aa;
222
+ cursor: pointer;
223
+ box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
224
+ transition: background-color 0.3s ease;
225
+ }
226
+ .widget-checkbox input[type="checkbox"]:checked {
227
+ background-color: #2196F3;
228
+ }
229
+
230
+ .widget-checkbox input[type="checkbox"]:before {
231
+ content: '';
232
+ position: absolute;
233
+ top: 50%;
234
+ left: 3px;
235
+ width: 16px;
236
+ height: 16px;
237
+ border-radius: inherit;
238
+ background-color: white;
239
+ box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
240
+ transform: translateY(-50%);
241
+ transition: left 0.3s ease;
242
+ }
243
+ .widget-checkbox input[type="checkbox"]:checked:before {
244
+ left: 21px;
245
+ }
246
+
247
+
248
  /* Button styles */
249
 
250
  .button_save {
 
363
  .button_save {
364
  animation-name: showedWidgets;
365
  animation-duration: 1s;
366
+ animation-fill-mode: forwards;
367
+ }
368
+
369
+ .container.hide,
370
+ .button_save.hide {
371
+ animation-name: hideWidgets;
372
+ animation-duration: 0.5s;
373
+ animation-fill-mode: forwards;
374
  }
375
 
376
  @keyframes showedWidgets {
 
385
  opacity: 1;
386
  }
387
  }
388
+
389
+ @keyframes hideWidgets {
390
+ 0% {
391
+ transform: translate3d(0, 0, 0) scale(1);
392
+ filter: blur(0) grayscale(0) brightness(1);
393
+ opacity: 1;
394
+ }
395
+ 100% {
396
+ transform: translate3d(0, 5%, 0) scale(0.9);
397
+ filter: blur(15px) grayscale(1) brightness(0.5);
398
+ opacity: 0;
399
+ }
400
+ }
401
  </style>
402
 
403
  <!-- TOGGLE 'CustomDL' SCRIPT -->
 
426
  # --- MODEL ---
427
  model_header = widgets.HTML('<div class="header">Model Selection<div>')
428
  model_options = ['none',
429
+ '1.Anime (by XpucT) + INP',
430
+ '2.BluMix [Anime] [V7]',
431
+ '3.Cetus-Mix [Anime] [V4] + INP',
432
+ '4.Counterfeit [Anime] [V3] + INP',
433
+ '5.CuteColor [Anime] [V3]',
434
+ '6.Dark-Sushi-Mix [Anime]',
435
+ '7.Deliberate [Realism] [V6] + INP',
436
+ '8.Meina-Mix [Anime] [V11] + INP',
437
+ '9.Mix-Pro [Anime] [V4] + INP']
438
  # ---
439
+ Model_widget = widgets.Dropdown(options=model_options, value='4.Counterfeit [Anime] [V3] + INP', description='Model:', style=style, layout=layout)
440
  Model_Num_widget = widgets.Text(description='Model Number:', placeholder='Enter the model numbers to be downloaded using comma/space.', style=style, layout=layout)
441
  Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Models', style=style)
442
 
443
+ ''' Display Model'''
444
+ all_model_box = widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class("container").add_class("image_1")
445
+ display(all_model_box)
446
 
447
  # --- VAE ---
448
  vae_header = widgets.HTML('<div class="header" >VAE Selection</div>')
 
453
  '4.ClearVae.vae',
454
  '5.WD.vae']
455
  Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)
456
+ Vae_Num_widget = widgets.Text(description='Vae Number:', placeholder='Enter the vae numbers to be downloaded using comma/space.', style=style, layout=layout)
457
 
458
+ ''' Display Vae'''
459
+ all_vae_box= widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class("container").add_class("image_2")
460
+ display(all_vae_box)
461
 
462
  # --- ADDITIONAL ---
463
  additional_header = widgets.HTML('<div class="header">Additional</div>')
 
476
  controlnet_widget = widgets.Dropdown(options=controlnet_options, value='none', description='ControlNet:', style=style, layout=layout)
477
  controlnet_Num_widget = widgets.Text(description='ControlNet Number:', placeholder='Enter the ControlNet model numbers to be downloaded using comma/space.', style=style, layout=layout)
478
  commit_hash_widget = widgets.Text(description='Commit Hash:', style=style, layout=layout)
479
+ optional_huggingface_token_widget = widgets.Text(description='HuggingFace Token:', style=style, layout=layout)
480
+ ngrok_token_widget = widgets.Text(description='Ngrok Token:', style=style, layout=widgets.Layout(width='1047px'))
481
  ngrock_button = widgets.HTML('<a href="https://dashboard.ngrok.com/get-started/your-authtoken" target="_blank">Get Ngrok Token</a>').add_class("button_ngrok")
482
  ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, layout=layout)
483
  # ---
484
  commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
485
  commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)
486
 
487
+ ''' Display Additional'''
488
  additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]
489
  if free_plan and env == "Google Colab":
490
  additional_widget_list.remove(ngrok_widget)
491
+ # ```
492
+ all_additional_box = widgets.VBox(additional_widget_list).add_class("container").add_class("image_3")
493
+ display(all_additional_box)
494
 
495
  # --- CUSTOM DOWNLOAD ---
496
  custom_download_header_popup = widgets.HTML('''
 
504
 
505
  <div class="header" style="cursor: pointer;" onclick="toggleContainer()">Custom Download</div>
506
  <!-- PopUp Window -->
507
+ <div class="info">INFO</div>
508
  <div class="popup">
509
  Separate multiple URLs with a comma/space. For a <span class="file_name">custom name</span> file/extension, specify it with <span class="braces">[]</span>
510
  after the URL without spaces.
 
526
  Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)
527
  custom_file_urls_widget = widgets.Text(description='File (txt):', style=style, layout=layout)
528
 
529
+ ''' Display CustomDl'''
530
+ all_custom_box = widgets.VBox([
531
  custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget
532
+ ]).add_class("container").add_class("image_4").add_class("container_custom_downlad")
533
+ display(all_custom_box)
534
 
535
  # --- Save Button ---
536
  save_button = widgets.Button(description='Save').add_class("button_save")
 
538
 
539
 
540
  # ============ Load / Save - Settings V2 ============
541
+ SETTINGS_FILE = f'{root_path}/settings.json'
 
 
 
 
542
 
543
+ settings_keys = [
544
+ 'Model', 'Model_Num', 'Inpainting_Model',
545
+ 'Vae', 'Vae_Num',
546
+ 'latest_webui', 'latest_exstensions', 'detailed_download',
547
+ 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',
548
+ 'ngrok_token', 'commandline_arguments',
549
+ 'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'
550
+ ]
551
 
552
  def save_settings():
553
+ settings = {key: globals()[f"{key}_widget"].value for key in settings_keys}
 
 
554
  with open(SETTINGS_FILE, 'w') as f:
555
+ json.dump(settings, f)
556
 
557
  def load_settings():
558
  if os.path.exists(SETTINGS_FILE):
559
  with open(SETTINGS_FILE, 'r') as f:
560
+ settings = json.load(f)
561
+ for key in settings_keys:
562
+ globals()[f"{key}_widget"].value = settings.get(key)
 
 
563
 
564
  def save_data(button):
565
  save_settings()
566
+
567
+ # --- uhh - hide... ---
568
+ widgets_list = [all_model_box, all_vae_box, all_additional_box, all_custom_box, save_button]
569
+ for widget in widgets_list:
570
+ widget.add_class("hide")
571
+ time.sleep(0.5)
572
+
573
  widgets.Widget.close_all()
574
 
575
  settings = load_settings()
files_cells/python/ru/downloading_ru.py CHANGED
@@ -49,7 +49,7 @@ if not os.path.exists(flag_file):
49
  xformers = "xformers==0.0.23.post1 triton==2.1.0"
50
  torch = "torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121"
51
 
52
- print("Установка библиотек, это займет какое-то время...", end='')
53
  with capture.capture_output() as cap:
54
  get_ipython().system('pip install -U gdown')
55
  get_ipython().system('apt-get update && apt -y install aria2')
@@ -68,7 +68,7 @@ if not os.path.exists(flag_file):
68
  get_ipython().system('wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb')
69
 
70
  if env == "Google Colab":
71
- get_ipython().system('pip install -q pip install xformers==0.0.26.dev769 -U')
72
  else:
73
  get_ipython().system('pip install -q {torch} -U')
74
  get_ipython().system('pip install -q {xformers} -U')
@@ -76,25 +76,19 @@ if not os.path.exists(flag_file):
76
  with open(flag_file, "w") as f:
77
  f.write("hey ;3")
78
  del cap
79
- print("\rБиблиотеки установлены!" + " "*35)
80
  time.sleep(2)
81
  clear_output()
82
 
83
 
84
- # ================= loading settings V5 =================
85
- import toml
86
-
87
  def load_settings(path):
88
  if os.path.exists(path):
89
  with open(path, 'r') as file:
90
- settings = toml.load(file)
91
- flat_settings = {}
92
- for section, keys in settings.items():
93
- flat_settings.update(keys)
94
- return flat_settings
95
  return {}
96
 
97
- settings = load_settings(f'{root_path}/settings.toml')
98
 
99
  variables = [
100
  'Model', 'Model_Num', 'Inpainting_Model',
@@ -148,7 +142,8 @@ if not os.path.exists(webui_path):
148
  install_time = timedelta(seconds=time.time()-start_install)
149
  print("\r🚀 Распаковка Завершена! За","%02d:%02d:%02d ⚡\n" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)
150
  else:
151
- # get_ipython().system('echo -n {start_colab} > {webui_path}/static/colabTimer.txt')
 
152
  print("🚀 Все распакованно... Пропуск. ⚡")
153
  start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())
154
  time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]
@@ -215,35 +210,39 @@ if commit_hash:
215
  ## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )
216
  print("📦 Скачивание моделей и прочего...", end='')
217
  model_list = {
218
- "1.Anime (by Xpuct) + INP": [
219
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_v2.safetensors"},
220
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_v2-inpainting.safetensors"}
221
  ],
222
- "2.Cetus-Mix [Anime] [V4] + INP": [
 
 
 
223
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
224
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
225
  ],
226
- "3.Counterfeit [Anime] [V3] + INP": [
227
  {"url": "https://civitai.com/api/download/models/125050", "name": "Counterfeit_V3.safetensors"},
228
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
229
  ],
230
- "4.CuteColor [Anime] [V3]": [
231
  {"url": "https://civitai.com/api/download/models/138754", "name": "CuteColor_V3.safetensors"}
232
  ],
233
- "5.Dark-Sushi-Mix [Anime]": [
234
  {"url": "https://civitai.com/api/download/models/101640", "name": "DarkSushiMix_2_5D.safetensors"},
235
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
236
  ],
237
- "6.Meina-Mix [Anime] [V11] + INP": [
 
 
 
 
238
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
239
  {"url": "https://civitai.com/api/download/models/120702", "name": "MeinaMix_V11-inpainting.safetensors"}
240
  ],
241
- "7.Mix-Pro [Anime] [V4] + INP": [
242
  {"url": "https://civitai.com/api/download/models/125668", "name": "MixPro_V4.safetensors"},
243
  {"url": "https://civitai.com/api/download/models/139878", "name": "MixPro_V4-inpainting.safetensors"}
244
- ],
245
- "8.BluMix [Anime] [V7]": [
246
- {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_v7.safetensors"}
247
  ]
248
  }
249
 
@@ -323,8 +322,8 @@ prefixes = {
323
  "model": [models_dir, "Model_url"],
324
  "vae": [vaes_dir, "Vae_url"],
325
  "lora": [loras_dir, "LoRA_url"],
326
- "embeddings": [embeddings_dir, "Embedding_url"],
327
- "extensions": [extensions_dir, "Extensions_url"],
328
  "control": [control_dir, "ControlNet_url"]
329
  }
330
 
@@ -334,7 +333,6 @@ url = ""
334
  ControlNet_url = ""
335
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
336
  user_header = f"\"Authorization: Bearer {hf_token}\""
337
- # user_header = f"\"Authorization: Bearer {optional_huggingface_token}\""
338
 
339
  def handle_manual(url):
340
  original_url = url
@@ -346,22 +344,22 @@ def handle_manual(url):
346
 
347
  for prefix, (dir, _) in prefixes.items():
348
  if original_url.startswith(f"{prefix}:"):
349
- if prefix != "extensions":
350
  manual_download(url, dir, file_name=file_name)
351
  else:
352
  extension_repo.append((url, file_name))
353
 
354
  def manual_download(url, dst_dir, file_name):
355
  basename = url.split("/")[-1] if file_name is None else file_name
356
- header_option = f"--header={user_header}" # if optional_huggingface_token else ""
 
 
357
 
358
  # I do it at my own risk..... Fucking CivitAi >:(
359
  civitai_token = "62c0c5956b2f9defbd844d754000180b"
360
  if 'civitai' in url and civitai_token:
361
  url = f"{url}?token={civitai_token}"
362
 
363
- print("\033[32m---"*45 + f"\n\033[33mURL: \033[34m{url}\n\033[33mSAVE DIR: \033[34m{dst_dir}\n\033[33mFILE NAME: \033[34m{file_name}\033[32m\n~~~\033[0m")
364
-
365
  # -- GDrive --
366
  if 'drive.google' in url:
367
  if 'folders' in url:
 
49
  xformers = "xformers==0.0.23.post1 triton==2.1.0"
50
  torch = "torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121"
51
 
52
+ print("💿 Установка библиотек, это займет какое-то время...", end='')
53
  with capture.capture_output() as cap:
54
  get_ipython().system('pip install -U gdown')
55
  get_ipython().system('apt-get update && apt -y install aria2')
 
68
  get_ipython().system('wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb')
69
 
70
  if env == "Google Colab":
71
+ get_ipython().system('pip install -q pip install xformers==0.0.26.dev778 -U')
72
  else:
73
  get_ipython().system('pip install -q {torch} -U')
74
  get_ipython().system('pip install -q {xformers} -U')
 
76
  with open(flag_file, "w") as f:
77
  f.write("hey ;3")
78
  del cap
79
+ print("\r🍪 Библиотеки установлены!" + " "*35)
80
  time.sleep(2)
81
  clear_output()
82
 
83
 
84
+ # ================= loading settings V4 =================
 
 
85
  def load_settings(path):
86
  if os.path.exists(path):
87
  with open(path, 'r') as file:
88
+ return json.load(file)
 
 
 
 
89
  return {}
90
 
91
+ settings = load_settings(f'{root_path}/settings.json')
92
 
93
  variables = [
94
  'Model', 'Model_Num', 'Inpainting_Model',
 
142
  install_time = timedelta(seconds=time.time()-start_install)
143
  print("\r🚀 Распаковка Завершена! За","%02d:%02d:%02d ⚡\n" % (install_time.seconds / 3600, (install_time.seconds / 60) % 60, install_time.seconds % 60), end='', flush=True)
144
  else:
145
+ if env == "SageMaker Studio Lab":
146
+ get_ipython().system('echo -n {start_colab} > {webui_path}/static/colabTimer.txt')
147
  print("🚀 Все распакованно... Пропуск. ⚡")
148
  start_colab = float(open(f'{webui_path}/static/colabTimer.txt', 'r').read())
149
  time_since_start = str(timedelta(seconds=time.time()-start_colab)).split('.')[0]
 
210
  ## Downloading model and stuff | oh yeah~ I'm starting to misunderstand my own code ( almost my own ;3 )
211
  print("📦 Скачивание моделей и прочего...", end='')
212
  model_list = {
213
+ "1.Anime (by XpucT) + INP": [
214
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2.safetensors", "name": "Anime_v2.safetensors"},
215
  {"url": "https://huggingface.co/XpucT/Anime/resolve/main/Anime_v2-inpainting.safetensors", "name": "Anime_v2-inpainting.safetensors"}
216
  ],
217
+ "2.BluMix [Anime] [V7]": [
218
+ {"url": "https://civitai.com/api/download/models/361779", "name": "BluMix_v7.safetensors"}
219
+ ],
220
+ "3.Cetus-Mix [Anime] [V4] + INP": [
221
  {"url": "https://civitai.com/api/download/models/130298", "name": "CetusMix_V4.safetensors"},
222
  {"url": "https://civitai.com/api/download/models/139882", "name": "CetusMix_V4-inpainting.safetensors"}
223
  ],
224
+ "4.Counterfeit [Anime] [V3] + INP": [
225
  {"url": "https://civitai.com/api/download/models/125050", "name": "Counterfeit_V3.safetensors"},
226
  {"url": "https://civitai.com/api/download/models/137911", "name": "Counterfeit_V3-inpainting.safetensors"}
227
  ],
228
+ "5.CuteColor [Anime] [V3]": [
229
  {"url": "https://civitai.com/api/download/models/138754", "name": "CuteColor_V3.safetensors"}
230
  ],
231
+ "6.Dark-Sushi-Mix [Anime]": [
232
  {"url": "https://civitai.com/api/download/models/101640", "name": "DarkSushiMix_2_5D.safetensors"},
233
  {"url": "https://civitai.com/api/download/models/56071", "name": "DarkSushiMix_colorful.safetensors"}
234
  ],
235
+ "7.Deliberate [Realism] [V6] + INP": [
236
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors", "name": "Deliberate_v6.safetensors"},
237
+ {"url": "https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6-inpainting.safetensors", "name": "Deliberate_v6-inpainting.safetensors"}
238
+ ],
239
+ "8.Meina-Mix [Anime] [V11] + INP": [
240
  {"url": "https://civitai.com/api/download/models/119057", "name": "MeinaMix_V11.safetensors"},
241
  {"url": "https://civitai.com/api/download/models/120702", "name": "MeinaMix_V11-inpainting.safetensors"}
242
  ],
243
+ "9.Mix-Pro [Anime] [V4] + INP": [
244
  {"url": "https://civitai.com/api/download/models/125668", "name": "MixPro_V4.safetensors"},
245
  {"url": "https://civitai.com/api/download/models/139878", "name": "MixPro_V4-inpainting.safetensors"}
 
 
 
246
  ]
247
  }
248
 
 
322
  "model": [models_dir, "Model_url"],
323
  "vae": [vaes_dir, "Vae_url"],
324
  "lora": [loras_dir, "LoRA_url"],
325
+ "embed": [embeddings_dir, "Embedding_url"],
326
+ "extension": [extensions_dir, "Extensions_url"],
327
  "control": [control_dir, "ControlNet_url"]
328
  }
329
 
 
333
  ControlNet_url = ""
334
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
335
  user_header = f"\"Authorization: Bearer {hf_token}\""
 
336
 
337
  def handle_manual(url):
338
  original_url = url
 
344
 
345
  for prefix, (dir, _) in prefixes.items():
346
  if original_url.startswith(f"{prefix}:"):
347
+ if prefix != "extension":
348
  manual_download(url, dir, file_name=file_name)
349
  else:
350
  extension_repo.append((url, file_name))
351
 
352
  def manual_download(url, dst_dir, file_name):
353
  basename = url.split("/")[-1] if file_name is None else file_name
354
+ header_option = f"--header={user_header}"
355
+
356
+ print("\033[32m---"*45 + f"\n\033[33mURL: \033[34m{url}\n\033[33mSAVE DIR: \033[34m{dst_dir}\n\033[33mFILE NAME: \033[34m{file_name}\033[32m\n~~~\033[0m")
357
 
358
  # I do it at my own risk..... Fucking CivitAi >:(
359
  civitai_token = "62c0c5956b2f9defbd844d754000180b"
360
  if 'civitai' in url and civitai_token:
361
  url = f"{url}?token={civitai_token}"
362
 
 
 
363
  # -- GDrive --
364
  if 'drive.google' in url:
365
  if 'folders' in url:
files_cells/python/ru/widgets_ru.py CHANGED
@@ -2,6 +2,7 @@
2
 
3
  import os
4
  import json
 
5
  import ipywidgets as widgets
6
  from ipywidgets import widgets, Layout, Label, Button, VBox, HBox
7
  from IPython.display import display, HTML, Javascript, clear_output
@@ -118,7 +119,7 @@ hr {
118
  content: "ANXETY";
119
  font-weight: bold;
120
  font-size: 24px;
121
- color: rgba(0, 0, 0, 0.15);
122
  }
123
 
124
  /* background img */
@@ -212,7 +213,7 @@ hr {
212
  .widget-checkbox input[type="checkbox"] {
213
  appearance: none;
214
  position: relative;
215
- top: 5px; /* Why is he taller?! */
216
  width: 40px;
217
  height: 20px;
218
  border: none;
@@ -362,6 +363,14 @@ hr {
362
  .button_save {
363
  animation-name: showedWidgets;
364
  animation-duration: 1s;
 
 
 
 
 
 
 
 
365
  }
366
 
367
  @keyframes showedWidgets {
@@ -376,6 +385,19 @@ hr {
376
  opacity: 1;
377
  }
378
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
379
  </style>
380
 
381
  <!-- TOGGLE 'CustomDL' SCRIPT -->
@@ -404,20 +426,23 @@ HR = widgets.HTML('<hr>')
404
  # --- MODEL ---
405
  model_header = widgets.HTML('<div class="header">Выбор Модели<div>')
406
  model_options = ['none',
407
- '1.Anime (by Xpuct) + INP',
408
- '2.Cetus-Mix [Anime] [V4] + INP',
409
- '3.Counterfeit [Anime] [V3] + INP',
410
- '4.CuteColor [Anime] [V3]',
411
- '5.Dark-Sushi-Mix [Anime]',
412
- '6.Meina-Mix [Anime] [V11] + INP',
413
- '7.Mix-Pro [Anime] [V4] + INP',
414
- '8.BluMix [Anime] [V7]']
 
415
  # ---
416
- Model_widget = widgets.Dropdown(options=model_options, value='3.Counterfeit [Anime] [V3] + INP', description='Модель:', style=style, layout=layout)
417
  Model_Num_widget = widgets.Text(description='Номер Модели:', placeholder='Введите номера моделей для скачивания через запятую/пробел.', style=style, layout=layout)
418
  Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Модели', style=style)
419
 
420
- display(widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class("container").add_class("image_1"))
 
 
421
 
422
  # --- VAE ---
423
  vae_header = widgets.HTML('<div class="header" >Выбор VAE</div>')
@@ -430,7 +455,9 @@ vae_options = ['none',
430
  Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)
431
  Vae_Num_widget = widgets.Text(description='Номер Vae:', placeholder='Введите номера vae для скачивания через запятую/пробел.', style=style, layout=layout)
432
 
433
- display(widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class("container").add_class("image_2"))
 
 
434
 
435
  # --- ADDITIONAL ---
436
  additional_header = widgets.HTML('<div class="header">Дополнительно</div>')
@@ -457,10 +484,13 @@ ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, la
457
  commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
458
  commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)
459
 
 
460
  additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]
461
  if free_plan and env == "Google Colab":
462
  additional_widget_list.remove(ngrok_widget)
463
- display(widgets.VBox(additional_widget_list).add_class("container").add_class("image_3"))
 
 
464
 
465
  # --- CUSTOM DOWNLOAD ---
466
  custom_download_header_popup = widgets.HTML('''
@@ -474,7 +504,7 @@ custom_download_header_popup = widgets.HTML('''
474
 
475
  <div class="header" style="cursor: pointer;" onclick="toggleContainer()">Кастомная Загрузка</div>
476
  <!-- PopUp window -->
477
- <div class="info" id="info_dl">FAQ?</div>
478
  <div class="popup">
479
  Разделите несколько URL-адресов запятой/пробелом. Для <span class="file_name">пользовательского имени</span> файла/расширения укажите его через <span class="braces">[]</span>
480
  после URL без пробелов.
@@ -496,9 +526,11 @@ Embedding_url_widget = widgets.Text(description='Embedding:', style=style, layou
496
  Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)
497
  custom_file_urls_widget = widgets.Text(description='Файл (txt):', style=style, layout=layout)
498
 
499
- display(widgets.VBox([
 
500
  custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget
501
- ]).add_class("container").add_class("image_4").add_class("container_custom_downlad"))
 
502
 
503
  # --- Save Button ---
504
  save_button = widgets.Button(description='Сохранить').add_class("button_save")
@@ -531,6 +563,13 @@ def load_settings():
531
 
532
  def save_data(button):
533
  save_settings()
 
 
 
 
 
 
 
534
  widgets.Widget.close_all()
535
 
536
  settings = load_settings()
 
2
 
3
  import os
4
  import json
5
+ import time
6
  import ipywidgets as widgets
7
  from ipywidgets import widgets, Layout, Label, Button, VBox, HBox
8
  from IPython.display import display, HTML, Javascript, clear_output
 
119
  content: "ANXETY";
120
  font-weight: bold;
121
  font-size: 24px;
122
+ color: rgba(0, 0, 0, 0.2);
123
  }
124
 
125
  /* background img */
 
213
  .widget-checkbox input[type="checkbox"] {
214
  appearance: none;
215
  position: relative;
216
+ top: 4px; /* Why is he taller?! */
217
  width: 40px;
218
  height: 20px;
219
  border: none;
 
363
  .button_save {
364
  animation-name: showedWidgets;
365
  animation-duration: 1s;
366
+ animation-fill-mode: forwards;
367
+ }
368
+
369
+ .container.hide,
370
+ .button_save.hide {
371
+ animation-name: hideWidgets;
372
+ animation-duration: 0.5s;
373
+ animation-fill-mode: forwards;
374
  }
375
 
376
  @keyframes showedWidgets {
 
385
  opacity: 1;
386
  }
387
  }
388
+
389
+ @keyframes hideWidgets {
390
+ 0% {
391
+ transform: translate3d(0, 0, 0) scale(1);
392
+ filter: blur(0) grayscale(0) brightness(1);
393
+ opacity: 1;
394
+ }
395
+ 100% {
396
+ transform: translate3d(0, 5%, 0) scale(0.9);
397
+ filter: blur(15px) grayscale(1) brightness(0.5);
398
+ opacity: 0;
399
+ }
400
+ }
401
  </style>
402
 
403
  <!-- TOGGLE 'CustomDL' SCRIPT -->
 
426
  # --- MODEL ---
427
  model_header = widgets.HTML('<div class="header">Выбор Модели<div>')
428
  model_options = ['none',
429
+ '1.Anime (by XpucT) + INP',
430
+ '2.BluMix [Anime] [V7]',
431
+ '3.Cetus-Mix [Anime] [V4] + INP',
432
+ '4.Counterfeit [Anime] [V3] + INP',
433
+ '5.CuteColor [Anime] [V3]',
434
+ '6.Dark-Sushi-Mix [Anime]',
435
+ '7.Deliberate [Realism] [V6] + INP',
436
+ '8.Meina-Mix [Anime] [V11] + INP',
437
+ '9.Mix-Pro [Anime] [V4] + INP']
438
  # ---
439
+ Model_widget = widgets.Dropdown(options=model_options, value='4.Counterfeit [Anime] [V3] + INP', description='Модель:', style=style, layout=layout)
440
  Model_Num_widget = widgets.Text(description='Номер Модели:', placeholder='Введите номера моделей для скачивания через запятую/пробел.', style=style, layout=layout)
441
  Inpainting_Model_widget = widgets.Checkbox(value=False, description='Inpainting Модели', style=style)
442
 
443
+ ''' Display Model'''
444
+ all_model_box = widgets.VBox([model_header, Model_widget, Model_Num_widget, Inpainting_Model_widget]).add_class("container").add_class("image_1")
445
+ display(all_model_box)
446
 
447
  # --- VAE ---
448
  vae_header = widgets.HTML('<div class="header" >Выбор VAE</div>')
 
455
  Vae_widget = widgets.Dropdown(options=vae_options, value='3.Blessed2.vae', description='Vae:', style=style, layout=layout)
456
  Vae_Num_widget = widgets.Text(description='Номер Vae:', placeholder='Введите номера vae для скачивания через запятую/пробел.', style=style, layout=layout)
457
 
458
+ ''' Display Vae'''
459
+ all_vae_box= widgets.VBox([vae_header, Vae_widget, Vae_Num_widget]).add_class("container").add_class("image_2")
460
+ display(all_vae_box)
461
 
462
  # --- ADDITIONAL ---
463
  additional_header = widgets.HTML('<div class="header">Дополнительно</div>')
 
484
  commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
485
  commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)
486
 
487
+ ''' Display Additional'''
488
  additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget]
489
  if free_plan and env == "Google Colab":
490
  additional_widget_list.remove(ngrok_widget)
491
+ # ```
492
+ all_additional_box = widgets.VBox(additional_widget_list).add_class("container").add_class("image_3")
493
+ display(all_additional_box)
494
 
495
  # --- CUSTOM DOWNLOAD ---
496
  custom_download_header_popup = widgets.HTML('''
 
504
 
505
  <div class="header" style="cursor: pointer;" onclick="toggleContainer()">Кастомная Загрузка</div>
506
  <!-- PopUp window -->
507
+ <div class="info" id="info_dl">INFO</div>
508
  <div class="popup">
509
  Разделите несколько URL-адресов запятой/пробелом. Для <span class="file_name">пользовательского имени</span> файла/расширения укажите его через <span class="braces">[]</span>
510
  после URL без пробелов.
 
526
  Extensions_url_widget = widgets.Text(description='Extensions:', style=style, layout=layout)
527
  custom_file_urls_widget = widgets.Text(description='Файл (txt):', style=style, layout=layout)
528
 
529
+ ''' Display CustomDl'''
530
+ all_custom_box = widgets.VBox([
531
  custom_download_header_popup, Model_url_widget, Vae_url_widget, LoRA_url_widget, Embedding_url_widget, Extensions_url_widget, custom_file_urls_widget
532
+ ]).add_class("container").add_class("image_4").add_class("container_custom_downlad")
533
+ display(all_custom_box)
534
 
535
  # --- Save Button ---
536
  save_button = widgets.Button(description='Сохранить').add_class("button_save")
 
563
 
564
  def save_data(button):
565
  save_settings()
566
+
567
+ # --- uhh - hide... ---
568
+ widgets_list = [all_model_box, all_vae_box, all_additional_box, all_custom_box, save_button]
569
+ for widget in widgets_list:
570
+ widget.add_class("hide")
571
+ time.sleep(0.5)
572
+
573
  widgets.Widget.close_all()
574
 
575
  settings = load_settings()