From 408cf5e092beb154da23cc2ed2d8f31b1e2f603e Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Tue, 1 Nov 2022 13:54:42 -0400 Subject: [PATCH] candidate install scripts for testing --- installer/install.bat | 5 +++-- installer/install.sh | 11 +++++++---- scripts/preload_models.py | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/installer/install.bat b/installer/install.bat index bb68a5a071..a62242e1e5 100644 --- a/installer/install.bat +++ b/installer/install.bat @@ -82,7 +82,7 @@ call conda activate @rem create the environment call conda env remove -n invokeai call conda env create -if "%ERRORLEVEL%" NE "0" ( +if "%ERRORLEVEL%" NEQ "0" ( echo "" echo "Something went wrong while installing Python libraries and cannot continue. echo "Please visit https://invoke-ai.github.io/InvokeAI/#installation for alternative" @@ -95,7 +95,7 @@ if "%ERRORLEVEL%" NE "0" ( call conda activate invokeai @rem preload the models call python scripts\preload_models.py -if "%ERRORLEVEL%" NE "0" ( +if "%ERRORLEVEL%" NEQ "0" ( echo "" echo "The preload_models.py script crashed or was cancelled." echo "InvokeAI is not ready to run. To run preload_models.py again," @@ -107,6 +107,7 @@ if "%ERRORLEVEL%" NE "0" ( @rem tell the user their next steps echo "" +echo "* InvokeAI installed successfully *" echo "You can now start generating images by double-clicking the 'invoke.bat' file (inside this folder) echo "Press any key to continue" pause diff --git a/installer/install.sh b/installer/install.sh index 495cd2f354..e0bc32c219 100755 --- a/installer/install.sh +++ b/installer/install.sh @@ -103,20 +103,20 @@ else conda env create -f environment.yml fi -status = $? +status=$? if test $status -ne 0 then - echo "Something went wrong while installing Python libraries and cannot continue. + echo "Something went wrong while installing Python libraries and cannot continue." echo "Please visit https://invoke-ai.github.io/InvokeAI/#installation for alternative" echo "installation methods" else conda activate invokeai - # preload the models echo "Calling the preload_models.py script" python scripts/preload_models.py - if test $? -ne 0 + status=$? + if test $status -ne 0 then echo "The preload_models.py script crashed or was cancelled." echo "InvokeAI is not ready to run. To run preload_models.py again," @@ -124,4 +124,7 @@ else else # tell the user their next steps echo "You can now start generating images by running invoke.sh (inside this folder), using ./invoke.sh" + fi fi + +conda activate invokeai diff --git a/scripts/preload_models.py b/scripts/preload_models.py index c32be42c2c..3d42178b63 100644 --- a/scripts/preload_models.py +++ b/scripts/preload_models.py @@ -104,7 +104,7 @@ this program and resume later.\n''' #-------------------------------------------- def postscript(): print( - '''You're all set! You may now launch InvokeAI using one of these two commands: + '''\n** Model Installation Successful **\nYou're all set! You may now launch InvokeAI using one of these two commands: Web version: python scripts/invoke.py --web (connect to http://localhost:9090) @@ -277,6 +277,7 @@ def download_weight_datasets(models:dict, access_token:str): if len(successful) < len(models): print(f'\n* There were errors downloading one or more files.') print('Please double-check your license agreements, and your access token. Type ^C to quit.\n') + hfFolder.delete_token() return None HfFolder.save_token(access_token)