updated: README.md

removed: useless scripts
fixed: robust installation of toml module
This commit is contained in:
Dr.Lt.Data
2025-01-03 18:55:05 +09:00
parent ae3a525008
commit 16db68aa8e
7 changed files with 33 additions and 31 deletions

View File

@@ -36,7 +36,7 @@ import manager_downloader
from node_package import InstalledNodePackage
version_code = [3, 3, 2]
version_code = [3, 3, 3]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
@@ -150,6 +150,7 @@ manager_channel_list_path = None
manager_startup_script_path = None
manager_snapshot_path = None
manager_pip_overrides_path = None
manager_components_path = None
def update_user_directory(user_dir):
global manager_files_path
@@ -158,6 +159,7 @@ def update_user_directory(user_dir):
global manager_startup_script_path
global manager_snapshot_path
global manager_pip_overrides_path
global manager_components_path
manager_files_path = os.path.abspath(os.path.join(user_dir, 'default', 'ComfyUI-Manager'))
if not os.path.exists(manager_files_path):
@@ -174,6 +176,7 @@ def update_user_directory(user_dir):
manager_config_path = os.path.join(manager_files_path, 'config.ini')
manager_channel_list_path = os.path.join(manager_files_path, 'channels.list')
manager_pip_overrides_path = os.path.join(manager_files_path, "pip_overrides.json")
manager_components_path = os.path.join(manager_files_path, "components")
try:
import folder_paths

View File

@@ -135,7 +135,6 @@ local_db_model = os.path.join(manager_util.comfyui_manager_path, "model-list.jso
local_db_alter = os.path.join(manager_util.comfyui_manager_path, "alter-list.json")
local_db_custom_node_list = os.path.join(manager_util.comfyui_manager_path, "custom-node-list.json")
local_db_extension_node_mappings = os.path.join(manager_util.comfyui_manager_path, "extension-node-map.json")
components_path = os.path.join(manager_util.comfyui_manager_path, 'components')
def set_preview_method(method):
@@ -1314,15 +1313,15 @@ async def save_component(request):
name = data['name']
workflow = data['workflow']
if not os.path.exists(components_path):
os.mkdir(components_path)
if not os.path.exists(core.manager_components_path):
os.mkdir(core.manager_components_path)
if 'packname' in workflow and workflow['packname'] != '':
sanitized_name = manager_util.sanitize_filename(workflow['packname']) + '.pack'
else:
sanitized_name = manager_util.sanitize_filename(name) + '.json'
filepath = os.path.join(components_path, sanitized_name)
filepath = os.path.join(core.manager_components_path, sanitized_name)
components = {}
if os.path.exists(filepath):
with open(filepath) as f:
@@ -1340,12 +1339,12 @@ async def save_component(request):
@routes.post("/manager/component/loads")
async def load_components(request):
try:
json_files = [f for f in os.listdir(components_path) if f.endswith('.json')]
pack_files = [f for f in os.listdir(components_path) if f.endswith('.pack')]
json_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.json')]
pack_files = [f for f in os.listdir(core.manager_components_path) if f.endswith('.pack')]
components = {}
for json_file in json_files + pack_files:
file_path = os.path.join(components_path, json_file)
file_path = os.path.join(core.manager_components_path, json_file)
with open(file_path, 'r') as file:
try:
# When there is a conflict between the .pack and the .json, the pack takes precedence and overrides.