test zrok tunnel
Browse files- files_cells/notebooks/en/downloading_en.ipynb +26 -16
- files_cells/notebooks/en/launch_en.ipynb +5 -0
- files_cells/notebooks/en/widgets_en.ipynb +9 -3
- files_cells/notebooks/ru/downloading_ru.ipynb +24 -15
- files_cells/notebooks/ru/widgets_ru.ipynb +6 -1
- files_cells/python/en/downloading_en.py +26 -16
- files_cells/python/en/launch_en.py +5 -0
- files_cells/python/en/widgets_en.py +9 -3
- files_cells/python/ru/downloading_ru.py +24 -15
- files_cells/python/ru/widgets_ru.py +6 -1
files_cells/notebooks/en/downloading_en.ipynb
CHANGED
|
@@ -75,6 +75,7 @@
|
|
| 75 |
" !npm install -g localtunnel &> /dev/null\n",
|
| 76 |
" !curl -s -OL https://github.com/DEX-1101/sd-webui-notebook/raw/main/res/new_tunnel --output-dir {root_path}\n",
|
| 77 |
" !curl -s -Lo /usr/bin/cl https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && chmod +x /usr/bin/cl\n",
|
|
|
|
| 78 |
" !pip install insightface\n",
|
| 79 |
"\n",
|
| 80 |
" if env == \"SageMaker Studio Lab\":\n",
|
|
@@ -114,7 +115,7 @@
|
|
| 114 |
" 'Vae', 'Vae_Num',\n",
|
| 115 |
" 'latest_webui', 'latest_exstensions', 'detailed_download',\n",
|
| 116 |
" 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',\n",
|
| 117 |
-
" 'ngrok_token', 'commandline_arguments',\n",
|
| 118 |
" 'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'\n",
|
| 119 |
"]\n",
|
| 120 |
"\n",
|
|
@@ -353,6 +354,8 @@
|
|
| 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",
|
| 358 |
" url = url.split(':', 1)[1]\n",
|
|
@@ -419,6 +422,8 @@
|
|
| 419 |
" url, dst_dir, file_name = link_or_path.split()\n",
|
| 420 |
" manual_download(url, dst_dir, file_name)\n",
|
| 421 |
"\n",
|
|
|
|
|
|
|
| 422 |
"submodels = []\n",
|
| 423 |
"\n",
|
| 424 |
"def add_submodels(selection, num_selection, model_dict, dst_dir):\n",
|
|
@@ -454,6 +459,10 @@
|
|
| 454 |
" continue\n",
|
| 455 |
" url += f\"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, \"\n",
|
| 456 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
"def process_file_download(file_url):\n",
|
| 458 |
" if file_url.startswith(\"http\"):\n",
|
| 459 |
" if \"blob\" in file_url:\n",
|
|
@@ -466,27 +475,28 @@
|
|
| 466 |
"\n",
|
| 467 |
" current_tag = None\n",
|
| 468 |
" for line in lines:\n",
|
| 469 |
-
" if
|
| 470 |
-
"
|
| 471 |
-
" current_tag = next((tag for tag in prefixes if tag in line.lower()))\n",
|
| 472 |
"\n",
|
| 473 |
-
" urls = [url.strip() for url in line.split()]\n",
|
| 474 |
" for url in urls:\n",
|
| 475 |
-
" if url.startswith(\"http\"):\n",
|
| 476 |
" globals()[prefixes[current_tag][1]] += \", \" + url\n",
|
|
|
|
| 477 |
"\n",
|
| 478 |
"# fix all possible errors/options and function call\n",
|
| 479 |
"if custom_file_urls:\n",
|
| 480 |
-
"
|
| 481 |
-
"
|
| 482 |
-
"
|
| 483 |
-
" if not
|
| 484 |
-
"
|
| 485 |
-
"\n",
|
| 486 |
-
"
|
| 487 |
-
"
|
| 488 |
-
"
|
| 489 |
-
"
|
|
|
|
| 490 |
"\n",
|
| 491 |
"# url prefixing\n",
|
| 492 |
"urls = [globals()[urls[1]] for urls in prefixes.values()]\n",
|
|
|
|
| 75 |
" !npm install -g localtunnel &> /dev/null\n",
|
| 76 |
" !curl -s -OL https://github.com/DEX-1101/sd-webui-notebook/raw/main/res/new_tunnel --output-dir {root_path}\n",
|
| 77 |
" !curl -s -Lo /usr/bin/cl https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && chmod +x /usr/bin/cl\n",
|
| 78 |
+
" !curl -sLO https://github.com/openziti/zrok/releases/download/v0.4.23/zrok_0.4.23_linux_amd64.tar.gz && tar -xzf zrok_0.4.23_linux_amd64.tar.gz && rm -rf zrok_0.4.23_linux_amd64.tar.gz && mv {root_path}/zrok /usr/bin/zrok\n",
|
| 79 |
" !pip install insightface\n",
|
| 80 |
"\n",
|
| 81 |
" if env == \"SageMaker Studio Lab\":\n",
|
|
|
|
| 115 |
" 'Vae', 'Vae_Num',\n",
|
| 116 |
" 'latest_webui', 'latest_exstensions', 'detailed_download',\n",
|
| 117 |
" 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',\n",
|
| 118 |
+
" 'ngrok_token', 'zrok_token', 'commandline_arguments',\n",
|
| 119 |
" 'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'\n",
|
| 120 |
"]\n",
|
| 121 |
"\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 |
"\n",
|
| 357 |
+
"''' main download code '''\n",
|
| 358 |
+
"\n",
|
| 359 |
"def handle_manual(url):\n",
|
| 360 |
" original_url = url\n",
|
| 361 |
" url = url.split(':', 1)[1]\n",
|
|
|
|
| 422 |
" url, dst_dir, file_name = link_or_path.split()\n",
|
| 423 |
" manual_download(url, dst_dir, file_name)\n",
|
| 424 |
"\n",
|
| 425 |
+
"''' submodels - added urls '''\n",
|
| 426 |
+
"\n",
|
| 427 |
"submodels = []\n",
|
| 428 |
"\n",
|
| 429 |
"def add_submodels(selection, num_selection, model_dict, dst_dir):\n",
|
|
|
|
| 459 |
" continue\n",
|
| 460 |
" url += f\"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, \"\n",
|
| 461 |
"\n",
|
| 462 |
+
"''' file.txt - added urls '''\n",
|
| 463 |
+
"\n",
|
| 464 |
+
"unique_urls = []\n",
|
| 465 |
+
"\n",
|
| 466 |
"def process_file_download(file_url):\n",
|
| 467 |
" if file_url.startswith(\"http\"):\n",
|
| 468 |
" if \"blob\" in file_url:\n",
|
|
|
|
| 475 |
"\n",
|
| 476 |
" current_tag = None\n",
|
| 477 |
" for line in lines:\n",
|
| 478 |
+
" if any(f'# {tag}' in line.lower() for tag in prefixes):\n",
|
| 479 |
+
" current_tag = next((tag for tag in prefixes if tag in line.lower()))\n",
|
|
|
|
| 480 |
"\n",
|
| 481 |
+
" urls = [url.strip() for url in line.split(',')]\n",
|
| 482 |
" for url in urls:\n",
|
| 483 |
+
" if url.startswith(\"http\") and url not in unique_urls:\n",
|
| 484 |
" globals()[prefixes[current_tag][1]] += \", \" + url\n",
|
| 485 |
+
" unique_urls.append(url)\n",
|
| 486 |
"\n",
|
| 487 |
"# fix all possible errors/options and function call\n",
|
| 488 |
"if custom_file_urls:\n",
|
| 489 |
+
" for custom_file_url in custom_file_urls.replace(',', '').split():\n",
|
| 490 |
+
" if not custom_file_url.endswith('.txt'):\n",
|
| 491 |
+
" custom_file_url += '.txt'\n",
|
| 492 |
+
" if not custom_file_url.startswith('http'):\n",
|
| 493 |
+
" if not custom_file_url.startswith(root_path):\n",
|
| 494 |
+
" custom_file_url = f'{root_path}/{custom_file_url}'\n",
|
| 495 |
+
"\n",
|
| 496 |
+
" try:\n",
|
| 497 |
+
" process_file_download(custom_file_url)\n",
|
| 498 |
+
" except FileNotFoundError:\n",
|
| 499 |
+
" pass\n",
|
| 500 |
"\n",
|
| 501 |
"# url prefixing\n",
|
| 502 |
"urls = [globals()[urls[1]] for urls in prefixes.values()]\n",
|
files_cells/notebooks/en/launch_en.ipynb
CHANGED
|
@@ -82,6 +82,11 @@
|
|
| 82 |
" tunnel = tunnel_class(tunnel_port)\n",
|
| 83 |
" tunnel.add_tunnel(command=\"cl tunnel --url localhost:{port}\", name=\"cl\", pattern=re.compile(r\"[\\w-]+\\.trycloudflare\\.com\"))\n",
|
| 84 |
" tunnel.add_tunnel(command=\"lt --port {port}\", name=\"lt\", pattern=re.compile(r\"[\\w-]+\\.loca\\.lt\"), note=\"Password : \" + \"\\033[32m\" + public_ipv4 + \"\\033[0m\" + \" rerun cell if 404 error.\")\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
"# ======================== TUNNEL ========================\n",
|
| 86 |
"\n",
|
| 87 |
"\n",
|
|
|
|
| 82 |
" tunnel = tunnel_class(tunnel_port)\n",
|
| 83 |
" tunnel.add_tunnel(command=\"cl tunnel --url localhost:{port}\", name=\"cl\", pattern=re.compile(r\"[\\w-]+\\.trycloudflare\\.com\"))\n",
|
| 84 |
" tunnel.add_tunnel(command=\"lt --port {port}\", name=\"lt\", pattern=re.compile(r\"[\\w-]+\\.loca\\.lt\"), note=\"Password : \" + \"\\033[32m\" + public_ipv4 + \"\\033[0m\" + \" rerun cell if 404 error.\")\n",
|
| 85 |
+
"\n",
|
| 86 |
+
"''' add zrok tunnel '''\n",
|
| 87 |
+
"if zrok_token:\n",
|
| 88 |
+
" !zrok enable {zrok_token} &> /dev/null\n",
|
| 89 |
+
" tunnel.add_tunnel(command=\"zrok share public http://localhost:{port}/ --headless\", name=\"zrok\", pattern=re.compile(r\"[\\w-]+\\.share\\.zrok\\.io\"))\n",
|
| 90 |
"# ======================== TUNNEL ========================\n",
|
| 91 |
"\n",
|
| 92 |
"\n",
|
files_cells/notebooks/en/widgets_en.ipynb
CHANGED
|
@@ -308,7 +308,12 @@
|
|
| 308 |
"\n",
|
| 309 |
".button_save:active,\n",
|
| 310 |
".button_ngrok:active {\n",
|
| 311 |
-
" filter: brightness(0.75);\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
"}\n",
|
| 313 |
"\n",
|
| 314 |
"\n",
|
|
@@ -499,12 +504,13 @@
|
|
| 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",
|
|
@@ -564,7 +570,7 @@
|
|
| 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",
|
|
|
|
| 308 |
"\n",
|
| 309 |
".button_save:active,\n",
|
| 310 |
".button_ngrok:active {\n",
|
| 311 |
+
" filter: brightness(0.75) !important;\n",
|
| 312 |
+
"}\n",
|
| 313 |
+
"\n",
|
| 314 |
+
"/* Removes ugly stroke from widget buttons. */\n",
|
| 315 |
+
".jupyter-widgets.lm-Widget:focus {\n",
|
| 316 |
+
" outline: none;\n",
|
| 317 |
"}\n",
|
| 318 |
"\n",
|
| 319 |
"\n",
|
|
|
|
| 504 |
"ngrok_token_widget = widgets.Text(description='Ngrok Token:', style=style, layout=widgets.Layout(width='1047px'))\n",
|
| 505 |
"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",
|
| 506 |
"ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, layout=layout)\n",
|
| 507 |
+
"zrok_token_widget = widgets.Text(description='Zrok Token:', style=style, layout=layout)\n",
|
| 508 |
"# ---\n",
|
| 509 |
"commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
|
| 510 |
"commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)\n",
|
| 511 |
"\n",
|
| 512 |
"''' Display Additional'''\n",
|
| 513 |
+
"additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, zrok_token_widget, HR, commandline_arguments_widget]\n",
|
| 514 |
"if free_plan and env == \"Google Colab\":\n",
|
| 515 |
" additional_widget_list.remove(ngrok_widget)\n",
|
| 516 |
"# ```\n",
|
|
|
|
| 570 |
" 'Vae', 'Vae_Num',\n",
|
| 571 |
" 'latest_webui', 'latest_exstensions', 'detailed_download',\n",
|
| 572 |
" 'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',\n",
|
| 573 |
+
" 'ngrok_token', 'zrok_token', 'commandline_arguments',\n",
|
| 574 |
" 'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'\n",
|
| 575 |
"]\n",
|
| 576 |
"\n",
|
files_cells/notebooks/ru/downloading_ru.ipynb
CHANGED
|
@@ -353,6 +353,8 @@
|
|
| 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",
|
| 358 |
" url = url.split(':', 1)[1]\n",
|
|
@@ -419,6 +421,8 @@
|
|
| 419 |
" url, dst_dir, file_name = link_or_path.split()\n",
|
| 420 |
" manual_download(url, dst_dir, file_name)\n",
|
| 421 |
"\n",
|
|
|
|
|
|
|
| 422 |
"submodels = []\n",
|
| 423 |
"\n",
|
| 424 |
"def add_submodels(selection, num_selection, model_dict, dst_dir):\n",
|
|
@@ -454,6 +458,10 @@
|
|
| 454 |
" continue\n",
|
| 455 |
" url += f\"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, \"\n",
|
| 456 |
"\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 457 |
"def process_file_download(file_url):\n",
|
| 458 |
" if file_url.startswith(\"http\"):\n",
|
| 459 |
" if \"blob\" in file_url:\n",
|
|
@@ -466,27 +474,28 @@
|
|
| 466 |
"\n",
|
| 467 |
" current_tag = None\n",
|
| 468 |
" for line in lines:\n",
|
| 469 |
-
" if
|
| 470 |
-
"
|
| 471 |
-
" current_tag = next((tag for tag in prefixes if tag in line.lower()))\n",
|
| 472 |
"\n",
|
| 473 |
-
" urls = [url.strip() for url in line.split()]\n",
|
| 474 |
" for url in urls:\n",
|
| 475 |
-
" if url.startswith(\"http\"):\n",
|
| 476 |
" globals()[prefixes[current_tag][1]] += \", \" + url\n",
|
|
|
|
| 477 |
"\n",
|
| 478 |
"# fix all possible errors/options and function call\n",
|
| 479 |
"if custom_file_urls:\n",
|
| 480 |
-
"
|
| 481 |
-
"
|
| 482 |
-
"
|
| 483 |
-
" if not
|
| 484 |
-
"
|
| 485 |
-
"\n",
|
| 486 |
-
"
|
| 487 |
-
"
|
| 488 |
-
"
|
| 489 |
-
"
|
|
|
|
| 490 |
"\n",
|
| 491 |
"# url prefixing\n",
|
| 492 |
"urls = [globals()[urls[1]] for urls in prefixes.values()]\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 |
+
"''' main download code '''\n",
|
| 357 |
+
"\n",
|
| 358 |
"def handle_manual(url):\n",
|
| 359 |
" original_url = url\n",
|
| 360 |
" url = url.split(':', 1)[1]\n",
|
|
|
|
| 421 |
" url, dst_dir, file_name = link_or_path.split()\n",
|
| 422 |
" manual_download(url, dst_dir, file_name)\n",
|
| 423 |
"\n",
|
| 424 |
+
"''' submodels - added urls '''\n",
|
| 425 |
+
"\n",
|
| 426 |
"submodels = []\n",
|
| 427 |
"\n",
|
| 428 |
"def add_submodels(selection, num_selection, model_dict, dst_dir):\n",
|
|
|
|
| 458 |
" continue\n",
|
| 459 |
" url += f\"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, \"\n",
|
| 460 |
"\n",
|
| 461 |
+
"''' file.txt - added urls '''\n",
|
| 462 |
+
"\n",
|
| 463 |
+
"unique_urls = []\n",
|
| 464 |
+
"\n",
|
| 465 |
"def process_file_download(file_url):\n",
|
| 466 |
" if file_url.startswith(\"http\"):\n",
|
| 467 |
" if \"blob\" in file_url:\n",
|
|
|
|
| 474 |
"\n",
|
| 475 |
" current_tag = None\n",
|
| 476 |
" for line in lines:\n",
|
| 477 |
+
" if any(f'# {tag}' in line.lower() for tag in prefixes):\n",
|
| 478 |
+
" current_tag = next((tag for tag in prefixes if tag in line.lower()))\n",
|
|
|
|
| 479 |
"\n",
|
| 480 |
+
" urls = [url.strip() for url in line.split(',')]\n",
|
| 481 |
" for url in urls:\n",
|
| 482 |
+
" if url.startswith(\"http\") and url not in unique_urls:\n",
|
| 483 |
" globals()[prefixes[current_tag][1]] += \", \" + url\n",
|
| 484 |
+
" unique_urls.append(url)\n",
|
| 485 |
"\n",
|
| 486 |
"# fix all possible errors/options and function call\n",
|
| 487 |
"if custom_file_urls:\n",
|
| 488 |
+
" for custom_file_url in custom_file_urls.replace(',', '').split():\n",
|
| 489 |
+
" if not custom_file_url.endswith('.txt'):\n",
|
| 490 |
+
" custom_file_url += '.txt'\n",
|
| 491 |
+
" if not custom_file_url.startswith('http'):\n",
|
| 492 |
+
" if not custom_file_url.startswith(root_path):\n",
|
| 493 |
+
" custom_file_url = f'{root_path}/{custom_file_url}'\n",
|
| 494 |
+
"\n",
|
| 495 |
+
" try:\n",
|
| 496 |
+
" process_file_download(custom_file_url)\n",
|
| 497 |
+
" except FileNotFoundError:\n",
|
| 498 |
+
" pass\n",
|
| 499 |
"\n",
|
| 500 |
"# url prefixing\n",
|
| 501 |
"urls = [globals()[urls[1]] for urls in prefixes.values()]\n",
|
files_cells/notebooks/ru/widgets_ru.ipynb
CHANGED
|
@@ -308,7 +308,12 @@
|
|
| 308 |
"\n",
|
| 309 |
".button_save:active,\n",
|
| 310 |
".button_ngrok:active {\n",
|
| 311 |
-
" filter: brightness(0.75);\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 312 |
"}\n",
|
| 313 |
"\n",
|
| 314 |
"\n",
|
|
|
|
| 308 |
"\n",
|
| 309 |
".button_save:active,\n",
|
| 310 |
".button_ngrok:active {\n",
|
| 311 |
+
" filter: brightness(0.75) !important;\n",
|
| 312 |
+
"}\n",
|
| 313 |
+
"\n",
|
| 314 |
+
"/* Removes ugly stroke from widget buttons. */\n",
|
| 315 |
+
".jupyter-widgets.lm-Widget:focus {\n",
|
| 316 |
+
" outline: none;\n",
|
| 317 |
"}\n",
|
| 318 |
"\n",
|
| 319 |
"\n",
|
files_cells/python/en/downloading_en.py
CHANGED
|
@@ -56,6 +56,7 @@ if not os.path.exists(flag_file):
|
|
| 56 |
get_ipython().system('npm install -g localtunnel &> /dev/null')
|
| 57 |
get_ipython().system('curl -s -OL https://github.com/DEX-1101/sd-webui-notebook/raw/main/res/new_tunnel --output-dir {root_path}')
|
| 58 |
get_ipython().system('curl -s -Lo /usr/bin/cl https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && chmod +x /usr/bin/cl')
|
|
|
|
| 59 |
get_ipython().system('pip install insightface')
|
| 60 |
|
| 61 |
if env == "SageMaker Studio Lab":
|
|
@@ -95,7 +96,7 @@ variables = [
|
|
| 95 |
'Vae', 'Vae_Num',
|
| 96 |
'latest_webui', 'latest_exstensions', 'detailed_download',
|
| 97 |
'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',
|
| 98 |
-
'ngrok_token', 'commandline_arguments',
|
| 99 |
'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'
|
| 100 |
]
|
| 101 |
|
|
@@ -334,6 +335,8 @@ 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
|
| 339 |
url = url.split(':', 1)[1]
|
|
@@ -400,6 +403,8 @@ def download(url):
|
|
| 400 |
url, dst_dir, file_name = link_or_path.split()
|
| 401 |
manual_download(url, dst_dir, file_name)
|
| 402 |
|
|
|
|
|
|
|
| 403 |
submodels = []
|
| 404 |
|
| 405 |
def add_submodels(selection, num_selection, model_dict, dst_dir):
|
|
@@ -435,6 +440,10 @@ for submodel in submodels:
|
|
| 435 |
continue
|
| 436 |
url += f"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, "
|
| 437 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
def process_file_download(file_url):
|
| 439 |
if file_url.startswith("http"):
|
| 440 |
if "blob" in file_url:
|
|
@@ -447,27 +456,28 @@ def process_file_download(file_url):
|
|
| 447 |
|
| 448 |
current_tag = None
|
| 449 |
for line in lines:
|
| 450 |
-
if
|
| 451 |
-
|
| 452 |
-
current_tag = next((tag for tag in prefixes if tag in line.lower()))
|
| 453 |
|
| 454 |
-
urls = [url.strip() for url in line.split()]
|
| 455 |
for url in urls:
|
| 456 |
-
if url.startswith("http"):
|
| 457 |
globals()[prefixes[current_tag][1]] += ", " + url
|
|
|
|
| 458 |
|
| 459 |
# fix all possible errors/options and function call
|
| 460 |
if custom_file_urls:
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
if not
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
|
|
|
| 471 |
|
| 472 |
# url prefixing
|
| 473 |
urls = [globals()[urls[1]] for urls in prefixes.values()]
|
|
|
|
| 56 |
get_ipython().system('npm install -g localtunnel &> /dev/null')
|
| 57 |
get_ipython().system('curl -s -OL https://github.com/DEX-1101/sd-webui-notebook/raw/main/res/new_tunnel --output-dir {root_path}')
|
| 58 |
get_ipython().system('curl -s -Lo /usr/bin/cl https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 && chmod +x /usr/bin/cl')
|
| 59 |
+
get_ipython().system('curl -sLO https://github.com/openziti/zrok/releases/download/v0.4.23/zrok_0.4.23_linux_amd64.tar.gz && tar -xzf zrok_0.4.23_linux_amd64.tar.gz && rm -rf zrok_0.4.23_linux_amd64.tar.gz && mv {root_path}/zrok /usr/bin/zrok')
|
| 60 |
get_ipython().system('pip install insightface')
|
| 61 |
|
| 62 |
if env == "SageMaker Studio Lab":
|
|
|
|
| 96 |
'Vae', 'Vae_Num',
|
| 97 |
'latest_webui', 'latest_exstensions', 'detailed_download',
|
| 98 |
'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',
|
| 99 |
+
'ngrok_token', 'zrok_token', 'commandline_arguments',
|
| 100 |
'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'
|
| 101 |
]
|
| 102 |
|
|
|
|
| 335 |
hf_token = optional_huggingface_token if optional_huggingface_token else "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"
|
| 336 |
user_header = f"\"Authorization: Bearer {hf_token}\""
|
| 337 |
|
| 338 |
+
''' main download code '''
|
| 339 |
+
|
| 340 |
def handle_manual(url):
|
| 341 |
original_url = url
|
| 342 |
url = url.split(':', 1)[1]
|
|
|
|
| 403 |
url, dst_dir, file_name = link_or_path.split()
|
| 404 |
manual_download(url, dst_dir, file_name)
|
| 405 |
|
| 406 |
+
''' submodels - added urls '''
|
| 407 |
+
|
| 408 |
submodels = []
|
| 409 |
|
| 410 |
def add_submodels(selection, num_selection, model_dict, dst_dir):
|
|
|
|
| 440 |
continue
|
| 441 |
url += f"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, "
|
| 442 |
|
| 443 |
+
''' file.txt - added urls '''
|
| 444 |
+
|
| 445 |
+
unique_urls = []
|
| 446 |
+
|
| 447 |
def process_file_download(file_url):
|
| 448 |
if file_url.startswith("http"):
|
| 449 |
if "blob" in file_url:
|
|
|
|
| 456 |
|
| 457 |
current_tag = None
|
| 458 |
for line in lines:
|
| 459 |
+
if any(f'# {tag}' in line.lower() for tag in prefixes):
|
| 460 |
+
current_tag = next((tag for tag in prefixes if tag in line.lower()))
|
|
|
|
| 461 |
|
| 462 |
+
urls = [url.strip() for url in line.split(',')]
|
| 463 |
for url in urls:
|
| 464 |
+
if url.startswith("http") and url not in unique_urls:
|
| 465 |
globals()[prefixes[current_tag][1]] += ", " + url
|
| 466 |
+
unique_urls.append(url)
|
| 467 |
|
| 468 |
# fix all possible errors/options and function call
|
| 469 |
if custom_file_urls:
|
| 470 |
+
for custom_file_url in custom_file_urls.replace(',', '').split():
|
| 471 |
+
if not custom_file_url.endswith('.txt'):
|
| 472 |
+
custom_file_url += '.txt'
|
| 473 |
+
if not custom_file_url.startswith('http'):
|
| 474 |
+
if not custom_file_url.startswith(root_path):
|
| 475 |
+
custom_file_url = f'{root_path}/{custom_file_url}'
|
| 476 |
+
|
| 477 |
+
try:
|
| 478 |
+
process_file_download(custom_file_url)
|
| 479 |
+
except FileNotFoundError:
|
| 480 |
+
pass
|
| 481 |
|
| 482 |
# url prefixing
|
| 483 |
urls = [globals()[urls[1]] for urls in prefixes.values()]
|
files_cells/python/en/launch_en.py
CHANGED
|
@@ -58,6 +58,11 @@ if env != "SageMaker Studio Lab":
|
|
| 58 |
tunnel = tunnel_class(tunnel_port)
|
| 59 |
tunnel.add_tunnel(command="cl tunnel --url localhost:{port}", name="cl", pattern=re.compile(r"[\w-]+\.trycloudflare\.com"))
|
| 60 |
tunnel.add_tunnel(command="lt --port {port}", name="lt", pattern=re.compile(r"[\w-]+\.loca\.lt"), note="Password : " + "\033[32m" + public_ipv4 + "\033[0m" + " rerun cell if 404 error.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
# ======================== TUNNEL ========================
|
| 62 |
|
| 63 |
|
|
|
|
| 58 |
tunnel = tunnel_class(tunnel_port)
|
| 59 |
tunnel.add_tunnel(command="cl tunnel --url localhost:{port}", name="cl", pattern=re.compile(r"[\w-]+\.trycloudflare\.com"))
|
| 60 |
tunnel.add_tunnel(command="lt --port {port}", name="lt", pattern=re.compile(r"[\w-]+\.loca\.lt"), note="Password : " + "\033[32m" + public_ipv4 + "\033[0m" + " rerun cell if 404 error.")
|
| 61 |
+
|
| 62 |
+
''' add zrok tunnel '''
|
| 63 |
+
if zrok_token:
|
| 64 |
+
get_ipython().system('zrok enable {zrok_token} &> /dev/null')
|
| 65 |
+
tunnel.add_tunnel(command="zrok share public http://localhost:{port}/ --headless", name="zrok", pattern=re.compile(r"[\w-]+\.share\.zrok\.io"))
|
| 66 |
# ======================== TUNNEL ========================
|
| 67 |
|
| 68 |
|
files_cells/python/en/widgets_en.py
CHANGED
|
@@ -289,7 +289,12 @@ hr {
|
|
| 289 |
|
| 290 |
.button_save:active,
|
| 291 |
.button_ngrok:active {
|
| 292 |
-
filter: brightness(0.75);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
}
|
| 294 |
|
| 295 |
|
|
@@ -480,12 +485,13 @@ optional_huggingface_token_widget = widgets.Text(description='HuggingFace Token:
|
|
| 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 |
# ```
|
|
@@ -545,7 +551,7 @@ settings_keys = [
|
|
| 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 |
|
|
|
|
| 289 |
|
| 290 |
.button_save:active,
|
| 291 |
.button_ngrok:active {
|
| 292 |
+
filter: brightness(0.75) !important;
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
/* Removes ugly stroke from widget buttons. */
|
| 296 |
+
.jupyter-widgets.lm-Widget:focus {
|
| 297 |
+
outline: none;
|
| 298 |
}
|
| 299 |
|
| 300 |
|
|
|
|
| 485 |
ngrok_token_widget = widgets.Text(description='Ngrok Token:', style=style, layout=widgets.Layout(width='1047px'))
|
| 486 |
ngrock_button = widgets.HTML('<a href="https://dashboard.ngrok.com/get-started/your-authtoken" target="_blank">Get Ngrok Token</a>').add_class("button_ngrok")
|
| 487 |
ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, layout=layout)
|
| 488 |
+
zrok_token_widget = widgets.Text(description='Zrok Token:', style=style, layout=layout)
|
| 489 |
# ---
|
| 490 |
commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
|
| 491 |
commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)
|
| 492 |
|
| 493 |
''' Display Additional'''
|
| 494 |
+
additional_widget_list = [additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, zrok_token_widget, HR, commandline_arguments_widget]
|
| 495 |
if free_plan and env == "Google Colab":
|
| 496 |
additional_widget_list.remove(ngrok_widget)
|
| 497 |
# ```
|
|
|
|
| 551 |
'Vae', 'Vae_Num',
|
| 552 |
'latest_webui', 'latest_exstensions', 'detailed_download',
|
| 553 |
'controlnet', 'controlnet_Num', 'commit_hash', 'optional_huggingface_token',
|
| 554 |
+
'ngrok_token', 'zrok_token', 'commandline_arguments',
|
| 555 |
'Model_url', 'Vae_url', 'LoRA_url', 'Embedding_url', 'Extensions_url', 'custom_file_urls'
|
| 556 |
]
|
| 557 |
|
files_cells/python/ru/downloading_ru.py
CHANGED
|
@@ -334,6 +334,8 @@ 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
|
| 339 |
url = url.split(':', 1)[1]
|
|
@@ -400,6 +402,8 @@ def download(url):
|
|
| 400 |
url, dst_dir, file_name = link_or_path.split()
|
| 401 |
manual_download(url, dst_dir, file_name)
|
| 402 |
|
|
|
|
|
|
|
| 403 |
submodels = []
|
| 404 |
|
| 405 |
def add_submodels(selection, num_selection, model_dict, dst_dir):
|
|
@@ -435,6 +439,10 @@ for submodel in submodels:
|
|
| 435 |
continue
|
| 436 |
url += f"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, "
|
| 437 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
def process_file_download(file_url):
|
| 439 |
if file_url.startswith("http"):
|
| 440 |
if "blob" in file_url:
|
|
@@ -447,27 +455,28 @@ def process_file_download(file_url):
|
|
| 447 |
|
| 448 |
current_tag = None
|
| 449 |
for line in lines:
|
| 450 |
-
if
|
| 451 |
-
|
| 452 |
-
current_tag = next((tag for tag in prefixes if tag in line.lower()))
|
| 453 |
|
| 454 |
-
urls = [url.strip() for url in line.split()]
|
| 455 |
for url in urls:
|
| 456 |
-
if url.startswith("http"):
|
| 457 |
globals()[prefixes[current_tag][1]] += ", " + url
|
|
|
|
| 458 |
|
| 459 |
# fix all possible errors/options and function call
|
| 460 |
if custom_file_urls:
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
if not
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
|
|
|
| 471 |
|
| 472 |
# url prefixing
|
| 473 |
urls = [globals()[urls[1]] for urls in prefixes.values()]
|
|
|
|
| 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 |
+
''' main download code '''
|
| 338 |
+
|
| 339 |
def handle_manual(url):
|
| 340 |
original_url = url
|
| 341 |
url = url.split(':', 1)[1]
|
|
|
|
| 402 |
url, dst_dir, file_name = link_or_path.split()
|
| 403 |
manual_download(url, dst_dir, file_name)
|
| 404 |
|
| 405 |
+
''' submodels - added urls '''
|
| 406 |
+
|
| 407 |
submodels = []
|
| 408 |
|
| 409 |
def add_submodels(selection, num_selection, model_dict, dst_dir):
|
|
|
|
| 439 |
continue
|
| 440 |
url += f"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, "
|
| 441 |
|
| 442 |
+
''' file.txt - added urls '''
|
| 443 |
+
|
| 444 |
+
unique_urls = []
|
| 445 |
+
|
| 446 |
def process_file_download(file_url):
|
| 447 |
if file_url.startswith("http"):
|
| 448 |
if "blob" in file_url:
|
|
|
|
| 455 |
|
| 456 |
current_tag = None
|
| 457 |
for line in lines:
|
| 458 |
+
if any(f'# {tag}' in line.lower() for tag in prefixes):
|
| 459 |
+
current_tag = next((tag for tag in prefixes if tag in line.lower()))
|
|
|
|
| 460 |
|
| 461 |
+
urls = [url.strip() for url in line.split(',')]
|
| 462 |
for url in urls:
|
| 463 |
+
if url.startswith("http") and url not in unique_urls:
|
| 464 |
globals()[prefixes[current_tag][1]] += ", " + url
|
| 465 |
+
unique_urls.append(url)
|
| 466 |
|
| 467 |
# fix all possible errors/options and function call
|
| 468 |
if custom_file_urls:
|
| 469 |
+
for custom_file_url in custom_file_urls.replace(',', '').split():
|
| 470 |
+
if not custom_file_url.endswith('.txt'):
|
| 471 |
+
custom_file_url += '.txt'
|
| 472 |
+
if not custom_file_url.startswith('http'):
|
| 473 |
+
if not custom_file_url.startswith(root_path):
|
| 474 |
+
custom_file_url = f'{root_path}/{custom_file_url}'
|
| 475 |
+
|
| 476 |
+
try:
|
| 477 |
+
process_file_download(custom_file_url)
|
| 478 |
+
except FileNotFoundError:
|
| 479 |
+
pass
|
| 480 |
|
| 481 |
# url prefixing
|
| 482 |
urls = [globals()[urls[1]] for urls in prefixes.values()]
|
files_cells/python/ru/widgets_ru.py
CHANGED
|
@@ -289,7 +289,12 @@ hr {
|
|
| 289 |
|
| 290 |
.button_save:active,
|
| 291 |
.button_ngrok:active {
|
| 292 |
-
filter: brightness(0.75);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
}
|
| 294 |
|
| 295 |
|
|
|
|
| 289 |
|
| 290 |
.button_save:active,
|
| 291 |
.button_ngrok:active {
|
| 292 |
+
filter: brightness(0.75) !important;
|
| 293 |
+
}
|
| 294 |
+
|
| 295 |
+
/* Removes ugly stroke from widget buttons. */
|
| 296 |
+
.jupyter-widgets.lm-Widget:focus {
|
| 297 |
+
outline: none;
|
| 298 |
}
|
| 299 |
|
| 300 |
|