From ab3d3528a18ea1a81f1af22ea71bfc0d8c710dde Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 14 Sep 2023 18:42:56 +0800 Subject: [PATCH] add --skip-load-model-at-start --- modules/cmd_args.py | 1 + modules/initialize.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/cmd_args.py b/modules/cmd_args.py index 5be879dd6f3..4e602a84270 100644 --- a/modules/cmd_args.py +++ b/modules/cmd_args.py @@ -117,3 +117,4 @@ parser.add_argument('--timeout-keep-alive', type=int, default=30, help='set timeout_keep_alive for uvicorn') parser.add_argument("--disable-all-extensions", action='store_true', help="prevent all extensions from running regardless of any other settings", default=False) parser.add_argument("--disable-extra-extensions", action='store_true', help="prevent all extensions except built-in from running regardless of any other settings", default=False) +parser.add_argument("--skip-load-model-at-start", action='store_true', help="if load a model at web start, only take effect when --nowebui", ) diff --git a/modules/initialize.py b/modules/initialize.py index f24f76375db..ac95fc6f00c 100644 --- a/modules/initialize.py +++ b/modules/initialize.py @@ -151,8 +151,8 @@ def load_model(): from modules import devices devices.first_time_calculation() - - Thread(target=load_model).start() + if not shared.cmd_opts.skip_load_model_at_start: + Thread(target=load_model).start() from modules import shared_items shared_items.reload_hypernetworks()