From d69aa16b69fd806e81f75298af79726b610bbcac Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Tue, 27 Jun 2023 08:00:23 -0400 Subject: [PATCH] upgrade only on demand --- TODO.md | 1 + installer.py | 9 +++------ modules/lycoris | 2 +- webui.py | 21 ++++++++++----------- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/TODO.md b/TODO.md index 565944a50..fa4d6e5f9 100644 --- a/TODO.md +++ b/TODO.md @@ -40,6 +40,7 @@ Tech that can be integrated as part of the core workflow... - [QuickEmbedding](https://github.com/ethansmith2000/QuickEmbedding) - [DataComp CLiP](https://github.com/mlfoundations/open_clip/blob/main/docs/datacomp_models.md) - [ClipSeg](https://github.com/timojl/clipseg) +- [DragGAN](https://github.com/XingangPan/DragGAN) - `TensorRT` ## Random diff --git a/installer.py b/installer.py index 0c42606cd..03248773d 100644 --- a/installer.py +++ b/installer.py @@ -9,7 +9,6 @@ import subprocess import io import pstats import cProfile -import argparse import pkg_resources @@ -28,7 +27,6 @@ args = Dot({ 'debug': False, 'reset': False, 'upgrade': False, - 'skip_update': False, 'skip_extensions': False, 'skip_requirements': False, 'skip_git': False, @@ -503,7 +501,7 @@ def install_extensions(): extensions_duplicates.append(ext) continue extensions_enabled.append(ext) - if not args.skip_update: + if args.upgrade: try: update(os.path.join(folder, ext)) except Exception: @@ -542,7 +540,7 @@ def install_submodules(): txt = git('submodule') log.info('Continuing setup') git('submodule --quiet update --init --recursive') - if not args.skip_update: + if args.upgrade: log.info('Updating submodules') submodules = txt.splitlines() for submodule in submodules: @@ -673,7 +671,7 @@ def check_version(offline=False, reset=True): # pylint: disable=unused-argument def update_wiki(): - if not args.skip_update: + if args.upgrade: log.info('Updating Wiki') try: update(os.path.join(os.path.dirname(__file__), "wiki")) @@ -729,7 +727,6 @@ def add_args(parser): group.add_argument('--use-directml', default = False, action='store_true', help = "Use DirectML if no compatible GPU is detected, default: %(default)s") group.add_argument("--use-cuda", default=False, action='store_true', help="Force use nVidia CUDA backend, default: %(default)s") group.add_argument("--use-rocm", default=False, action='store_true', help="Force use AMD ROCm backend, default: %(default)s") - group.add_argument('--skip-update', default = False, action='store_true', help = "Skip update of extensions and submodules, default: %(default)s") group.add_argument('--skip-requirements', default = False, action='store_true', help = "Skips checking and installing requirements, default: %(default)s") group.add_argument('--skip-extensions', default = False, action='store_true', help = "Skips running individual extension installers, default: %(default)s") group.add_argument('--skip-git', default = False, action='store_true', help = "Skips running all GIT operations, default: %(default)s") diff --git a/modules/lycoris b/modules/lycoris index 57d71913b..0b7f34c16 160000 --- a/modules/lycoris +++ b/modules/lycoris @@ -1 +1 @@ -Subproject commit 57d71913bf47a48dc7dd519b89dd30e09c937b83 +Subproject commit 0b7f34c16bc133c4c33997364a7cdc3534319d29 diff --git a/webui.py b/webui.py index 9171e773a..d95c290b8 100644 --- a/webui.py +++ b/webui.py @@ -164,14 +164,17 @@ def initialize(): def load_model(): - shared.state.begin() - shared.state.job = 'load model' - thread = Thread(target=lambda: shared.sd_model) - thread.start() + if opts.sd_checkpoint_autoload: + shared.state.begin() + shared.state.job = 'load model' + thread = Thread(target=lambda: shared.sd_model) + thread.start() + shared.state.end() + thread.join() + else: + log.debug('Model auto load disabled') shared.opts.onchange("sd_model_checkpoint", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False) shared.opts.onchange("sd_model_dict", wrap_queued_call(lambda: modules.sd_models.reload_model_weights()), call=False) - shared.state.end() - thread.join() startup_timer.record("checkpoint") @@ -301,11 +304,7 @@ def webui(restart=False): start_common() start_ui() modules.sd_models.write_metadata() - if opts.sd_checkpoint_autoload: - load_model() - else: - log.debug('Model auto load disabled') - + load_model() log.info(f"Startup time: {startup_timer.summary()}") if not restart: