diff --git a/__init__.py b/__init__.py
index 6a63dbe5..f966524b 100644
--- a/__init__.py
+++ b/__init__.py
@@ -7,7 +7,10 @@ if not os.path.exists(cli_mode_flag):
sys.path.append(os.path.join(os.path.dirname(__file__), "glob"))
import manager_server # noqa: F401
import share_3rdparty # noqa: F401
- WEB_DIRECTORY = "js"
+ import cm_global
+
+ if not cm_global.disable_front and not 'DISABLE_COMFYUI_MANAGER_FRONT' in os.environ:
+ WEB_DIRECTORY = "js"
else:
print("\n[ComfyUI-Manager] !! cli-only-mode is enabled !!\n")
diff --git a/glob/cm_global.py b/glob/cm_global.py
index 118d475b..e5d2237c 100644
--- a/glob/cm_global.py
+++ b/glob/cm_global.py
@@ -112,4 +112,6 @@ def add_on_revision_detected(k, f):
variables['cm.on_revision_detected_handler'].append((k, f))
-error_dict = {}
\ No newline at end of file
+error_dict = {}
+
+disable_front = False
\ No newline at end of file
diff --git a/glob/manager_core.py b/glob/manager_core.py
index 8d1fb308..3c0ca5b1 100644
--- a/glob/manager_core.py
+++ b/glob/manager_core.py
@@ -42,7 +42,7 @@ import manager_downloader
from node_package import InstalledNodePackage
-version_code = [3, 27, 2]
+version_code = [3, 27, 3]
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
@@ -1614,7 +1614,8 @@ def write_config():
'security_level': get_config()['security_level'],
'skip_migration_check': get_config()['skip_migration_check'],
'always_lazy_install': get_config()['always_lazy_install'],
- 'network_mode': get_config()['network_mode']
+ 'network_mode': get_config()['network_mode'],
+ 'db_mode': get_config()['db_mode'],
}
directory = os.path.dirname(manager_config_path)
@@ -1654,6 +1655,7 @@ def read_config():
'always_lazy_install': get_bool('always_lazy_install', False),
'network_mode': default_conf.get('network_mode', 'public').lower(),
'security_level': default_conf.get('security_level', 'normal').lower(),
+ 'db_mode': default_conf.get('db_mode', 'cache').lower(),
}
except Exception:
@@ -1677,6 +1679,7 @@ def read_config():
'always_lazy_install': False,
'network_mode': 'public', # public | private | offline
'security_level': 'normal', # strong | normal | normal- | weak
+ 'db_mode': 'cache', # local | cache | remote
}
diff --git a/glob/manager_server.py b/glob/manager_server.py
index 35a8ec75..84a11d7b 100644
--- a/glob/manager_server.py
+++ b/glob/manager_server.py
@@ -190,6 +190,9 @@ def set_component_policy(mode):
def set_update_policy(mode):
core.get_config()['update_policy'] = mode
+def set_db_mode(mode):
+ core.get_config()['db_mode'] = mode
+
def print_comfyui_version():
global comfy_ui_hash
global comfyui_tag
@@ -816,7 +819,7 @@ async def fetch_customnode_list(request):
"""
provide unified custom node list
"""
- if "skip_update" in request.rel_url.query and request.rel_url.query["skip_update"] == "true":
+ if request.rel_url.query.get("skip_update", '').lower() == "true":
skip_update = True
else:
skip_update = False
@@ -833,7 +836,7 @@ async def fetch_customnode_list(request):
core.populate_github_stats(node_packs, await json_obj_github)
core.populate_favorites(node_packs, await json_obj_extras)
- check_state_of_git_node_pack(node_packs, False, do_update_check=not skip_update)
+ check_state_of_git_node_pack(node_packs, not skip_update, do_update_check=not skip_update)
for v in node_packs.values():
populate_markdown(v)
@@ -1455,6 +1458,18 @@ async def preview_method(request):
return web.Response(status=200)
+@routes.get("/manager/db_mode")
+async def db_mode(request):
+ if "value" in request.rel_url.query:
+ set_db_mode(request.rel_url.query['value'])
+ core.write_config()
+ else:
+ return web.Response(text=core.get_config()['db_mode'], status=200)
+
+ return web.Response(status=200)
+
+
+
@routes.get("/manager/policy/component")
async def component_policy(request):
if "value" in request.rel_url.query:
@@ -1681,20 +1696,23 @@ cm_global.register_api('cm.try-install-custom-node', confirm_try_install)
async def default_cache_update():
channel_url = core.get_config()['channel_url']
async def get_cache(filename):
- if core.get_config()['default_cache_as_channel_url']:
- uri = f"{channel_url}/{filename}"
- else:
- uri = f"{core.DEFAULT_CHANNEL}/{filename}"
+ try:
+ if core.get_config()['default_cache_as_channel_url']:
+ uri = f"{channel_url}/{filename}"
+ else:
+ uri = f"{core.DEFAULT_CHANNEL}/{filename}"
- cache_uri = str(manager_util.simple_hash(uri)) + '_' + filename
- cache_uri = os.path.join(manager_util.cache_dir, cache_uri)
+ cache_uri = str(manager_util.simple_hash(uri)) + '_' + filename
+ cache_uri = os.path.join(manager_util.cache_dir, cache_uri)
- json_obj = await manager_util.get_data(uri, True)
+ json_obj = await manager_util.get_data(uri, True)
- with manager_util.cache_lock:
- with open(cache_uri, "w", encoding='utf-8') as file:
- json.dump(json_obj, file, indent=4, sort_keys=True)
- logging.info(f"[ComfyUI-Manager] default cache updated: {uri}")
+ with manager_util.cache_lock:
+ with open(cache_uri, "w", encoding='utf-8') as file:
+ json.dump(json_obj, file, indent=4, sort_keys=True)
+ logging.info(f"[ComfyUI-Manager] default cache updated: {uri}")
+ except:
+ logging.error(f"[ComfyUI-Manager] Failed to initial fetching: {filename}")
if core.get_config()['network_mode'] != 'offline':
a = get_cache("custom-node-list.json")
diff --git a/js/comfyui-manager.js b/js/comfyui-manager.js
index 79a99b81..7549a608 100644
--- a/js/comfyui-manager.js
+++ b/js/comfyui-manager.js
@@ -227,7 +227,6 @@ document.head.appendChild(docStyle);
var update_comfyui_button = null;
var switch_comfyui_button = null;
-var fetch_updates_button = null;
var update_all_button = null;
var restart_stop_button = null;
var update_policy_combo = null;
@@ -653,57 +652,6 @@ async function switchComfyUI() {
}
}
-
-async function fetchUpdates(update_check_checkbox) {
- let prev_text = fetch_updates_button.innerText;
- fetch_updates_button.innerText = "Fetching updates...";
- fetch_updates_button.disabled = true;
- fetch_updates_button.style.backgroundColor = "gray";
-
- try {
- var mode = manager_instance.datasrc_combo.value;
-
- const response = await api.fetchApi(`/customnode/fetch_updates?mode=${mode}`);
-
- if (response.status != 200 && response.status != 201) {
- show_message('Failed to fetch updates.');
- return false;
- }
-
- if (response.status == 201) {
- show_message("There is an updated extension available.
NOTE:
Fetch Updates is not an update.
Please update from