diff --git a/ldm/invoke/globals.py b/ldm/invoke/globals.py index c97ae1494e..283b191907 100644 --- a/ldm/invoke/globals.py +++ b/ldm/invoke/globals.py @@ -11,12 +11,13 @@ the attributes: ''' import os +import os.path as osp from argparse import Namespace Globals = Namespace() # This is usually overwritten by the command line and/or environment variables -Globals.root = os.path.abspath(os.environ.get('INVOKEAI_ROOT') or os.path.expanduser('~/invokeai')) +Globals.root = osp.abspath(os.environ.get('INVOKEAI_ROOT') or osp.abspath(osp.join(os.environ.get('VIRTUAL_ENV'),'..')) or osp.expanduser('~/invokeai')) # Where to look for the initialization file Globals.initfile = 'invokeai.init'