mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-18 19:03:06 +08:00
fixed: remove migration code completely
https://github.com/ltdrdata/ComfyUI-Manager/issues/1659
This commit is contained in:
parent
e5396713ce
commit
39eaa76b8a
@ -314,9 +314,6 @@ The following settings are applied based on the section marked as `is_default`.
|
||||
* Use `aria2` as downloader
|
||||
* [howto](docs/en/use_aria2.md)
|
||||
|
||||
* If you add the item `skip_migration_check = True` to `config.ini`, it will not check whether there are nodes that can be migrated at startup.
|
||||
* This option can be used if performance issues occur in a Colab+GDrive environment.
|
||||
|
||||
|
||||
## Environment Variables
|
||||
|
||||
|
||||
14
cm-cli.py
14
cm-cli.py
@ -1271,20 +1271,6 @@ def export_custom_node_ids(
|
||||
print(f"{x['id']}@unknown", file=output_file)
|
||||
|
||||
|
||||
@app.command(
|
||||
"migrate",
|
||||
help="Migrate legacy node system to new node system",
|
||||
)
|
||||
def migrate(
|
||||
user_directory: str = typer.Option(
|
||||
None,
|
||||
help="user directory"
|
||||
)
|
||||
):
|
||||
cmd_ctx.set_user_directory(user_directory)
|
||||
asyncio.run(unified_manager.migrate_unmanaged_nodes())
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
||||
sys.exit(app())
|
||||
|
||||
@ -43,7 +43,7 @@ import manager_downloader
|
||||
from node_package import InstalledNodePackage
|
||||
|
||||
|
||||
version_code = [3, 31, 1]
|
||||
version_code = [3, 31, 2]
|
||||
version_str = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')
|
||||
|
||||
|
||||
@ -889,14 +889,6 @@ class UnifiedManager:
|
||||
|
||||
return True
|
||||
|
||||
def reserve_migration(self, moves):
|
||||
script_path = os.path.join(manager_startup_script_path, "install-scripts.txt")
|
||||
with open(script_path, "a") as file:
|
||||
obj = ["", "#LAZY-MIGRATION", moves]
|
||||
file.write(f"{obj}\n")
|
||||
|
||||
return True
|
||||
|
||||
def unified_fix(self, node_id, version_spec, instant_execution=False, no_deps=False):
|
||||
"""
|
||||
fix dependencies
|
||||
@ -1630,7 +1622,6 @@ def write_config():
|
||||
'model_download_by_agent': get_config()['model_download_by_agent'],
|
||||
'downgrade_blacklist': get_config()['downgrade_blacklist'],
|
||||
'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'],
|
||||
'db_mode': get_config()['db_mode'],
|
||||
@ -1669,7 +1660,6 @@ def read_config():
|
||||
'windows_selector_event_loop_policy': get_bool('windows_selector_event_loop_policy', False),
|
||||
'model_download_by_agent': get_bool('model_download_by_agent', False),
|
||||
'downgrade_blacklist': default_conf.get('downgrade_blacklist', '').lower(),
|
||||
'skip_migration_check': get_bool('skip_migration_check', False),
|
||||
'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(),
|
||||
@ -1693,7 +1683,6 @@ def read_config():
|
||||
'windows_selector_event_loop_policy': False,
|
||||
'model_download_by_agent': False,
|
||||
'downgrade_blacklist': '',
|
||||
'skip_migration_check': False,
|
||||
'always_lazy_install': False,
|
||||
'network_mode': 'public', # public | private | offline
|
||||
'security_level': 'normal', # strong | normal | normal- | weak
|
||||
@ -3170,8 +3159,6 @@ async def restore_snapshot(snapshot_path, git_helper_extras=None):
|
||||
if x in git_info:
|
||||
del git_info[x]
|
||||
|
||||
# remained nightly will be installed and migrated
|
||||
|
||||
# for unknown restore
|
||||
todo_disable = []
|
||||
todo_enable = []
|
||||
@ -3243,9 +3230,6 @@ async def restore_snapshot(snapshot_path, git_helper_extras=None):
|
||||
unified_manager.repo_install(repo_url, to_path, instant_execution=True, no_deps=False, return_postinstall=False)
|
||||
cloned_repos.append(repo_name)
|
||||
|
||||
# reload
|
||||
await unified_manager.migrate_unmanaged_nodes()
|
||||
|
||||
# print summary
|
||||
for x in cloned_repos:
|
||||
print(f"[ INSTALLED ] {x}")
|
||||
@ -3262,34 +3246,6 @@ async def restore_snapshot(snapshot_path, git_helper_extras=None):
|
||||
# print("[bold red]ERROR: Failed to restore snapshot.[/bold red]")
|
||||
|
||||
|
||||
# check need to migrate
|
||||
need_to_migrate = False
|
||||
|
||||
|
||||
async def check_need_to_migrate():
|
||||
global need_to_migrate
|
||||
|
||||
await unified_manager.reload('cache')
|
||||
await unified_manager.load_nightly(channel='default', mode='cache')
|
||||
|
||||
legacy_custom_nodes = []
|
||||
|
||||
for x in unified_manager.active_nodes.values():
|
||||
if x[0] == 'nightly' and not x[1].endswith('@nightly'):
|
||||
legacy_custom_nodes.append(x[1])
|
||||
|
||||
for x in unified_manager.nightly_inactive_nodes.values():
|
||||
if not x.endswith('@nightly'):
|
||||
legacy_custom_nodes.append(x)
|
||||
|
||||
if len(legacy_custom_nodes) > 0:
|
||||
print("\n--------------------- ComfyUI-Manager migration notice --------------------")
|
||||
print("The following custom nodes were installed using the old management method and require migration:\n")
|
||||
print("\n".join(legacy_custom_nodes))
|
||||
print("---------------------------------------------------------------------------\n")
|
||||
need_to_migrate = True
|
||||
|
||||
|
||||
def get_comfyui_versions(repo=None):
|
||||
if repo is None:
|
||||
repo = git.Repo(comfy_path)
|
||||
|
||||
@ -1748,11 +1748,6 @@ async def default_cache_update():
|
||||
|
||||
logging.info("[ComfyUI-Manager] All startup tasks have been completed.")
|
||||
|
||||
# NOTE: hide migration button temporarily.
|
||||
# if not core.get_config()['skip_migration_check']:
|
||||
# await core.check_need_to_migrate()
|
||||
# else:
|
||||
# logging.info("[ComfyUI-Manager] Migration check is skipped...")
|
||||
|
||||
threading.Thread(target=lambda: asyncio.run(default_cache_update())).start()
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ import {
|
||||
import { OpenArtShareDialog } from "./comfyui-share-openart.js";
|
||||
import {
|
||||
free_models, install_pip, install_via_git_url, manager_instance,
|
||||
rebootAPI, migrateAPI, setManagerInstance, show_message, customAlert, customPrompt,
|
||||
rebootAPI, setManagerInstance, show_message, customAlert, customPrompt,
|
||||
infoToast, showTerminal, setNeedRestart
|
||||
} from "./common.js";
|
||||
import { ComponentBuilderDialog, getPureName, load_components, set_component_policy } from "./components-manager.js";
|
||||
@ -946,28 +946,6 @@ class ManagerMenuDialog extends ComfyDialog {
|
||||
restart_stop_button,
|
||||
];
|
||||
|
||||
let migration_btn =
|
||||
$el("button.cm-button-orange", {
|
||||
type: "button",
|
||||
textContent: "Migrate to New Node System",
|
||||
onclick: () => migrateAPI()
|
||||
});
|
||||
|
||||
migration_btn.style.display = 'none';
|
||||
|
||||
res.push(migration_btn);
|
||||
|
||||
api.fetchApi('/manager/need_to_migrate')
|
||||
.then(response => response.text())
|
||||
.then(text => {
|
||||
if (text === 'True') {
|
||||
migration_btn.style.display = 'block';
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error checking migration status:', error);
|
||||
});
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
17
js/common.js
17
js/common.js
@ -182,23 +182,6 @@ export function rebootAPI() {
|
||||
}
|
||||
|
||||
|
||||
export async function migrateAPI() {
|
||||
let confirmed = await customConfirm("When performing a migration, existing installed custom nodes will be renamed and the server will be restarted. Are you sure you want to apply this?\n\n(If you don't perform the migration, ComfyUI-Manager's start-up time will be longer each time due to re-checking during startup.)")
|
||||
if (confirmed) {
|
||||
try {
|
||||
await api.fetchApi("/manager/migrate_unmanaged_nodes");
|
||||
api.fetchApi("/manager/reboot");
|
||||
}
|
||||
catch(exception) {
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
export var manager_instance = null;
|
||||
|
||||
export function setManagerInstance(obj) {
|
||||
|
||||
@ -689,14 +689,6 @@ def execute_lazy_cnr_switch(target, zip_url, from_path, to_path, no_deps, custom
|
||||
file.write('\n'.join(list(extracted)))
|
||||
|
||||
|
||||
def execute_migration(moves):
|
||||
import shutil
|
||||
for x in moves:
|
||||
if os.path.exists(x[0]) and not os.path.exists(x[1]):
|
||||
shutil.move(x[0], x[1])
|
||||
print(f"[ComfyUI-Manager] MIGRATION: '{x[0]}' -> '{x[1]}'")
|
||||
|
||||
|
||||
script_executed = False
|
||||
|
||||
def execute_startup_script():
|
||||
@ -754,9 +746,6 @@ def execute_startup_script():
|
||||
execute_lazy_cnr_switch(script[0], script[2], script[3], script[4], script[5], script[6])
|
||||
execute_lazy_install_script(script[3], script[7])
|
||||
|
||||
elif script[1] == "#LAZY-MIGRATION":
|
||||
execute_migration(script[2])
|
||||
|
||||
elif script[1] == "#LAZY-DELETE-NODEPACK":
|
||||
execute_lazy_delete(script[2])
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
[project]
|
||||
name = "comfyui-manager"
|
||||
description = "ComfyUI-Manager provides features to install and manage custom nodes for ComfyUI, as well as various functionalities to assist with ComfyUI."
|
||||
version = "3.31.1"
|
||||
version = "3.31.2"
|
||||
license = { file = "LICENSE.txt" }
|
||||
dependencies = ["GitPython", "PyGithub", "matrix-client==0.4.0", "transformers", "huggingface-hub>0.20", "typer", "rich", "typing-extensions", "toml", "uv", "chardet"]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user