mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 02:12:58 +08:00
feat: channels.list
rename subscription -> channel
This commit is contained in:
parent
cb7974e436
commit
2727b6d1ac
@ -45,8 +45,9 @@ This repository provides Colab notebooks that allow you to install and use Comfy
|
|||||||
* Support for automatically installing dependencies of custom nodes upon restarting Colab notebooks.
|
* Support for automatically installing dependencies of custom nodes upon restarting Colab notebooks.
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
* **0.25** support db subscription
|
* **0.25** support db channel
|
||||||
* You can edit subscription db in config.ini
|
* You can directly modify the db channel settings in the `config.ini` file.
|
||||||
|
* If you want to maintain a new DB channel, please modify the `channels.list` and submit a PR.
|
||||||
* **0.23** support multiple selection
|
* **0.23** support multiple selection
|
||||||
* **0.18.1** `skip update check` feature added.
|
* **0.18.1** `skip update check` feature added.
|
||||||
* A feature that allows quickly opening windows in environments where update checks take a long time.
|
* A feature that allows quickly opening windows in environments where update checks take a long time.
|
||||||
|
|||||||
60
__init__.py
60
__init__.py
@ -55,7 +55,7 @@ sys.path.append('../..')
|
|||||||
from torchvision.datasets.utils import download_url
|
from torchvision.datasets.utils import download_url
|
||||||
|
|
||||||
# ensure .js
|
# ensure .js
|
||||||
print("### Loading: ComfyUI-Manager (V0.25.3)")
|
print("### Loading: ComfyUI-Manager (V0.25.4)")
|
||||||
|
|
||||||
comfy_ui_required_revision = 1240
|
comfy_ui_required_revision = 1240
|
||||||
comfy_ui_revision = "Unknown"
|
comfy_ui_revision = "Unknown"
|
||||||
@ -76,6 +76,12 @@ config_path = os.path.join(os.path.dirname(__file__), "config.ini")
|
|||||||
cached_config = None
|
cached_config = None
|
||||||
|
|
||||||
|
|
||||||
|
default_channels = 'default::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main,new::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', ',')
|
||||||
|
|
||||||
|
|
||||||
from comfy.cli_args import args
|
from comfy.cli_args import args
|
||||||
import latent_preview
|
import latent_preview
|
||||||
|
|
||||||
@ -85,8 +91,8 @@ def write_config():
|
|||||||
config['default'] = {
|
config['default'] = {
|
||||||
'preview_method': get_current_preview_method(),
|
'preview_method': get_current_preview_method(),
|
||||||
'badge_mode': get_config()['badge_mode'],
|
'badge_mode': get_config()['badge_mode'],
|
||||||
'subscription_url': get_config()['subscription_url'],
|
'channel_url': get_config()['channel_url'],
|
||||||
'subscription_url_list': get_config()['subscription_url_list']
|
'channel_url_list': get_config()['channel_url_list']
|
||||||
}
|
}
|
||||||
with open(config_path, 'w') as configfile:
|
with open(config_path, 'w') as configfile:
|
||||||
config.write(configfile)
|
config.write(configfile)
|
||||||
@ -98,32 +104,32 @@ def read_config():
|
|||||||
config.read(config_path)
|
config.read(config_path)
|
||||||
default_conf = config['default']
|
default_conf = config['default']
|
||||||
|
|
||||||
subscription_url_list_is_valid = True
|
channel_url_list_is_valid = True
|
||||||
if 'subscription_url_list' in default_conf:
|
if 'channel_url_list' in default_conf:
|
||||||
for item in default_conf['subscription_url_list'].split(","):
|
for item in default_conf['channel_url_list'].split(","):
|
||||||
if len(item.split("::")) != 2:
|
if len(item.split("::")) != 2:
|
||||||
subscription_url_list_is_valid = False
|
channel_url_list_is_valid = False
|
||||||
break
|
break
|
||||||
|
|
||||||
if subscription_url_list_is_valid:
|
if channel_url_list_is_valid:
|
||||||
sub_url_list = default_conf['subscription_url_list']
|
ch_url_list = default_conf['channel_url_list']
|
||||||
else:
|
else:
|
||||||
print(f"[WARN] ComfyUI-Manager: subscription_url_list is invalid format")
|
print(f"[WARN] ComfyUI-Manager: channel_url_list is invalid format")
|
||||||
sub_url_list = 'default::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main,new::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/new,'
|
ch_url_list = ''
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'preview_method': default_conf['preview_method'] if 'preview_method' in default_conf else get_current_preview_method(),
|
'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',
|
'badge_mode': default_conf['badge_mode'] if 'badge_mode' in default_conf else 'none',
|
||||||
'subscription_url': default_conf['subscription_url'] if 'subscription_url' in default_conf else 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main',
|
'channel_url': default_conf['channel_url'] if 'channel_url' in default_conf else 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main',
|
||||||
'subscription_url_list': sub_url_list
|
'channel_url_list': ch_url_list
|
||||||
}
|
}
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
return {
|
return {
|
||||||
'preview_method': get_current_preview_method(),
|
'preview_method': get_current_preview_method(),
|
||||||
'badge_mode': 'none',
|
'badge_mode': 'none',
|
||||||
'subscription_url': 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main',
|
'channel_url': 'https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main',
|
||||||
'subscription_url_list': 'default::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main,new::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/new,'
|
'channel_url_list': ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -450,7 +456,7 @@ async def fetch_customnode_mappings(request):
|
|||||||
if request.rel_url.query["mode"] == "local":
|
if request.rel_url.query["mode"] == "local":
|
||||||
uri = local_db_extension_node_mappings
|
uri = local_db_extension_node_mappings
|
||||||
else:
|
else:
|
||||||
uri = get_config()['subscription_url'] + '/extension-node-map.json'
|
uri = get_config()['channel_url'] + '/extension-node-map.json'
|
||||||
|
|
||||||
json_obj = await get_data(uri)
|
json_obj = await get_data(uri)
|
||||||
|
|
||||||
@ -463,7 +469,7 @@ async def fetch_updates(request):
|
|||||||
if request.rel_url.query["mode"] == "local":
|
if request.rel_url.query["mode"] == "local":
|
||||||
uri = local_db_custom_node_list
|
uri = local_db_custom_node_list
|
||||||
else:
|
else:
|
||||||
uri = get_config()['subscription_url'] + '/custom-node-list.json'
|
uri = get_config()['channel_url'] + '/custom-node-list.json'
|
||||||
|
|
||||||
json_obj = await get_data(uri)
|
json_obj = await get_data(uri)
|
||||||
check_custom_nodes_installed(json_obj, True)
|
check_custom_nodes_installed(json_obj, True)
|
||||||
@ -489,7 +495,7 @@ async def fetch_customnode_list(request):
|
|||||||
if request.rel_url.query["mode"] == "local":
|
if request.rel_url.query["mode"] == "local":
|
||||||
uri = local_db_custom_node_list
|
uri = local_db_custom_node_list
|
||||||
else:
|
else:
|
||||||
uri = get_config()['subscription_url'] + '/custom-node-list.json'
|
uri = get_config()['channel_url'] + '/custom-node-list.json'
|
||||||
|
|
||||||
json_obj = await get_data(uri)
|
json_obj = await get_data(uri)
|
||||||
check_custom_nodes_installed(json_obj, False, not skip_update)
|
check_custom_nodes_installed(json_obj, False, not skip_update)
|
||||||
@ -508,8 +514,8 @@ async def fetch_alternatives_list(request):
|
|||||||
uri1 = local_db_alter
|
uri1 = local_db_alter
|
||||||
uri2 = local_db_custom_node_list
|
uri2 = local_db_custom_node_list
|
||||||
else:
|
else:
|
||||||
uri1 = get_config()['subscription_url'] + '/alter-list.json'
|
uri1 = get_config()['channel_url'] + '/alter-list.json'
|
||||||
uri2 = get_config()['subscription_url'] + '/custom-node-list.json'
|
uri2 = get_config()['channel_url'] + '/custom-node-list.json'
|
||||||
|
|
||||||
alter_json = await get_data(uri1)
|
alter_json = await get_data(uri1)
|
||||||
custom_node_json = await get_data(uri2)
|
custom_node_json = await get_data(uri2)
|
||||||
@ -547,7 +553,7 @@ async def fetch_externalmodel_list(request):
|
|||||||
if request.rel_url.query["mode"] == "local":
|
if request.rel_url.query["mode"] == "local":
|
||||||
uri = local_db_model
|
uri = local_db_model
|
||||||
else:
|
else:
|
||||||
uri = get_config()['subscription_url'] + '/model-list.json'
|
uri = get_config()['channel_url'] + '/model-list.json'
|
||||||
|
|
||||||
json_obj = await get_data(uri)
|
json_obj = await get_data(uri)
|
||||||
check_model_installed(json_obj)
|
check_model_installed(json_obj)
|
||||||
@ -1046,17 +1052,19 @@ async def badge_mode(request):
|
|||||||
return web.Response(status=200)
|
return web.Response(status=200)
|
||||||
|
|
||||||
|
|
||||||
@server.PromptServer.instance.routes.get("/manager/subscription_url_list")
|
@server.PromptServer.instance.routes.get("/manager/channel_url_list")
|
||||||
async def subscription_url_list(request):
|
async def channel_url_list(request):
|
||||||
|
channels = default_channels+","+get_config()['channel_url_list']
|
||||||
|
|
||||||
if "value" in request.rel_url.query:
|
if "value" in request.rel_url.query:
|
||||||
for item in get_config()['subscription_url_list'].split(','):
|
for item in channels.split(','):
|
||||||
name_url = item.split("::")
|
name_url = item.split("::")
|
||||||
if len(name_url) == 2 and name_url[0] == request.rel_url.query['value']:
|
if len(name_url) == 2 and name_url[0] == request.rel_url.query['value']:
|
||||||
get_config()['subscription_url'] = name_url[1]
|
get_config()['channel_url'] = name_url[1]
|
||||||
write_config()
|
write_config()
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
return web.Response(text=get_config()['subscription_url_list'], status=200)
|
return web.Response(text=channels, status=200)
|
||||||
|
|
||||||
return web.Response(status=200)
|
return web.Response(status=200)
|
||||||
|
|
||||||
|
|||||||
2
channels.list
Normal file
2
channels.list
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
default::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main
|
||||||
|
new::https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/node_db/new
|
||||||
@ -1784,9 +1784,9 @@ class ManagerMenuDialog extends ComfyDialog {
|
|||||||
app.graph.setDirtyCanvas(true);
|
app.graph.setDirtyCanvas(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
// subscription
|
// channel
|
||||||
let subscription_combo = document.createElement("select");
|
let channel_combo = document.createElement("select");
|
||||||
api.fetchApi('/manager/subscription_url_list')
|
api.fetchApi('/manager/channel_url_list')
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
try {
|
try {
|
||||||
@ -1794,12 +1794,12 @@ class ManagerMenuDialog extends ComfyDialog {
|
|||||||
for(let i in urls) {
|
for(let i in urls) {
|
||||||
if(urls[i] != '') {
|
if(urls[i] != '') {
|
||||||
let name_url = urls[i].split('::');
|
let name_url = urls[i].split('::');
|
||||||
subscription_combo.appendChild($el('option', {value:name_url[0], text:`subscribe: ${name_url[0]}`}, []));
|
channel_combo.appendChild($el('option', {value:name_url[0], text:`Channel: ${name_url[0]}`}, []));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subscription_combo.addEventListener('change', function(event) {
|
channel_combo.addEventListener('change', function(event) {
|
||||||
api.fetchApi(`/manager/subscription_url_list?value=${event.target.value}`);
|
api.fetchApi(`/manager/channel_url_list?value=${event.target.value}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(exception) {
|
catch(exception) {
|
||||||
@ -1873,7 +1873,7 @@ class ManagerMenuDialog extends ComfyDialog {
|
|||||||
$el("hr", {width: "100%"}, []),
|
$el("hr", {width: "100%"}, []),
|
||||||
preview_combo,
|
preview_combo,
|
||||||
badge_combo,
|
badge_combo,
|
||||||
subscription_combo,
|
channel_combo,
|
||||||
$el("hr", {width: "100%"}, []),
|
$el("hr", {width: "100%"}, []),
|
||||||
$el("br", {}, []),
|
$el("br", {}, []),
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user