Skip to content

Commit e714405

Browse files
lsteinhipsterusername
authored andcommitted
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.
1 parent c857c6c commit e714405

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

ldm/invoke/args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def parse_args(self):
174174
sysargs = sys.argv[1:]
175175
# pre-parse to get the root directory; ignore the rest
176176
switches = self._arg_parser.parse_args(sysargs)
177-
Globals.root = switches.root_dir or Globals.root
177+
Globals.root = os.path.abspath(switches.root_dir or Globals.root)
178178

179179
# now use root directory to find the init file
180180
initfile = os.path.expanduser(os.path.join(Globals.root,Globals.initfile))

ldm/invoke/globals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Globals = Namespace()
1717

1818
# This is usually overwritten by the command line and/or environment variables
19-
Globals.root = os.environ.get('INVOKEAI_ROOT') or os.path.expanduser('~/invokeai')
19+
Globals.root = os.path.abspath(os.environ.get('INVOKEAI_ROOT') or os.path.expanduser('~/invokeai'))
2020

2121
# Where to look for the initialization file
2222
Globals.initfile = 'invokeai.init'

0 commit comments

Comments
 (0)