aboutsummaryrefslogtreecommitdiffstats
path: root/modules/paths.py
diff options
context:
space:
mode:
authorInvincibleDude <81354513+InvincibleDude@users.noreply.github.com>2023-01-29 11:36:10 +0000
committerGitHub <noreply@github.com>2023-01-29 11:36:10 +0000
commitee3d63b6beb88e63542976a1095d4c8aa97388bd (patch)
treecf891130682c343107ae0a0f8cec309aea16807a /modules/paths.py
parent44c0e6b993d00bb2f441f0fde409bcb79136f034 (diff)
parent00dab8f10defbbda579a1bc89c8d4e972c58a20d (diff)
downloadstable-diffusion-webui-gfx803-ee3d63b6beb88e63542976a1095d4c8aa97388bd.tar.gz
stable-diffusion-webui-gfx803-ee3d63b6beb88e63542976a1095d4c8aa97388bd.tar.bz2
stable-diffusion-webui-gfx803-ee3d63b6beb88e63542976a1095d4c8aa97388bd.zip
Merge branch 'master' into master
Diffstat (limited to 'modules/paths.py')
-rw-r--r--modules/paths.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/paths.py b/modules/paths.py
index 20b3e4d8..d991cc71 100644
--- a/modules/paths.py
+++ b/modules/paths.py
@@ -4,7 +4,15 @@ import sys
import modules.safe
script_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
-models_path = os.path.join(script_path, "models")
+
+# Parse the --data-dir flag first so we can use it as a base for our other argument default values
+parser = argparse.ArgumentParser(add_help=False)
+parser.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",)
+cmd_opts_pre = parser.parse_known_args()[0]
+data_path = cmd_opts_pre.data_dir
+models_path = os.path.join(data_path, "models")
+
+# data_path = cmd_opts_pre.data
sys.path.insert(0, script_path)
# search for directory of stable diffusion in following places