NagisaNao commited on
Commit
f259cf2
1 Parent(s): d82105e
files_cells/notebooks/en/downloading_en.ipynb CHANGED
@@ -339,12 +339,14 @@
339
  " \"vae:\",\n",
340
  " \"lora:\",\n",
341
  " \"embeddings:\",\n",
342
- " \"extensions:\"\n",
 
343
  "]\n",
344
  "\n",
345
  "!mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}\n",
346
  "\n",
347
  "url = \"\"\n",
 
348
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
349
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
350
  "# user_header = f\"\\\"Authorization: Bearer {optional_huggingface_token}\\\"\"\n",
@@ -357,7 +359,7 @@
357
  " if file_name:\n",
358
  " url = re.sub(r'\\[.*?\\]', '', url)\n",
359
  "\n",
360
- " dir_mapping = {\"model\": models_dir, \"vae\": vaes_dir, \"lora\": loras_dir, \"embeddings\": embeddings_dir, \"extensions\": None}\n",
361
  "\n",
362
  " for prefix, dir in dir_mapping.items():\n",
363
  " if original_url.startswith(f\"{prefix}:\"):\n",
@@ -458,7 +460,8 @@
458
  " 'vae': 'Vae_url',\n",
459
  " 'embed': 'Embedding_url',\n",
460
  " 'lora': 'LoRA_url',\n",
461
- " 'extension': 'Extensions_url'\n",
 
462
  " }\n",
463
  "\n",
464
  " if file_url.startswith(\"http\"):\n",
@@ -487,15 +490,13 @@
487
  " if not custom_file_urls.startswith('http'):\n",
488
  " if not custom_file_urls.startswith(root_path):\n",
489
  " custom_file_urls = f'{root_path}/{custom_file_urls}'\n",
490
- " if custom_file_urls.count('/content') >= 2:\n",
491
- " custom_file_urls = re.sub(r'(/content){2,}', '/content', custom_file_urls)\n",
492
  "\n",
493
  " try:\n",
494
  " process_file_download(custom_file_urls)\n",
495
  " except FileNotFoundError:\n",
496
  " pass\n",
497
  "\n",
498
- "urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url]\n",
499
  "\n",
500
  "for i, prefix in enumerate(prefixes):\n",
501
  " if urls[i]:\n",
 
339
  " \"vae:\",\n",
340
  " \"lora:\",\n",
341
  " \"embeddings:\",\n",
342
+ " \"extensions:\",\n",
343
+ " \"control:\"\n",
344
  "]\n",
345
  "\n",
346
  "!mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}\n",
347
  "\n",
348
  "url = \"\"\n",
349
+ "ControlNet_url = \"\"\n",
350
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
351
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
352
  "# user_header = f\"\\\"Authorization: Bearer {optional_huggingface_token}\\\"\"\n",
 
359
  " if file_name:\n",
360
  " url = re.sub(r'\\[.*?\\]', '', url)\n",
361
  "\n",
362
+ " dir_mapping = {\"model\": models_dir, \"vae\": vaes_dir, \"lora\": loras_dir, \"embeddings\": embeddings_dir, \"extensions\": None, \"control\": control_dir}\n",
363
  "\n",
364
  " for prefix, dir in dir_mapping.items():\n",
365
  " if original_url.startswith(f\"{prefix}:\"):\n",
 
460
  " 'vae': 'Vae_url',\n",
461
  " 'embed': 'Embedding_url',\n",
462
  " 'lora': 'LoRA_url',\n",
463
+ " 'extension': 'Extensions_url',\n",
464
+ " 'control': 'ControlNet_url'\n",
465
  " }\n",
466
  "\n",
467
  " if file_url.startswith(\"http\"):\n",
 
490
  " if not custom_file_urls.startswith('http'):\n",
491
  " if not custom_file_urls.startswith(root_path):\n",
492
  " custom_file_urls = f'{root_path}/{custom_file_urls}'\n",
 
 
493
  "\n",
494
  " try:\n",
495
  " process_file_download(custom_file_urls)\n",
496
  " except FileNotFoundError:\n",
497
  " pass\n",
498
  "\n",
499
+ "urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url, ControlNet_url]\n",
500
  "\n",
501
  "for i, prefix in enumerate(prefixes):\n",
502
  " if urls[i]:\n",
files_cells/notebooks/ru/downloading_ru.ipynb CHANGED
@@ -91,8 +91,7 @@
91
  " if env == \"Google Colab\":\n",
92
  " !pip install -q pip install xformers==0.0.26.dev769 -U\n",
93
  " else:\n",
94
- " if env != \"Kaggle\":\n",
95
- " !pip install -q {torch} -U\n",
96
  " !pip install -q {xformers} -U\n",
97
  "\n",
98
  " with open(flag_file, \"w\") as f:\n",
@@ -339,12 +338,14 @@
339
  " \"vae:\",\n",
340
  " \"lora:\",\n",
341
  " \"embeddings:\",\n",
342
- " \"extensions:\"\n",
 
343
  "]\n",
344
  "\n",
345
  "!mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}\n",
346
  "\n",
347
  "url = \"\"\n",
 
348
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
349
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
350
  "# user_header = f\"\\\"Authorization: Bearer {optional_huggingface_token}\\\"\"\n",
@@ -357,7 +358,7 @@
357
  " if file_name:\n",
358
  " url = re.sub(r'\\[.*?\\]', '', url)\n",
359
  "\n",
360
- " dir_mapping = {\"model\": models_dir, \"vae\": vaes_dir, \"lora\": loras_dir, \"embeddings\": embeddings_dir, \"extensions\": None}\n",
361
  "\n",
362
  " for prefix, dir in dir_mapping.items():\n",
363
  " if original_url.startswith(f\"{prefix}:\"):\n",
@@ -452,13 +453,14 @@
452
  " url += f\"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, \"\n",
453
  "\n",
454
  "def process_file_download(file_url):\n",
455
- " global Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url\n",
456
  " urls_dict = {\n",
457
  " 'model': 'Model_url',\n",
458
  " 'vae': 'Vae_url',\n",
459
  " 'embed': 'Embedding_url',\n",
460
  " 'lora': 'LoRA_url',\n",
461
- " 'extension': 'Extensions_url'\n",
 
462
  " }\n",
463
  "\n",
464
  " if file_url.startswith(\"http\"):\n",
@@ -487,15 +489,13 @@
487
  " if not custom_file_urls.startswith('http'):\n",
488
  " if not custom_file_urls.startswith(root_path):\n",
489
  " custom_file_urls = f'{root_path}/{custom_file_urls}'\n",
490
- " if custom_file_urls.count('/content') >= 2:\n",
491
- " custom_file_urls = re.sub(r'(/content){2,}', '/content', custom_file_urls)\n",
492
  "\n",
493
  " try:\n",
494
  " process_file_download(custom_file_urls)\n",
495
  " except FileNotFoundError:\n",
496
  " pass\n",
497
  "\n",
498
- "urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url]\n",
499
  "\n",
500
  "for i, prefix in enumerate(prefixes):\n",
501
  " if urls[i]:\n",
 
91
  " if env == \"Google Colab\":\n",
92
  " !pip install -q pip install xformers==0.0.26.dev769 -U\n",
93
  " else:\n",
94
+ " !pip install -q {torch} -U\n",
 
95
  " !pip install -q {xformers} -U\n",
96
  "\n",
97
  " with open(flag_file, \"w\") as f:\n",
 
338
  " \"vae:\",\n",
339
  " \"lora:\",\n",
340
  " \"embeddings:\",\n",
341
+ " \"extensions:\",\n",
342
+ " \"control:\"\n",
343
  "]\n",
344
  "\n",
345
  "!mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}\n",
346
  "\n",
347
  "url = \"\"\n",
348
+ "ControlNet_url = \"\"\n",
349
  "hf_token = optional_huggingface_token if optional_huggingface_token else \"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\"\n",
350
  "user_header = f\"\\\"Authorization: Bearer {hf_token}\\\"\"\n",
351
  "# user_header = f\"\\\"Authorization: Bearer {optional_huggingface_token}\\\"\"\n",
 
358
  " if file_name:\n",
359
  " url = re.sub(r'\\[.*?\\]', '', url)\n",
360
  "\n",
361
+ " dir_mapping = {\"model\": models_dir, \"vae\": vaes_dir, \"lora\": loras_dir, \"embeddings\": embeddings_dir, \"extensions\": None, \"control\": control_dir}\n",
362
  "\n",
363
  " for prefix, dir in dir_mapping.items():\n",
364
  " if original_url.startswith(f\"{prefix}:\"):\n",
 
453
  " url += f\"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, \"\n",
454
  "\n",
455
  "def process_file_download(file_url):\n",
456
+ " global Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url, ControlNet_url\n",
457
  " urls_dict = {\n",
458
  " 'model': 'Model_url',\n",
459
  " 'vae': 'Vae_url',\n",
460
  " 'embed': 'Embedding_url',\n",
461
  " 'lora': 'LoRA_url',\n",
462
+ " 'extension': 'Extensions_url',\n",
463
+ " 'control': 'ControlNet_url'\n",
464
  " }\n",
465
  "\n",
466
  " if file_url.startswith(\"http\"):\n",
 
489
  " if not custom_file_urls.startswith('http'):\n",
490
  " if not custom_file_urls.startswith(root_path):\n",
491
  " custom_file_urls = f'{root_path}/{custom_file_urls}'\n",
 
 
492
  "\n",
493
  " try:\n",
494
  " process_file_download(custom_file_urls)\n",
495
  " except FileNotFoundError:\n",
496
  " pass\n",
497
  "\n",
498
+ "urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url, ControlNet_url]\n",
499
  "\n",
500
  "for i, prefix in enumerate(prefixes):\n",
501
  " if urls[i]:\n",
files_cells/python/en/auto-cleaner_en.py CHANGED
@@ -247,10 +247,11 @@ def clean_directory(directory):
247
  deleted_files = 0
248
  for root, dirs, files in os.walk(directory):
249
  for file in files:
250
- if file.endswith((".txt", ".yaml")):
251
  continue
252
  os.remove(os.path.join(root, file))
253
- deleted_files += 1
 
254
  return deleted_files
255
 
256
 
 
247
  deleted_files = 0
248
  for root, dirs, files in os.walk(directory):
249
  for file in files:
250
+ if file.endswith(".txt"):
251
  continue
252
  os.remove(os.path.join(root, file))
253
+ if not file.endswith(".yaml"):
254
+ deleted_files += 1
255
  return deleted_files
256
 
257
 
files_cells/python/en/downloading_en.py CHANGED
@@ -320,12 +320,14 @@ prefixes = [
320
  "vae:",
321
  "lora:",
322
  "embeddings:",
323
- "extensions:"
 
324
  ]
325
 
326
  get_ipython().system('mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}')
327
 
328
  url = ""
 
329
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
330
  user_header = f"\"Authorization: Bearer {hf_token}\""
331
  # user_header = f"\"Authorization: Bearer {optional_huggingface_token}\""
@@ -338,7 +340,7 @@ def handle_manual(url):
338
  if file_name:
339
  url = re.sub(r'\[.*?\]', '', url)
340
 
341
- dir_mapping = {"model": models_dir, "vae": vaes_dir, "lora": loras_dir, "embeddings": embeddings_dir, "extensions": None}
342
 
343
  for prefix, dir in dir_mapping.items():
344
  if original_url.startswith(f"{prefix}:"):
@@ -439,7 +441,8 @@ def process_file_download(file_url):
439
  'vae': 'Vae_url',
440
  'embed': 'Embedding_url',
441
  'lora': 'LoRA_url',
442
- 'extension': 'Extensions_url'
 
443
  }
444
 
445
  if file_url.startswith("http"):
@@ -468,15 +471,13 @@ if custom_file_urls:
468
  if not custom_file_urls.startswith('http'):
469
  if not custom_file_urls.startswith(root_path):
470
  custom_file_urls = f'{root_path}/{custom_file_urls}'
471
- if custom_file_urls.count('/content') >= 2:
472
- custom_file_urls = re.sub(r'(/content){2,}', '/content', custom_file_urls)
473
 
474
  try:
475
  process_file_download(custom_file_urls)
476
  except FileNotFoundError:
477
  pass
478
 
479
- urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url]
480
 
481
  for i, prefix in enumerate(prefixes):
482
  if urls[i]:
 
320
  "vae:",
321
  "lora:",
322
  "embeddings:",
323
+ "extensions:",
324
+ "control:"
325
  ]
326
 
327
  get_ipython().system('mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}')
328
 
329
  url = ""
330
+ ControlNet_url = ""
331
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
332
  user_header = f"\"Authorization: Bearer {hf_token}\""
333
  # user_header = f"\"Authorization: Bearer {optional_huggingface_token}\""
 
340
  if file_name:
341
  url = re.sub(r'\[.*?\]', '', url)
342
 
343
+ dir_mapping = {"model": models_dir, "vae": vaes_dir, "lora": loras_dir, "embeddings": embeddings_dir, "extensions": None, "control": control_dir}
344
 
345
  for prefix, dir in dir_mapping.items():
346
  if original_url.startswith(f"{prefix}:"):
 
441
  'vae': 'Vae_url',
442
  'embed': 'Embedding_url',
443
  'lora': 'LoRA_url',
444
+ 'extension': 'Extensions_url',
445
+ 'control': 'ControlNet_url'
446
  }
447
 
448
  if file_url.startswith("http"):
 
471
  if not custom_file_urls.startswith('http'):
472
  if not custom_file_urls.startswith(root_path):
473
  custom_file_urls = f'{root_path}/{custom_file_urls}'
 
 
474
 
475
  try:
476
  process_file_download(custom_file_urls)
477
  except FileNotFoundError:
478
  pass
479
 
480
+ urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url, ControlNet_url]
481
 
482
  for i, prefix in enumerate(prefixes):
483
  if urls[i]:
files_cells/python/ru/auto-cleaner_ru.py CHANGED
@@ -247,10 +247,11 @@ def clean_directory(directory):
247
  deleted_files = 0
248
  for root, dirs, files in os.walk(directory):
249
  for file in files:
250
- if file.endswith((".txt", ".yaml")):
251
  continue
252
  os.remove(os.path.join(root, file))
253
- deleted_files += 1
 
254
  return deleted_files
255
 
256
 
 
247
  deleted_files = 0
248
  for root, dirs, files in os.walk(directory):
249
  for file in files:
250
+ if file.endswith(".txt"):
251
  continue
252
  os.remove(os.path.join(root, file))
253
+ if not file.endswith(".yaml"):
254
+ deleted_files += 1
255
  return deleted_files
256
 
257
 
files_cells/python/ru/downloading_ru.py CHANGED
@@ -72,8 +72,7 @@ if not os.path.exists(flag_file):
72
  if env == "Google Colab":
73
  get_ipython().system('pip install -q pip install xformers==0.0.26.dev769 -U')
74
  else:
75
- if env != "Kaggle":
76
- get_ipython().system('pip install -q {torch} -U')
77
  get_ipython().system('pip install -q {xformers} -U')
78
 
79
  with open(flag_file, "w") as f:
@@ -320,12 +319,14 @@ prefixes = [
320
  "vae:",
321
  "lora:",
322
  "embeddings:",
323
- "extensions:"
 
324
  ]
325
 
326
  get_ipython().system('mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}')
327
 
328
  url = ""
 
329
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
330
  user_header = f"\"Authorization: Bearer {hf_token}\""
331
  # user_header = f"\"Authorization: Bearer {optional_huggingface_token}\""
@@ -338,7 +339,7 @@ def handle_manual(url):
338
  if file_name:
339
  url = re.sub(r'\[.*?\]', '', url)
340
 
341
- dir_mapping = {"model": models_dir, "vae": vaes_dir, "lora": loras_dir, "embeddings": embeddings_dir, "extensions": None}
342
 
343
  for prefix, dir in dir_mapping.items():
344
  if original_url.startswith(f"{prefix}:"):
@@ -433,13 +434,14 @@ for submodel in submodels:
433
  url += f"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, "
434
 
435
  def process_file_download(file_url):
436
- global Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url
437
  urls_dict = {
438
  'model': 'Model_url',
439
  'vae': 'Vae_url',
440
  'embed': 'Embedding_url',
441
  'lora': 'LoRA_url',
442
- 'extension': 'Extensions_url'
 
443
  }
444
 
445
  if file_url.startswith("http"):
@@ -468,15 +470,13 @@ if custom_file_urls:
468
  if not custom_file_urls.startswith('http'):
469
  if not custom_file_urls.startswith(root_path):
470
  custom_file_urls = f'{root_path}/{custom_file_urls}'
471
- if custom_file_urls.count('/content') >= 2:
472
- custom_file_urls = re.sub(r'(/content){2,}', '/content', custom_file_urls)
473
 
474
  try:
475
  process_file_download(custom_file_urls)
476
  except FileNotFoundError:
477
  pass
478
 
479
- urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url]
480
 
481
  for i, prefix in enumerate(prefixes):
482
  if urls[i]:
 
72
  if env == "Google Colab":
73
  get_ipython().system('pip install -q pip install xformers==0.0.26.dev769 -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:
 
319
  "vae:",
320
  "lora:",
321
  "embeddings:",
322
+ "extensions:",
323
+ "control:"
324
  ]
325
 
326
  get_ipython().system('mkdir -p {models_dir} {vaes_dir} {embeddings_dir} {loras_dir} {control_dir}')
327
 
328
  url = ""
329
+ ControlNet_url = ""
330
  hf_token = optional_huggingface_token if optional_huggingface_token else "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"
331
  user_header = f"\"Authorization: Bearer {hf_token}\""
332
  # user_header = f"\"Authorization: Bearer {optional_huggingface_token}\""
 
339
  if file_name:
340
  url = re.sub(r'\[.*?\]', '', url)
341
 
342
+ dir_mapping = {"model": models_dir, "vae": vaes_dir, "lora": loras_dir, "embeddings": embeddings_dir, "extensions": None, "control": control_dir}
343
 
344
  for prefix, dir in dir_mapping.items():
345
  if original_url.startswith(f"{prefix}:"):
 
434
  url += f"{submodel['url']} {submodel['dst_dir']} {submodel['name']}, "
435
 
436
  def process_file_download(file_url):
437
+ global Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url, ControlNet_url
438
  urls_dict = {
439
  'model': 'Model_url',
440
  'vae': 'Vae_url',
441
  'embed': 'Embedding_url',
442
  'lora': 'LoRA_url',
443
+ 'extension': 'Extensions_url',
444
+ 'control': 'ControlNet_url'
445
  }
446
 
447
  if file_url.startswith("http"):
 
470
  if not custom_file_urls.startswith('http'):
471
  if not custom_file_urls.startswith(root_path):
472
  custom_file_urls = f'{root_path}/{custom_file_urls}'
 
 
473
 
474
  try:
475
  process_file_download(custom_file_urls)
476
  except FileNotFoundError:
477
  pass
478
 
479
+ urls = [Model_url, Vae_url, LoRA_url, Embedding_url, Extensions_url, ControlNet_url]
480
 
481
  for i, prefix in enumerate(prefixes):
482
  if urls[i]: