its work!?
Browse files
files_cells/notebooks/ru/auto-cleaner_ru.ipynb
CHANGED
|
@@ -35,9 +35,13 @@
|
|
| 35 |
"\n",
|
| 36 |
"\n",
|
| 37 |
"# ================= DETECT ENV =================\n",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
"def detect_environment():\n",
|
| 39 |
" environments = {\n",
|
| 40 |
-
" 'COLAB_GPU': ('Google Colab', \"/content\"),\n",
|
| 41 |
" 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
|
| 42 |
" 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
|
| 43 |
" }\n",
|
|
|
|
| 35 |
"\n",
|
| 36 |
"\n",
|
| 37 |
"# ================= DETECT ENV =================\n",
|
| 38 |
+
"def check_colab_subscription():\n",
|
| 39 |
+
" return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)\n",
|
| 40 |
+
"free_plan = check_colab_subscription()\n",
|
| 41 |
+
"\n",
|
| 42 |
"def detect_environment():\n",
|
| 43 |
" environments = {\n",
|
| 44 |
+
" 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
|
| 45 |
" 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
|
| 46 |
" 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
|
| 47 |
" }\n",
|
files_cells/notebooks/ru/downloading_ru.ipynb
CHANGED
|
@@ -69,7 +69,7 @@
|
|
| 69 |
"if not os.path.exists(flag_file):\n",
|
| 70 |
" # automatic1111 update webui to 1.8.0\n",
|
| 71 |
" xformers = \"xformers==0.0.23.post1 triton==2.1.0\"\n",
|
| 72 |
-
" torch = \"torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121\"\n",
|
| 73 |
"\n",
|
| 74 |
" print(\"Установка библиотек, это займет какое-то время...\", end='')\n",
|
| 75 |
" with capture.capture_output() as cap:\n",
|
|
@@ -89,7 +89,7 @@
|
|
| 89 |
" !wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb\n",
|
| 90 |
"\n",
|
| 91 |
" if env == \"Google Colab\":\n",
|
| 92 |
-
" !pip install -q {
|
| 93 |
" else:\n",
|
| 94 |
" !pip install -q {torch} -U\n",
|
| 95 |
" !pip install -q {xformers} -U\n",
|
|
|
|
| 69 |
"if not os.path.exists(flag_file):\n",
|
| 70 |
" # automatic1111 update webui to 1.8.0\n",
|
| 71 |
" xformers = \"xformers==0.0.23.post1 triton==2.1.0\"\n",
|
| 72 |
+
" 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",
|
| 73 |
"\n",
|
| 74 |
" print(\"Установка библиотек, это займет какое-то время...\", end='')\n",
|
| 75 |
" with capture.capture_output() as cap:\n",
|
|
|
|
| 89 |
" !wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb\n",
|
| 90 |
"\n",
|
| 91 |
" if env == \"Google Colab\":\n",
|
| 92 |
+
" !pip install -q {torch} -U\n",
|
| 93 |
" else:\n",
|
| 94 |
" !pip install -q {torch} -U\n",
|
| 95 |
" !pip install -q {xformers} -U\n",
|
files_cells/notebooks/ru/widgets_ru.ipynb
CHANGED
|
@@ -363,9 +363,10 @@
|
|
| 363 |
"commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
|
| 364 |
"commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)\n",
|
| 365 |
"\n",
|
| 366 |
-
"
|
| 367 |
-
"
|
| 368 |
-
"
|
|
|
|
| 369 |
"\n",
|
| 370 |
"# --- CUSTOM DOWNLOAD ---\n",
|
| 371 |
"custom_download_header_popup = widgets.HTML('''\n",
|
|
|
|
| 363 |
"commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
|
| 364 |
"commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)\n",
|
| 365 |
"\n",
|
| 366 |
+
"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",
|
| 367 |
+
"if free_plan:\n",
|
| 368 |
+
" additional_widget_list.remove(ngrok_widget)\n",
|
| 369 |
+
"display(widgets.VBox(additional_widget_list).add_class(\"container\"))\n",
|
| 370 |
"\n",
|
| 371 |
"# --- CUSTOM DOWNLOAD ---\n",
|
| 372 |
"custom_download_header_popup = widgets.HTML('''\n",
|
files_cells/python/ru/auto-cleaner_ru.py
CHANGED
|
@@ -16,9 +16,13 @@ from IPython.display import display, HTML
|
|
| 16 |
|
| 17 |
|
| 18 |
# ================= DETECT ENV =================
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
def detect_environment():
|
| 20 |
environments = {
|
| 21 |
-
'COLAB_GPU': ('Google Colab', "/content"),
|
| 22 |
'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
|
| 23 |
'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
|
| 24 |
}
|
|
|
|
| 16 |
|
| 17 |
|
| 18 |
# ================= DETECT ENV =================
|
| 19 |
+
def check_colab_subscription():
|
| 20 |
+
return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
|
| 21 |
+
free_plan = check_colab_subscription()
|
| 22 |
+
|
| 23 |
def detect_environment():
|
| 24 |
environments = {
|
| 25 |
+
'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
|
| 26 |
'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
|
| 27 |
'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
|
| 28 |
}
|
files_cells/python/ru/downloading_ru.py
CHANGED
|
@@ -50,7 +50,7 @@ flag_file = f"{root_path}/libraries_installed.txt"
|
|
| 50 |
if not os.path.exists(flag_file):
|
| 51 |
# automatic1111 update webui to 1.8.0
|
| 52 |
xformers = "xformers==0.0.23.post1 triton==2.1.0"
|
| 53 |
-
torch = "torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121"
|
| 54 |
|
| 55 |
print("Установка библиотек, это займет какое-то время...", end='')
|
| 56 |
with capture.capture_output() as cap:
|
|
@@ -58,6 +58,7 @@ if not os.path.exists(flag_file):
|
|
| 58 |
get_ipython().system('npm install -g localtunnel &> /dev/null')
|
| 59 |
get_ipython().system('curl -s -OL https://github.com/DEX-1101/sd-webui-notebook/raw/main/res/new_tunnel --output-dir {root_path}')
|
| 60 |
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')
|
|
|
|
| 61 |
|
| 62 |
if env == "SageMaker Studio Lab":
|
| 63 |
get_ipython().run_line_magic('pip', 'install -q opencv-python-headless huggingface-hub')
|
|
@@ -69,11 +70,10 @@ if not os.path.exists(flag_file):
|
|
| 69 |
get_ipython().system('wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb')
|
| 70 |
|
| 71 |
if env == "Google Colab":
|
| 72 |
-
|
| 73 |
else:
|
| 74 |
get_ipython().system('pip install -q {torch} -U')
|
| 75 |
get_ipython().system('pip install -q {xformers} -U')
|
| 76 |
-
get_ipython().system('pip install insightface')
|
| 77 |
|
| 78 |
with open(flag_file, "w") as f:
|
| 79 |
f.write("hey ;3")
|
|
@@ -181,7 +181,7 @@ if latest_webui or latest_exstensions:
|
|
| 181 |
# --- All ---
|
| 182 |
# --- Encrypt-Image ---
|
| 183 |
get_ipython().system("sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js")
|
| 184 |
-
if env
|
| 185 |
if os.path.exists(f"{webui_path}/extensions/Encrypt-Image"):
|
| 186 |
get_ipython().system('rm -rf {webui_path}/extensions/Encrypt-Image')
|
| 187 |
|
|
|
|
| 50 |
if not os.path.exists(flag_file):
|
| 51 |
# automatic1111 update webui to 1.8.0
|
| 52 |
xformers = "xformers==0.0.23.post1 triton==2.1.0"
|
| 53 |
+
torch = "torch==2.1.2+cu121 torchvision==0.16.2+cu121 torchaudio==2.1.2 --extra-index-url https://download.pytorch.org/whl/cu121"
|
| 54 |
|
| 55 |
print("Установка библиотек, это займет какое-то время...", end='')
|
| 56 |
with capture.capture_output() as cap:
|
|
|
|
| 58 |
get_ipython().system('npm install -g localtunnel &> /dev/null')
|
| 59 |
get_ipython().system('curl -s -OL https://github.com/DEX-1101/sd-webui-notebook/raw/main/res/new_tunnel --output-dir {root_path}')
|
| 60 |
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')
|
| 61 |
+
get_ipython().system('pip install insightface')
|
| 62 |
|
| 63 |
if env == "SageMaker Studio Lab":
|
| 64 |
get_ipython().run_line_magic('pip', 'install -q opencv-python-headless huggingface-hub')
|
|
|
|
| 70 |
get_ipython().system('wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb')
|
| 71 |
|
| 72 |
if env == "Google Colab":
|
| 73 |
+
get_ipython().system('pip install -q {torch} -U')
|
| 74 |
else:
|
| 75 |
get_ipython().system('pip install -q {torch} -U')
|
| 76 |
get_ipython().system('pip install -q {xformers} -U')
|
|
|
|
| 77 |
|
| 78 |
with open(flag_file, "w") as f:
|
| 79 |
f.write("hey ;3")
|
|
|
|
| 181 |
# --- All ---
|
| 182 |
# --- Encrypt-Image ---
|
| 183 |
get_ipython().system("sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js")
|
| 184 |
+
if env = "Google Colab":
|
| 185 |
if os.path.exists(f"{webui_path}/extensions/Encrypt-Image"):
|
| 186 |
get_ipython().system('rm -rf {webui_path}/extensions/Encrypt-Image')
|
| 187 |
|
files_cells/python/ru/widgets_ru.py
CHANGED
|
@@ -344,9 +344,10 @@ ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, la
|
|
| 344 |
commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
|
| 345 |
commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)
|
| 346 |
|
| 347 |
-
|
| 348 |
-
|
| 349 |
-
|
|
|
|
| 350 |
|
| 351 |
# --- CUSTOM DOWNLOAD ---
|
| 352 |
custom_download_header_popup = widgets.HTML('''
|
|
|
|
| 344 |
commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
|
| 345 |
commandline_arguments_widget = widgets.Text(description='Аргументы:', value=commandline_arguments_options, style=style, layout=layout)
|
| 346 |
|
| 347 |
+
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]
|
| 348 |
+
if free_plan:
|
| 349 |
+
additional_widget_list.remove(ngrok_widget)
|
| 350 |
+
display(widgets.VBox(additional_widget_list).add_class("container"))
|
| 351 |
|
| 352 |
# --- CUSTOM DOWNLOAD ---
|
| 353 |
custom_download_header_popup = widgets.HTML('''
|