provide addtional channels to the manager-core

This commit is contained in:
Dr.Lt.Data 2024-10-27 23:46:38 +09:00
parent 7bc1a944af
commit a735f60790
2 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,3 @@
default::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main
recent::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/new
legacy::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/legacy
forked::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/forked
dev::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/dev

View File

@ -4,6 +4,7 @@ import configparser
import manager_core as core
import cm_global
from manager_util import *
import shutil
import folder_paths
from comfy.cli_args import args
@ -18,6 +19,26 @@ DEFAULT_CHANNEL = "https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/ma
manager_ext_config_path = os.path.abspath(os.path.join(folder_paths.get_user_directory(), 'default', 'manager-ext.ini'))
cached_config = None
manager_ext_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
channel_list_path = os.path.join(manager_ext_path, 'channels.list')
def update_channel_dict():
if not os.path.exists(channel_list_path):
shutil.copy(channel_list_path+'.template', channel_list_path)
core.get_channel_dict() # for the loading
with open(os.path.join(manager_ext_path, 'channels.list'), 'r') as file:
channels = file.read()
for x in channels.split('\n'):
channel_info = x.split("::")
if len(channel_info) == 2:
core.channel_dict[channel_info[0]] = channel_info[1]
update_channel_dict()
def get_current_preview_method():
if args.preview_method == latent_preview.LatentPreviewMethod.Auto: