fix several issues with Windows installs

1. resize installer window to give more room for configure and download forms
2. replace '\' with '/' in directory names to allow user to drag-and-drop
   folders into the dialogue boxes that accept directories.
3. similar change in CLI for the !import_model and !convert_model commands
4. better error reporting when a model download fails due to network errors
5. put the launcher scripts into a loop so that menu reappears after
   invokeai, merge script, etc exits. User can quit with "Q".
6. do not try to download fp16 of sd-ft-mse-vae, since it doesn't exist.
7. cleaned up status reporting when installing models
This commit is contained in:
Lincoln Stein
2023-02-23 00:43:25 -05:00
parent 3083356cf0
commit 9b157b6532
10 changed files with 66 additions and 68 deletions

View File

@ -336,7 +336,8 @@ class InvokeAiInstance:
elif el in ['-y','--yes','--yes-to-all']:
new_argv.append(el)
sys.argv = new_argv
import requests # to catch download exceptions
from messages import introduction
introduction()
@ -350,16 +351,16 @@ class InvokeAiInstance:
try:
invokeai_configure.main()
succeeded = True
except ConnectionError as e:
print(f'A network error was encountered during configuration and download: {str(e)}')
except requests.exceptions.ConnectionError as e:
print(f'\nA network error was encountered during configuration and download: {str(e)}')
except OSError as e:
print(f'An OS error was encountered during configuration and download: {str(e)}')
print(f'\nAn OS error was encountered during configuration and download: {str(e)}')
except Exception as e:
print(f'A problem was encountered during the configuration and download steps: {str(e)}')
print(f'\nA problem was encountered during the configuration and download steps: {str(e)}')
finally:
if not succeeded:
print('You may be able to finish the process by launching "invoke.sh" or "invoke.bat"')
print('from within the "invokeai" directory, and choosing options 5 and/or 6.')
print('To try again, find the "invokeai" directory, run the script "invoke.sh" or "invoke.bat"')
print('and choose option 7 to fix a broken install, optionally followed by option 5 to install models.')
print('Alternatively you can relaunch the installer.')
def install_user_scripts(self):

View File

@ -6,8 +6,9 @@ setlocal
call .venv\Scripts\activate.bat
set INVOKEAI_ROOT=.
:start
echo Do you want to generate images using the
echo 1. command-line
echo 1. command-line interface
echo 2. browser-based UI
echo 3. run textual inversion training
echo 4. merge models (diffusers type only)
@ -17,7 +18,8 @@ echo 7. re-run the configure script to fix a broken install
echo 8. open the developer console
echo 9. update InvokeAI
echo 10. command-line help
set /P restore="Please enter 1-10: [2] "
echo Q - quit
set /P restore="Please enter 1-10, Q: [2] "
if not defined restore set restore=2
IF /I "%restore%" == "1" (
echo Starting the InvokeAI command-line..
@ -60,9 +62,19 @@ IF /I "%restore%" == "1" (
python .venv\Scripts\invokeai.exe --help %*
pause
exit /b
) ELSE IF /I "%restore%" == "q" (
echo Goodbye!
goto ending
) ELSE (
echo Invalid selection
pause
exit /b
)
goto start
endlocal
pause
:ending
exit /b

View File

@ -24,9 +24,11 @@ if [ "$(uname -s)" == "Darwin" ]; then
export PYTORCH_ENABLE_MPS_FALLBACK=1
fi
while true
do
if [ "$0" != "bash" ]; then
echo "Do you want to generate images using the"
echo "1. command-line"
echo "1. command-line interface"
echo "2. browser-based UI"
echo "3. run textual inversion training"
echo "4. merge models (diffusers type only)"
@ -35,35 +37,36 @@ if [ "$0" != "bash" ]; then
echo "7. re-run the configure script to fix a broken install"
echo "8. open the developer console"
echo "9. update InvokeAI"
echo "10. command-line help "
echo "10. command-line help"
echo "Q - Quit"
echo ""
read -p "Please enter 1-10: [2] " yn
read -p "Please enter 1-10, Q: [2] " yn
choice=${yn:='2'}
case $choice in
1)
echo "Starting the InvokeAI command-line..."
exec invokeai $@
invokeai $@
;;
2)
echo "Starting the InvokeAI browser-based UI..."
exec invokeai --web $@
invokeai --web $@
;;
3)
echo "Starting Textual Inversion:"
exec invokeai-ti --gui $@
invokeai-ti --gui $@
;;
4)
echo "Merging Models:"
exec invokeai-merge --gui $@
invokeai-merge --gui $@
;;
5)
exec invokeai-model-install --root ${INVOKEAI_ROOT}
invokeai-model-install --root ${INVOKEAI_ROOT}
;;
6)
exec invokeai-configure --root ${INVOKEAI_ROOT} --skip-sd-weights --skip-support-models
invokeai-configure --root ${INVOKEAI_ROOT} --skip-sd-weights --skip-support-models
;;
7)
exec invokeai-configure --root ${INVOKEAI_ROOT} --yes --default_only
invokeai-configure --root ${INVOKEAI_ROOT} --yes --default_only
;;
8)
echo "Developer Console:"
@ -72,10 +75,13 @@ if [ "$0" != "bash" ]; then
;;
9)
echo "Update:"
exec invokeai-update
invokeai-update
;;
10)
exec invokeai --help
invokeai --help
;;
[qQ])
exit 0
;;
*)
echo "Invalid selection"
@ -86,3 +92,4 @@ else # in developer console
echo "Press ^D to exit"
export PS1="(InvokeAI) \u@\h \w> "
fi
done