mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
better error reporting when root directory not found (#2001)
- The invoke.py script now checks that the root (runtime) directory contains the expected config/models.yaml file and if it doesn't exits with a helpful error message about how to set the proper root. - Formerly the script would fail with a "bad model" message and try to redownload its models, which is not helpful in the case that the root is missing or damaged.
This commit is contained in:
parent
834e56a513
commit
6c015eedb3
@ -45,9 +45,15 @@ def main():
|
||||
print('--max_loaded_models must be >= 1; using 1')
|
||||
args.max_loaded_models = 1
|
||||
|
||||
# alert - setting globals here
|
||||
# alert - setting a global here
|
||||
Globals.try_patchmatch = args.patchmatch
|
||||
|
||||
if not os.path.exists(os.path.join(Globals.root,'configs','models.yaml')):
|
||||
print(f"\n** Error. The file {os.path.join(Globals.root,'configs','models.yaml')} could not be found.")
|
||||
print(f'** Please check the location of your invokeai directory and use the --root_dir option to point to the correct path.')
|
||||
print(f'** This script will now exit.')
|
||||
sys.exit(-1)
|
||||
|
||||
print(f'>> InvokeAI runtime directory is "{Globals.root}"')
|
||||
|
||||
# loading here to avoid long delays on startup
|
||||
|
Loading…
Reference in New Issue
Block a user