make webGUI model changing work again

- Using relative root addresses was causing problems when the
  current working directory was changed after start time.
- This commit makes the root address absolute at start time, such
  that changing the working directory later on doesn't break anything.
This commit is contained in:
Lincoln Stein 2022-12-11 13:03:05 +00:00 committed by Kent Keirsey
parent c857c6cc62
commit e7144055d1
2 changed files with 2 additions and 2 deletions

View File

@ -174,7 +174,7 @@ class Args(object):
sysargs = sys.argv[1:]
# pre-parse to get the root directory; ignore the rest
switches = self._arg_parser.parse_args(sysargs)
Globals.root = switches.root_dir or Globals.root
Globals.root = os.path.abspath(switches.root_dir or Globals.root)
# now use root directory to find the init file
initfile = os.path.expanduser(os.path.join(Globals.root,Globals.initfile))

View File

@ -16,7 +16,7 @@ from argparse import Namespace
Globals = Namespace()
# This is usually overwritten by the command line and/or environment variables
Globals.root = os.environ.get('INVOKEAI_ROOT') or os.path.expanduser('~/invokeai')
Globals.root = os.path.abspath(os.environ.get('INVOKEAI_ROOT') or os.path.expanduser('~/invokeai'))
# Where to look for the initialization file
Globals.initfile = 'invokeai.init'