iRedHat commited on
Commit
cd0ebcc
·
verified ·
1 Parent(s): eb195ee

Delete all_nodes.py

Browse files
Files changed (1) hide show
  1. all_nodes.py +0 -94
all_nodes.py DELETED
@@ -1,94 +0,0 @@
1
- import os
2
- import subprocess
3
-
4
- # Путь к папке ComfyUI (относительный путь)
5
- comfyui_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "ComfyUI"))
6
-
7
- # Путь к папке python_embeded (относительный путь)
8
- python_embeded_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "python_embeded"))
9
-
10
- # Путь к папке с git (относительный путь)
11
- git_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "git", "bin"))
12
-
13
- # Словарь с вариантами установки и их репозиториями
14
- install_options = {
15
- "Базовые узлы": [
16
- "https://github.com/ltdrdata/ComfyUI-Manager",
17
- "https://github.com/crystian/ComfyUI-Crystools"
18
- ],
19
- "Расширенные узлы": [
20
- "https://github.com/11cafe/comfyui-workspace-manager",
21
- "https://github.com/hayden-fr/ComfyUI-Model-Manager",
22
- "https://github.com/talesofai/comfyui-browser"
23
- ],
24
- "Все узлы": [
25
- "https://github.com/comfyui/ComfyUI-Nodes",
26
- "https://github.com/AUTOMATIC1111/stable-diffusion-webui",
27
- "https://github.com/your_username/your_custom_node_repo",
28
- "https://github.com/another_username/another_custom_node_repo",
29
- # Добавьте сюда ссылки на другие репозитории
30
- ],
31
- }
32
-
33
- # Проверка наличия папки с custom_nodes
34
- custom_nodes_path = os.path.join(comfyui_path, "custom_nodes")
35
- if not os.path.exists(custom_nodes_path):
36
- os.makedirs(custom_nodes_path)
37
-
38
- # Меню выбора варианта установки
39
- while True:
40
- print("Выберите вариант установки:")
41
- for i, option in enumerate(install_options.keys()):
42
- print(f"{i+1}. {option}")
43
- choice = input("Введите номер варианта: ")
44
-
45
- # Проверка ввода
46
- try:
47
- choice = int(choice)
48
- if 1 <= choice <= len(install_options):
49
- break
50
- else:
51
- print("Неверный номер варианта. Пожалуйста, введите число от 1 до", len(install_options))
52
- except ValueError:
53
- print("Неверный ввод. Пожалуйста, введите число.")
54
-
55
- # Получение списка репозиториев для выбранного варианта
56
- selected_repos = []
57
- if choice == 2: # Выбран вариант 2
58
- selected_repos.extend(install_options["Базовые узлы"])
59
- selected_repos.extend(install_options["Расширенные узлы"])
60
- elif choice == 3: # Выбран вариант 3
61
- selected_repos.extend(install_options["Базовые узлы"])
62
- selected_repos.extend(install_options["Расширенные узлы"])
63
- selected_repos.extend(install_options["Все узлы"])
64
- else:
65
- selected_repos.extend(install_options[list(install_options.keys())[choice - 1]])
66
-
67
- # Скачивание custom_nodes
68
- for repo_url in selected_repos:
69
- repo_name = repo_url.split("/")[-1].split(".")[0]
70
- repo_path = os.path.join(custom_nodes_path, repo_name)
71
-
72
- # Проверка, была ли уже скачана репозитория
73
- if os.path.exists(repo_path):
74
- print(f"Репозитория {repo_name} уже скачана.")
75
- continue
76
-
77
- # Скачивание репозитории
78
- print(f"Скачивание {repo_name}...")
79
- try:
80
- subprocess.run([os.path.join(git_path, "git"), "clone", repo_url, repo_path], check=True)
81
- except subprocess.CalledProcessError as e:
82
- print(f"Ошибка при скачивании {repo_name}: {e}")
83
- continue
84
-
85
- # Проверка наличия requirements.txt
86
- requirements_path = os.path.join(repo_path, "requirements.txt")
87
- if os.path.exists(requirements_path):
88
- print(f"Установка зависимостей для {repo_name}...")
89
- try:
90
- subprocess.run([os.path.join(python_embeded_path, "python"), "-m", "pip", "install", "-r", requirements_path], check=True)
91
- except subprocess.CalledProcessError as e:
92
- print(f"Ошибка при установке зависимостей: {e}")
93
-
94
- print("Скачивание custom_nodes завершено.")a