NagisaNao commited on
Commit
ba1b35e
1 Parent(s): 4df6819

update to en translate

Browse files
files_cells/notebooks/en/auto-cleaner_en.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/en/downloading_en.ipynb CHANGED
@@ -33,9 +33,13 @@
33
  "\n",
34
  "\n",
35
  "# ================= DETECT ENV =================\n",
 
 
 
 
36
  "def detect_environment():\n",
37
  " environments = {\n",
38
- " 'COLAB_GPU': ('Google Colab', \"/content\"),\n",
39
  " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
40
  " 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
41
  " }\n",
@@ -63,9 +67,9 @@
63
  "flag_file = f\"{root_path}/libraries_installed.txt\"\n",
64
  "\n",
65
  "if not os.path.exists(flag_file):\n",
66
- " # A1111 update webui to 1.8.0\n",
67
  " xformers = \"xformers==0.0.23.post1 triton==2.1.0\"\n",
68
- " torch = \"torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121\"\n",
69
  "\n",
70
  " print(\"Installing the libraries, it's going to take a while....\", end='')\n",
71
  " with capture.capture_output() as cap:\n",
@@ -85,7 +89,7 @@
85
  " !wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb\n",
86
  "\n",
87
  " if env == \"Google Colab\":\n",
88
- " !pip install -q {xformers} -U\n",
89
  " else:\n",
90
  " !pip install -q {torch} -U\n",
91
  " !pip install -q {xformers} -U\n",
@@ -187,13 +191,16 @@
187
  " else:\n",
188
  " !{'for dir in /home/studio-lab-user/content/sdw/extensions/*/; do cd \\\"$dir\\\" && git fetch origin && git pull; done'}\n",
189
  "\n",
 
 
 
 
190
  " !cd {webui_path}/repositories/stable-diffusion-stability-ai && git restore .\n",
191
  " del cap\n",
192
  " print(f\"\\r✨ {action} Completed!\")\n",
193
  "\n",
194
  "\n",
195
  "# === FIXING ERRORS ===\n",
196
- "# --- All ---\n",
197
  "# --- Encrypt-Image ---\n",
198
  "!sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js\n",
199
  "\n",
 
33
  "\n",
34
  "\n",
35
  "# ================= DETECT ENV =================\n",
36
+ "def check_colab_subscription():\n",
37
+ " return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)\n",
38
+ "free_plan = check_colab_subscription()\n",
39
+ "\n",
40
  "def detect_environment():\n",
41
  " environments = {\n",
42
+ " 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
43
  " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
44
  " 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
45
  " }\n",
 
67
  "flag_file = f\"{root_path}/libraries_installed.txt\"\n",
68
  "\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(\"Installing the libraries, it's going to take a while....\", 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",
 
191
  " else:\n",
192
  " !{'for dir in /home/studio-lab-user/content/sdw/extensions/*/; do cd \\\"$dir\\\" && git fetch origin && git pull; done'}\n",
193
  "\n",
194
+ " # My Chinese friend, you broke the images again in the latest update... >W<'\n",
195
+ " %cd {webui_path}/extensions/Encrypt-Image\n",
196
+ " !git reset --hard 376358d8854472b9ea50e9fc8800367d1ca51137 # stable commit :3\n",
197
+ "\n",
198
  " !cd {webui_path}/repositories/stable-diffusion-stability-ai && git restore .\n",
199
  " del cap\n",
200
  " print(f\"\\r✨ {action} Completed!\")\n",
201
  "\n",
202
  "\n",
203
  "# === FIXING ERRORS ===\n",
 
204
  "# --- Encrypt-Image ---\n",
205
  "!sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js\n",
206
  "\n",
files_cells/notebooks/en/launch_en.ipynb CHANGED
@@ -33,9 +33,13 @@
33
  "\n",
34
  "\n",
35
  "# ================= DETECT ENV =================\n",
 
 
 
 
36
  "def detect_environment():\n",
37
  " environments = {\n",
38
- " 'COLAB_GPU': ('Google Colab', \"/content\"),\n",
39
  " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
40
  " 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
41
  " }\n",
@@ -96,10 +100,12 @@
96
  " with tunnel:\n",
97
  " !#python -m http.server 1101\n",
98
  " %cd {webui_path}\n",
 
99
  "\n",
100
  " if ngrok_token:\n",
101
  " commandline_arguments += ' --ngrok ' + ngrok_token\n",
102
- " commandline_arguments += f\" --port=1101 --encrypt-pass=1769\" # --encrypt-pass={password}\n",
 
103
  "\n",
104
  " !COMMANDLINE_ARGS=\"{commandline_arguments}\" python launch.py\n",
105
  "\n",
 
33
  "\n",
34
  "\n",
35
  "# ================= DETECT ENV =================\n",
36
+ "def check_colab_subscription():\n",
37
+ " return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)\n",
38
+ "free_plan = check_colab_subscription()\n",
39
+ "\n",
40
  "def detect_environment():\n",
41
  " environments = {\n",
42
+ " 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
43
  " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
44
  " 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
45
  " }\n",
 
100
  " with tunnel:\n",
101
  " !#python -m http.server 1101\n",
102
  " %cd {webui_path}\n",
103
+ " commandline_arguments += f\" --port=1101\"\n",
104
  "\n",
105
  " if ngrok_token:\n",
106
  " commandline_arguments += ' --ngrok ' + ngrok_token\n",
107
+ " if env != \"Google Colab\":\n",
108
+ " commandline_arguments += f\" --encrypt-pass=1769\"\n",
109
  "\n",
110
  " !COMMANDLINE_ARGS=\"{commandline_arguments}\" python launch.py\n",
111
  "\n",
files_cells/notebooks/en/widgets_en.ipynb CHANGED
@@ -27,9 +27,13 @@
27
  "\n",
28
  "\n",
29
  "# ================= DETECT ENV =================\n",
 
 
 
 
30
  "def detect_environment():\n",
31
  " environments = {\n",
32
- " 'COLAB_GPU': ('Google Colab', \"/content\"),\n",
33
  " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
34
  " 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
35
  " }\n",
@@ -359,9 +363,10 @@
359
  "commandline_arguments_options = \"--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers\"\n",
360
  "commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)\n",
361
  "\n",
362
- "display(widgets.VBox([\n",
363
- " 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",
364
- " ]).add_class(\"container\"))\n",
 
365
  "\n",
366
  "# --- CUSTOM DOWNLOAD ---\n",
367
  "custom_download_header_popup = widgets.HTML('''\n",
 
27
  "\n",
28
  "\n",
29
  "# ================= DETECT ENV =================\n",
30
+ "def check_colab_subscription():\n",
31
+ " return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)\n",
32
+ "free_plan = check_colab_subscription()\n",
33
+ "\n",
34
  "def detect_environment():\n",
35
  " environments = {\n",
36
+ " 'COLAB_GPU': ('Google Colab', \"/root\" if free_plan else \"/content\"),\n",
37
  " 'KAGGLE_URL_BASE': ('Kaggle', \"/kaggle/working/content\"),\n",
38
  " 'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', \"/home/studio-lab-user/content\")\n",
39
  " }\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='Arguments:', 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/notebooks/ru/downloading_ru.ipynb CHANGED
@@ -191,18 +191,18 @@
191
  " else:\n",
192
  " !{'for dir in /home/studio-lab-user/content/sdw/extensions/*/; do cd \\\"$dir\\\" && git fetch origin && git pull; done'}\n",
193
  "\n",
 
 
 
 
194
  " !cd {webui_path}/repositories/stable-diffusion-stability-ai && git restore .\n",
195
  " del cap\n",
196
  " print(f\"\\r✨ {action} Завершено!\")\n",
197
  "\n",
198
  "\n",
199
  "# === FIXING ERRORS ===\n",
200
- "# --- All ---\n",
201
  "# --- Encrypt-Image ---\n",
202
  "!sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js\n",
203
- "if env = \"Google Colab\":\n",
204
- " if os.path.exists(f\"{webui_path}/extensions/Encrypt-Image\"):\n",
205
- " !rm -rf {webui_path}/extensions/Encrypt-Image\n",
206
  "\n",
207
  "# --- SageMaker ---\n",
208
  "if env == \"SageMaker Studio Lab\":\n",
 
191
  " else:\n",
192
  " !{'for dir in /home/studio-lab-user/content/sdw/extensions/*/; do cd \\\"$dir\\\" && git fetch origin && git pull; done'}\n",
193
  "\n",
194
+ " # My Chinese friend, you broke the images again in the latest update... >W<'\n",
195
+ " %cd {webui_path}/extensions/Encrypt-Image\n",
196
+ " !git reset --hard 376358d8854472b9ea50e9fc8800367d1ca51137 # stable commit :3\n",
197
+ "\n",
198
  " !cd {webui_path}/repositories/stable-diffusion-stability-ai && git restore .\n",
199
  " del cap\n",
200
  " print(f\"\\r✨ {action} Завершено!\")\n",
201
  "\n",
202
  "\n",
203
  "# === FIXING ERRORS ===\n",
 
204
  "# --- Encrypt-Image ---\n",
205
  "!sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js\n",
 
 
 
206
  "\n",
207
  "# --- SageMaker ---\n",
208
  "if env == \"SageMaker Studio Lab\":\n",
files_cells/python/en/auto-cleaner_en.py CHANGED
@@ -16,9 +16,13 @@ from IPython.display import display, HTML, Javascript
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/en/downloading_en.py CHANGED
@@ -14,9 +14,13 @@ from IPython.display import clear_output
14
 
15
 
16
  # ================= DETECT ENV =================
 
 
 
 
17
  def detect_environment():
18
  environments = {
19
- 'COLAB_GPU': ('Google Colab', "/content"),
20
  'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
21
  'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
22
  }
@@ -44,9 +48,9 @@ if env == "SageMaker Studio Lab":
44
  flag_file = f"{root_path}/libraries_installed.txt"
45
 
46
  if not os.path.exists(flag_file):
47
- # A1111 update webui to 1.8.0
48
  xformers = "xformers==0.0.23.post1 triton==2.1.0"
49
- torch = "torch==2.1.2+cu121 torchvision==0.16.2+cu121 --extra-index-url https://download.pytorch.org/whl/cu121"
50
 
51
  print("Installing the libraries, it's going to take a while....", end='')
52
  with capture.capture_output() as cap:
@@ -66,7 +70,7 @@ if not os.path.exists(flag_file):
66
  get_ipython().system('wget -P /home/studio-lab-user https://huggingface.co/NagisaNao/fast_repo/resolve/main/sagemaker/FULL_DELETED_NOTEBOOK.ipynb')
67
 
68
  if env == "Google Colab":
69
- get_ipython().system('pip install -q {xformers} -U')
70
  else:
71
  get_ipython().system('pip install -q {torch} -U')
72
  get_ipython().system('pip install -q {xformers} -U')
@@ -168,13 +172,16 @@ if latest_webui or latest_exstensions:
168
  else:
169
  get_ipython().system('{\'for dir in /home/studio-lab-user/content/sdw/extensions/*/; do cd \\"$dir\\" && git fetch origin && git pull; done\'}')
170
 
 
 
 
 
171
  get_ipython().system('cd {webui_path}/repositories/stable-diffusion-stability-ai && git restore .')
172
  del cap
173
  print(f"\r✨ {action} Completed!")
174
 
175
 
176
  # === FIXING ERRORS ===
177
- # --- All ---
178
  # --- Encrypt-Image ---
179
  get_ipython().system("sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js")
180
 
 
14
 
15
 
16
  # ================= DETECT ENV =================
17
+ def check_colab_subscription():
18
+ return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
19
+ free_plan = check_colab_subscription()
20
+
21
  def detect_environment():
22
  environments = {
23
+ 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
24
  'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
25
  'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
26
  }
 
48
  flag_file = f"{root_path}/libraries_installed.txt"
49
 
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("Installing the libraries, it's going to take a while....", end='')
56
  with capture.capture_output() as cap:
 
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')
 
172
  else:
173
  get_ipython().system('{\'for dir in /home/studio-lab-user/content/sdw/extensions/*/; do cd \\"$dir\\" && git fetch origin && git pull; done\'}')
174
 
175
+ # My Chinese friend, you broke the images again in the latest update... >W<'
176
+ get_ipython().run_line_magic('cd', '{webui_path}/extensions/Encrypt-Image')
177
+ get_ipython().system('git reset --hard 376358d8854472b9ea50e9fc8800367d1ca51137 # stable commit :3')
178
+
179
  get_ipython().system('cd {webui_path}/repositories/stable-diffusion-stability-ai && git restore .')
180
  del cap
181
  print(f"\r✨ {action} Completed!")
182
 
183
 
184
  # === FIXING ERRORS ===
 
185
  # --- Encrypt-Image ---
186
  get_ipython().system("sed -i '9,37d' {webui_path}/extensions/Encrypt-Image/javascript/encrypt_images_info.js")
187
 
files_cells/python/en/launch_en.py CHANGED
@@ -9,9 +9,13 @@ from datetime import timedelta
9
 
10
 
11
  # ================= DETECT ENV =================
 
 
 
 
12
  def detect_environment():
13
  environments = {
14
- 'COLAB_GPU': ('Google Colab', "/content"),
15
  'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
16
  'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
17
  }
@@ -72,10 +76,12 @@ if env != "SageMaker Studio Lab":
72
  with tunnel:
73
  get_ipython().system('#python -m http.server 1101')
74
  get_ipython().run_line_magic('cd', '{webui_path}')
 
75
 
76
  if ngrok_token:
77
  commandline_arguments += ' --ngrok ' + ngrok_token
78
- commandline_arguments += f" --port=1101 --encrypt-pass=1769" # --encrypt-pass={password}
 
79
 
80
  get_ipython().system('COMMANDLINE_ARGS="{commandline_arguments}" python launch.py')
81
 
 
9
 
10
 
11
  # ================= DETECT ENV =================
12
+ def check_colab_subscription():
13
+ return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
14
+ free_plan = check_colab_subscription()
15
+
16
  def detect_environment():
17
  environments = {
18
+ 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
19
  'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
20
  'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
21
  }
 
76
  with tunnel:
77
  get_ipython().system('#python -m http.server 1101')
78
  get_ipython().run_line_magic('cd', '{webui_path}')
79
+ commandline_arguments += f" --port=1101"
80
 
81
  if ngrok_token:
82
  commandline_arguments += ' --ngrok ' + ngrok_token
83
+ if env != "Google Colab":
84
+ commandline_arguments += f" --encrypt-pass=1769"
85
 
86
  get_ipython().system('COMMANDLINE_ARGS="{commandline_arguments}" python launch.py')
87
 
files_cells/python/en/widgets_en.py CHANGED
@@ -8,9 +8,13 @@ from IPython.display import display, HTML, Javascript, clear_output
8
 
9
 
10
  # ================= DETECT ENV =================
 
 
 
 
11
  def detect_environment():
12
  environments = {
13
- 'COLAB_GPU': ('Google Colab', "/content"),
14
  'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
15
  'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
16
  }
@@ -340,9 +344,10 @@ ngrok_widget = widgets.HBox([ngrok_token_widget, ngrock_button], style=style, la
340
  commandline_arguments_options = "--listen --enable-insecure-extension-access --theme dark --no-half-vae --disable-console-progressbars --xformers"
341
  commandline_arguments_widget = widgets.Text(description='Arguments:', value=commandline_arguments_options, style=style, layout=layout)
342
 
343
- display(widgets.VBox([
344
- additional_header, latest_changes_widget, HR, controlnet_widget, controlnet_Num_widget, commit_hash_widget, optional_huggingface_token_widget, ngrok_widget, HR, commandline_arguments_widget
345
- ]).add_class("container"))
 
346
 
347
  # --- CUSTOM DOWNLOAD ---
348
  custom_download_header_popup = widgets.HTML('''
 
8
 
9
 
10
  # ================= DETECT ENV =================
11
+ def check_colab_subscription():
12
+ return (os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES') / (1024. ** 3) <= 20)
13
+ free_plan = check_colab_subscription()
14
+
15
  def detect_environment():
16
  environments = {
17
+ 'COLAB_GPU': ('Google Colab', "/root" if free_plan else "/content"),
18
  'KAGGLE_URL_BASE': ('Kaggle', "/kaggle/working/content"),
19
  'SAGEMAKER_INTERNAL_IMAGE_URI': ('SageMaker Studio Lab', "/home/studio-lab-user/content")
20
  }
 
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='Arguments:', 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('''
files_cells/python/ru/downloading_ru.py CHANGED
@@ -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 == "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
 
 
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