From ad5afcaae0b47e9e68b49aacf04cc3ad59d41a8e Mon Sep 17 00:00:00 2001 From: space-nuko <24979496+space-nuko@users.noreply.github.com> Date: Wed, 29 Mar 2023 16:46:03 -0500 Subject: Save/restore working webui/extension configs --- modules/paths_internal.py | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/paths_internal.py') diff --git a/modules/paths_internal.py b/modules/paths_internal.py index 926ec3bb..6765bafe 100644 --- a/modules/paths_internal.py +++ b/modules/paths_internal.py @@ -20,3 +20,4 @@ data_path = cmd_opts_pre.data_dir models_path = os.path.join(data_path, "models") extensions_dir = os.path.join(data_path, "extensions") extensions_builtin_dir = os.path.join(script_path, "extensions-builtin") +config_states_dir = os.path.join(script_path, "config_states") -- cgit v1.2.1 From 16e4d791224125cef2b91f7cf39893ceffd8bd74 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 11 May 2023 10:05:39 +0300 Subject: paths_internal: deduplicate modules_path --- modules/paths_internal.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/paths_internal.py') diff --git a/modules/paths_internal.py b/modules/paths_internal.py index 6765bafe..a3d3e1f8 100644 --- a/modules/paths_internal.py +++ b/modules/paths_internal.py @@ -3,7 +3,8 @@ import argparse import os -script_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) +modules_path = os.path.dirname(os.path.realpath(__file__)) +script_path = os.path.dirname(modules_path) sd_configs_path = os.path.join(script_path, "configs") sd_default_config = os.path.join(sd_configs_path, "v1-inference.yaml") @@ -12,7 +13,7 @@ default_sd_model_file = sd_model_file # Parse the --data-dir flag first so we can use it as a base for our other argument default values parser_pre = argparse.ArgumentParser(add_help=False) -parser_pre.add_argument("--data-dir", type=str, default=os.path.dirname(os.path.dirname(os.path.realpath(__file__))), help="base path where all user data is stored",) +parser_pre.add_argument("--data-dir", type=str, default=os.path.dirname(modules_path), help="base path where all user data is stored", ) cmd_opts_pre = parser_pre.parse_known_args()[0] data_path = cmd_opts_pre.data_dir -- cgit v1.2.1 From 1332c46b71b169b889d7df420f3285d9022da5cc Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Thu, 11 May 2023 10:07:01 +0300 Subject: Drop fonts + font-roboto deps since we only use the single regular cut of Roboto --- modules/paths_internal.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/paths_internal.py') diff --git a/modules/paths_internal.py b/modules/paths_internal.py index a3d3e1f8..a23f6d70 100644 --- a/modules/paths_internal.py +++ b/modules/paths_internal.py @@ -22,3 +22,5 @@ models_path = os.path.join(data_path, "models") extensions_dir = os.path.join(data_path, "extensions") extensions_builtin_dir = os.path.join(script_path, "extensions-builtin") config_states_dir = os.path.join(script_path, "config_states") + +roboto_ttf_file = os.path.join(modules_path, 'Roboto-Regular.ttf') -- cgit v1.2.1 From 681c16dd1e911bdf831b031b0f31aaba41c280f8 Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Fri, 12 May 2023 22:33:21 +0900 Subject: fix --data-dir for COMMANDLINE_ARGS move reading of COMMANDLINE_ARGS into paths_internal.py so --data-dir can be properly read --- modules/paths_internal.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/paths_internal.py') diff --git a/modules/paths_internal.py b/modules/paths_internal.py index a23f6d70..005a9b0a 100644 --- a/modules/paths_internal.py +++ b/modules/paths_internal.py @@ -2,6 +2,11 @@ import argparse import os +import sys +import shlex + +commandline_args = os.environ.get('COMMANDLINE_ARGS', "") +sys.argv += shlex.split(commandline_args) modules_path = os.path.dirname(os.path.realpath(__file__)) script_path = os.path.dirname(modules_path) -- cgit v1.2.1