mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-09 06:04:31 +08:00
improve: use channel.list instead of config.ini's channel_url.list
add: tutorial channel
This commit is contained in:
parent
98ab2b334c
commit
61fd22415f
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,4 +7,5 @@ config.ini
|
||||
snapshots/**
|
||||
startup-scripts/**
|
||||
.openart_key
|
||||
matrix_auth
|
||||
matrix_auth
|
||||
channels.list
|
||||
|
||||
104
__init__.py
104
__init__.py
@ -20,7 +20,7 @@ import nodes
|
||||
import torch
|
||||
|
||||
|
||||
version = [1, 14]
|
||||
version = [1, 15]
|
||||
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
||||
print(f"### Loading: ComfyUI-Manager ({version_str})")
|
||||
|
||||
@ -115,17 +115,44 @@ startup_script_path = os.path.join(comfyui_manager_path, "startup-scripts")
|
||||
config_path = os.path.join(os.path.dirname(__file__), "config.ini")
|
||||
cached_config = None
|
||||
|
||||
|
||||
default_channels = 'default::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main,recent::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/new,'
|
||||
with open(os.path.join(comfyui_manager_path, 'channels.list'), 'r') as file:
|
||||
channels = file.read()
|
||||
default_channels = channels.replace('\n', ',')
|
||||
|
||||
channel_list_path = os.path.join(comfyui_manager_path, 'channels.list')
|
||||
channel_dict = None
|
||||
channel_list = None
|
||||
|
||||
from comfy.cli_args import args
|
||||
import latent_preview
|
||||
|
||||
|
||||
def get_channel_dict():
|
||||
global channel_dict
|
||||
|
||||
if channel_dict is None:
|
||||
channel_dict = {}
|
||||
|
||||
if not os.path.exists(channel_list_path):
|
||||
shutil.copy(channel_list_path+'.template', channel_list_path)
|
||||
|
||||
with open(os.path.join(comfyui_manager_path, 'channels.list'), 'r') as file:
|
||||
channels = file.read()
|
||||
for x in channels.split('\n'):
|
||||
channel_info = x.split("::")
|
||||
if len(channel_info) == 2:
|
||||
channel_dict[channel_info[0]] = channel_info[1]
|
||||
|
||||
return channel_dict
|
||||
|
||||
|
||||
def get_channel_list():
|
||||
global channel_list
|
||||
|
||||
if channel_list is None:
|
||||
channel_list = []
|
||||
for k, v in get_channel_dict().items():
|
||||
channel_list.append(f"{k}::{v}")
|
||||
|
||||
return channel_list
|
||||
|
||||
|
||||
def write_config():
|
||||
config = configparser.ConfigParser()
|
||||
config['default'] = {
|
||||
@ -133,7 +160,6 @@ def write_config():
|
||||
'badge_mode': get_config()['badge_mode'],
|
||||
'git_exe': get_config()['git_exe'],
|
||||
'channel_url': get_config()['channel_url'],
|
||||
'channel_url_list': get_config()['channel_url_list'],
|
||||
'share_option': get_config()['share_option'],
|
||||
'bypass_ssl': get_config()['bypass_ssl']
|
||||
}
|
||||
@ -147,25 +173,11 @@ def read_config():
|
||||
config.read(config_path)
|
||||
default_conf = config['default']
|
||||
|
||||
channel_url_list_is_valid = True
|
||||
if 'channel_url_list' in default_conf and default_conf['channel_url_list'] != '':
|
||||
for item in default_conf['channel_url_list'].split(","):
|
||||
if len(item.split("::")) != 2:
|
||||
channel_url_list_is_valid = False
|
||||
break
|
||||
|
||||
if channel_url_list_is_valid:
|
||||
ch_url_list = default_conf['channel_url_list']
|
||||
else:
|
||||
print(f"[WARN] ComfyUI-Manager: channel_url_list is invalid format")
|
||||
ch_url_list = ''
|
||||
|
||||
return {
|
||||
'preview_method': default_conf['preview_method'] if 'preview_method' in default_conf else get_current_preview_method(),
|
||||
'badge_mode': default_conf['badge_mode'] if 'badge_mode' in default_conf else 'none',
|
||||
'git_exe': default_conf['git_exe'] if 'git_exe' in default_conf else '',
|
||||
'channel_url': default_conf['channel_url'] if 'channel_url' in default_conf else 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main',
|
||||
'channel_url_list': ch_url_list,
|
||||
'share_option': default_conf['share_option'] if 'share_option' in default_conf else 'all',
|
||||
'bypass_ssl': default_conf['bypass_ssl'] if 'bypass_ssl' in default_conf else False,
|
||||
}
|
||||
@ -176,7 +188,6 @@ def read_config():
|
||||
'badge_mode': 'none',
|
||||
'git_exe': '',
|
||||
'channel_url': 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main',
|
||||
'channel_url_list': '',
|
||||
'share_option': 'all',
|
||||
'bypass_ssl': False
|
||||
}
|
||||
@ -827,14 +838,12 @@ async def fetch_customnode_list(request):
|
||||
populate_markdown(x)
|
||||
|
||||
if channel != 'local':
|
||||
channels = default_channels+","+get_config()['channel_url_list']
|
||||
channels = channels.split(',')
|
||||
|
||||
found = 'custom'
|
||||
for item in channels:
|
||||
item_info = item.split('::')
|
||||
if len(item_info) == 2 and item_info[1] == channel:
|
||||
found = item_info[0]
|
||||
|
||||
for name, url in get_channel_dict().items():
|
||||
if url == channel:
|
||||
found = name
|
||||
break
|
||||
|
||||
channel = found
|
||||
|
||||
@ -1617,26 +1626,23 @@ async def badge_mode(request):
|
||||
|
||||
@server.PromptServer.instance.routes.get("/manager/channel_url_list")
|
||||
async def channel_url_list(request):
|
||||
channels = default_channels+","+get_config()['channel_url_list']
|
||||
channels = channels.split(',')
|
||||
|
||||
channels = get_channel_dict()
|
||||
if "value" in request.rel_url.query:
|
||||
for item in channels:
|
||||
name_url = item.split("::")
|
||||
if len(name_url) == 2 and name_url[0] == request.rel_url.query['value']:
|
||||
get_config()['channel_url'] = name_url[1]
|
||||
write_config()
|
||||
break
|
||||
channel_url = channels.get(request.rel_url.query['value'])
|
||||
if channel_url is not None:
|
||||
get_config()['channel_url'] = channel_url
|
||||
write_config()
|
||||
else:
|
||||
selected = 'custom'
|
||||
selected_url = get_config()['channel_url']
|
||||
for item in channels:
|
||||
item_info = item.split('::')
|
||||
if len(item_info) == 2 and item_info[1] == selected_url:
|
||||
selected = item_info[0]
|
||||
|
||||
for name, url in channels.items():
|
||||
if url == selected_url:
|
||||
selected = name
|
||||
break
|
||||
|
||||
res = {'selected': selected,
|
||||
'list': channels}
|
||||
'list': get_channel_list()}
|
||||
return web.json_response(res, status=200)
|
||||
|
||||
return web.Response(status=200)
|
||||
@ -1950,14 +1956,14 @@ async def share_art(request):
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return web.json_response({"error" : "An error occurred when sharing your art to Matrix."}, content_type='application/json', status=500)
|
||||
return web.json_response({"error": "An error occurred when sharing your art to Matrix."}, content_type='application/json', status=500)
|
||||
|
||||
return web.json_response({
|
||||
"comfyworkflows" : {
|
||||
"url" : None if "comfyworkflows" not in share_destinations else f"{share_website_host}/workflows/{workflowId}",
|
||||
"comfyworkflows": {
|
||||
"url": None if "comfyworkflows" not in share_destinations else f"{share_website_host}/workflows/{workflowId}",
|
||||
},
|
||||
"matrix" : {
|
||||
"success" : None if "matrix" not in share_destinations else True
|
||||
"matrix": {
|
||||
"success": None if "matrix" not in share_destinations else True
|
||||
}
|
||||
}, content_type='application/json', status=200)
|
||||
|
||||
|
||||
@ -2,4 +2,5 @@ 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
|
||||
dev::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/dev
|
||||
tutorial::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/tutorial
|
||||
@ -3524,9 +3524,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{
|
||||
"author": "Ser-Hilary",
|
||||
"title": "SDXL_sizing",
|
||||
|
||||
@ -753,9 +753,9 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
$el("div", {}, [this.update_check_checkbox, uc_checkbox_text]),
|
||||
$el("br", {}, []),
|
||||
this.datasrc_combo,
|
||||
channel_combo,
|
||||
preview_combo,
|
||||
badge_combo,
|
||||
channel_combo,
|
||||
share_combo,
|
||||
$el("br", {}, []),
|
||||
$el("button.cm-button", {
|
||||
|
||||
@ -13,12 +13,12 @@
|
||||
{
|
||||
"author": "CosmicLaca",
|
||||
"title": "Primere nodes for ComfyUI",
|
||||
"reference": "https://github.com/CosmicLaca/PrimereComfyNodes",
|
||||
"reference": "https://github.com/CosmicLaca/ComfyUI_Primere_Nodes",
|
||||
"files": [
|
||||
"https://github.com/CosmicLaca/PrimereComfyNodes"
|
||||
"https://github.com/CosmicLaca/ComfyUI_Primere_Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "This extension provides various utility nodes. [w/WARN: DON'T INSTALL THIS EXTENSION YET. Installing this extension will break your ComfyUI totally. If you have installed this extension, even by mistake, please uninstall the comfy package using pip.] "
|
||||
"description": "This extension provides various utility nodes. Inputs(prompt, styles, dynamic, merger, ...), Outputs(style pile), Dashboard(selectors, loader, switch, ...), Networks(LORA, Embedding, Hypernetwork), Visuals(visual selectors, )"
|
||||
},
|
||||
{
|
||||
"author": "foglerek",
|
||||
|
||||
34
node_db/tutorial/custom-node-list.json
Normal file
34
node_db/tutorial/custom-node-list.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"custom_nodes": [
|
||||
{
|
||||
"author": "Suzie1",
|
||||
"title": "Guide To Making Custom Nodes in ComfyUI",
|
||||
"reference": "https://github.com/Suzie1/ComfyUI_Guide_To_Making_Custom_Nodes",
|
||||
"files": [
|
||||
"https://github.com/Suzie1/ComfyUI_Guide_To_Making_Custom_Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "There is a small node pack attached to this guide. This includes the init file and 3 nodes associated with the tutorials."
|
||||
},
|
||||
{
|
||||
"author": "dynamixar",
|
||||
"title": "Atluris",
|
||||
"reference": "https://github.com/dynamixar/Atluris",
|
||||
"files": [
|
||||
"https://github.com/dynamixar/Atluris"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Nodes:Random Line"
|
||||
},
|
||||
{
|
||||
"author": "et118",
|
||||
"title": "ComfyUI-ElGogh-Nodes",
|
||||
"reference": "https://github.com/et118/ComfyUI-ElGogh-Nodes",
|
||||
"files": [
|
||||
"https://github.com/et118/ComfyUI-ElGogh-Nodes"
|
||||
],
|
||||
"install_type": "git-clone",
|
||||
"description": "Nodes:ElGogh Positive Prompt, ElGogh NEGATIVE Prompt, ElGogh Empty Latent Image, ElGogh Checkpoint Loader Simple"
|
||||
}
|
||||
]
|
||||
}
|
||||
1
node_db/tutorial/extension-node-map.json
Normal file
1
node_db/tutorial/extension-node-map.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
1
node_db/tutorial/model-list.json
Normal file
1
node_db/tutorial/model-list.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
4
node_db/tutorial/scan.sh
Executable file
4
node_db/tutorial/scan.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
source ../../../../venv/bin/activate
|
||||
rm .tmp/*.py > /dev/null
|
||||
python ../../scanner.py
|
||||
Loading…
x
Reference in New Issue
Block a user