From d35bf649456da2558cbb6f2ea16fa1606022b7e7 Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Tue, 1 Nov 2022 14:19:24 +0300 Subject: make launch.py run installers for extensions that have ones add some more classes to safety module for an extension --- launch.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'launch.py') diff --git a/launch.py b/launch.py index 958336f2..0d90d553 100644 --- a/launch.py +++ b/launch.py @@ -7,6 +7,7 @@ import shlex import platform dir_repos = "repositories" +dir_extensions = "extensions" python = sys.executable git = os.environ.get('GIT', "git") index_url = os.environ.get('INDEX_URL', "") @@ -101,9 +102,24 @@ def version_check(commit): else: print("Not a git clone, can't perform version check.") except Exception as e: - print("versipm check failed",e) + print("version check failed", e) + + +def run_extensions_installers(): + if not os.path.isdir(dir_extensions): + return + + for dirname_extension in os.listdir(dir_extensions): + path_installer = os.path.join(dir_extensions, dirname_extension, "install.py") + if not os.path.isfile(path_installer): + continue + + try: + print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {dirname_extension}")) + except Exception as e: + print(e, file=sys.stderr) + - def prepare_enviroment(): torch_command = os.environ.get('TORCH_COMMAND', "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113") requirements_file = os.environ.get('REQS_FILE', "requirements_versions.txt") @@ -189,6 +205,8 @@ def prepare_enviroment(): run_pip(f"install -r {requirements_file}", "requirements for Web UI") + run_extensions_installers() + if update_check: version_check(commit) -- cgit v1.2.1 From b85e83c3bd869c3f1ffacf8d3ff97bd9d406acff Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Tue, 1 Nov 2022 14:48:53 +0300 Subject: add PYTHONPATH for extension's install.py --- launch.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'launch.py') diff --git a/launch.py b/launch.py index 0d90d553..ff2f74ba 100644 --- a/launch.py +++ b/launch.py @@ -17,11 +17,11 @@ def extract_arg(args, name): return [x for x in args if x != name], name in args -def run(command, desc=None, errdesc=None): +def run(command, desc=None, errdesc=None, custom_env=None): if desc is not None: print(desc) - result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) + result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=os.environ if custom_env is None else custom_env) if result.returncode != 0: @@ -115,7 +115,10 @@ def run_extensions_installers(): continue try: - print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {dirname_extension}")) + env = os.environ.copy() + env['PYTHONPATH'] = os.path.abspath(".") + + print(run(f'"{python}" "{path_installer}"', errdesc=f"Error running install.py for extension {dirname_extension}", custom_env=env)) except Exception as e: print(e, file=sys.stderr) -- cgit v1.2.1 From fb1374791bf4b4c9b49de5378f29b12fdabcac97 Mon Sep 17 00:00:00 2001 From: Billy Cao Date: Thu, 3 Nov 2022 13:08:11 +0800 Subject: Fix --nowebui argument being ineffective --- launch.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'launch.py') diff --git a/launch.py b/launch.py index 958336f2..b061bce6 100644 --- a/launch.py +++ b/launch.py @@ -217,12 +217,15 @@ def tests(argv): proc.kill() -def start_webui(): - print(f"Launching Web UI with arguments: {' '.join(sys.argv[1:])}") +def start(): + print(f"Launching {'API server' if '--nowebui' in sys.argv else 'Web UI'} with arguments: {' '.join(sys.argv[1:])}") import webui - webui.webui() + if '--nowebui' in sys.argv: + webui.api_only() + else: + webui.webui() if __name__ == "__main__": prepare_enviroment() - start_webui() + start() -- cgit v1.2.1 From c0f7dbda3361daaa3e315e747fe5bebb75ea55d0 Mon Sep 17 00:00:00 2001 From: hentailord85ez <112723046+hentailord85ez@users.noreply.github.com> Date: Fri, 4 Nov 2022 23:01:58 +0000 Subject: Update k-diffusion to release 0.0.10 --- launch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'launch.py') diff --git a/launch.py b/launch.py index 2a51f20e..5fa11560 100644 --- a/launch.py +++ b/launch.py @@ -142,7 +142,7 @@ def prepare_enviroment(): stable_diffusion_commit_hash = os.environ.get('STABLE_DIFFUSION_COMMIT_HASH', "69ae4b35e0a0f6ee1af8bb9a5d0016ccb27e36dc") taming_transformers_commit_hash = os.environ.get('TAMING_TRANSFORMERS_COMMIT_HASH', "24268930bf1dce879235a7fddd0b2355b84d7ea6") - k_diffusion_commit_hash = os.environ.get('K_DIFFUSION_COMMIT_HASH', "f4e99857772fc3a126ba886aadf795a332774878") + k_diffusion_commit_hash = os.environ.get('K_DIFFUSION_COMMIT_HASH', "60e5042ca0da89c14d1dd59d73883280f8fce991") codeformer_commit_hash = os.environ.get('CODEFORMER_COMMIT_HASH', "c5b4593074ba6214284d6acd5f1719b6c5d739af") blip_commit_hash = os.environ.get('BLIP_COMMIT_HASH', "48211a1594f1321b00f14c9f7a5b4813144b2fb9") -- cgit v1.2.1