mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
this is release candidate 2.3.3-rc1
Incorporates a modified version of the dialog-based invoke.sh script suggested by JoshuaKimsey: https://discord.com/channels/1020123559063990373/1089119602425995304
This commit is contained in:
parent
610a1483b7
commit
1cb88960fe
@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
# coauthored by Lincoln Stein, Eugene Brodsky and JoshuaKimsey
|
||||
# Copyright 2023, The InvokeAI Development Team
|
||||
|
||||
####
|
||||
# This launch script assumes that:
|
||||
# 1. it is located in the runtime directory,
|
||||
@ -18,78 +21,135 @@ cd "$scriptdir"
|
||||
. .venv/bin/activate
|
||||
|
||||
export INVOKEAI_ROOT="$scriptdir"
|
||||
PARAMS=$@
|
||||
|
||||
# set required env var for torch on mac MPS
|
||||
if [ "$(uname -s)" == "Darwin" ]; then
|
||||
export PYTORCH_ENABLE_MPS_FALLBACK=1
|
||||
fi
|
||||
|
||||
if [ "$0" != "bash" ]; then
|
||||
while true
|
||||
do
|
||||
echo "Do you want to generate images using the"
|
||||
echo "1. command-line interface"
|
||||
echo "2. browser-based UI"
|
||||
echo "3. run textual inversion training"
|
||||
echo "4. merge models (diffusers type only)"
|
||||
echo "5. download and install models"
|
||||
echo "6. change InvokeAI startup options"
|
||||
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 "Q - Quit"
|
||||
echo ""
|
||||
read -p "Please enter 1-10, Q: [2] " yn
|
||||
choice=${yn:='2'}
|
||||
case $choice in
|
||||
1)
|
||||
echo "Starting the InvokeAI command-line..."
|
||||
invokeai $@
|
||||
do_choice() {
|
||||
case $1 in
|
||||
1)
|
||||
echo "Generate images with a browser-based interface"
|
||||
clear
|
||||
invokeai --web $PARAMS
|
||||
;;
|
||||
2)
|
||||
echo "Starting the InvokeAI browser-based UI..."
|
||||
invokeai --web $@
|
||||
2)
|
||||
echo "Generate images using a command-line interface"
|
||||
clear
|
||||
invokeai $PARAMS
|
||||
;;
|
||||
3)
|
||||
echo "Starting Textual Inversion:"
|
||||
invokeai-ti --gui $@
|
||||
3)
|
||||
echo "Textual inversion training"
|
||||
clear
|
||||
invokeai-ti --gui $PARAMS
|
||||
;;
|
||||
4)
|
||||
echo "Merging Models:"
|
||||
invokeai-merge --gui $@
|
||||
4)
|
||||
echo "Merge models (diffusers type only)"
|
||||
clear
|
||||
invokeai-merge --gui $PARAMS
|
||||
;;
|
||||
5)
|
||||
5)
|
||||
echo "Download and install models"
|
||||
clear
|
||||
invokeai-model-install --root ${INVOKEAI_ROOT}
|
||||
;;
|
||||
6)
|
||||
6)
|
||||
echo "Change InvokeAI startup options"
|
||||
clear
|
||||
invokeai-configure --root ${INVOKEAI_ROOT} --skip-sd-weights --skip-support-models
|
||||
;;
|
||||
7)
|
||||
7)
|
||||
echo "Re-run the configure script to fix a broken install"
|
||||
clear
|
||||
invokeai-configure --root ${INVOKEAI_ROOT} --yes --default_only
|
||||
;;
|
||||
8)
|
||||
echo "Developer Console:"
|
||||
8)
|
||||
echo "Open the developer console"
|
||||
clear
|
||||
file_name=$(basename "${BASH_SOURCE[0]}")
|
||||
bash --init-file "$file_name"
|
||||
;;
|
||||
9)
|
||||
echo "Update:"
|
||||
9)
|
||||
echo "Update InvokeAI"
|
||||
clear
|
||||
invokeai-update
|
||||
;;
|
||||
10)
|
||||
10)
|
||||
echo "Command-line help"
|
||||
clear
|
||||
invokeai --help
|
||||
;;
|
||||
[qQ])
|
||||
exit 0
|
||||
*)
|
||||
echo "Exiting..."
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo "Invalid selection"
|
||||
exit;;
|
||||
esac
|
||||
done
|
||||
clear
|
||||
}
|
||||
|
||||
do_dialog() {
|
||||
while true
|
||||
do
|
||||
options=(
|
||||
1 "Generate images with a browser-based interface"
|
||||
2 "Generate images using a command-line interface"
|
||||
3 "Textual inversion training"
|
||||
4 "Merge models (diffusers type only)"
|
||||
5 "Download and install models"
|
||||
6 "Change InvokeAI startup options"
|
||||
7 "Re-run the configure script to fix a broken install"
|
||||
8 "Open the developer console"
|
||||
9 "Update InvokeAI"
|
||||
10 "Command-line help")
|
||||
|
||||
choice=$(dialog --clear \
|
||||
--backtitle "InvokeAI" \
|
||||
--title "What you like to run?" \
|
||||
--menu "Select an option:" \
|
||||
0 0 0 \
|
||||
"${options[@]}" \
|
||||
2>&1 >/dev/tty) || clear
|
||||
do_choice "$choice"
|
||||
done
|
||||
clear
|
||||
}
|
||||
|
||||
do_line_input() {
|
||||
echo " ** For a more attractive experience, please install the 'dialog' utility. **"
|
||||
echo ""
|
||||
while true
|
||||
do
|
||||
echo "Do you want to generate images using the"
|
||||
echo "1. browser-based UI"
|
||||
echo "2. command-line interface"
|
||||
echo "3. run textual inversion training"
|
||||
echo "4. merge models (diffusers type only)"
|
||||
echo "5. download and install models"
|
||||
echo "6. change InvokeAI startup options"
|
||||
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 "Q - Quit"
|
||||
echo ""
|
||||
read -p "Please enter 1-10, Q: [1] " yn
|
||||
choice=${yn:='1'}
|
||||
do_choice $choice
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$0" != "bash" ]; then
|
||||
# Dialog seems to be a standard installtion for most Linux distros, but this checks to ensure it is present regardless
|
||||
if command -v dialog &> /dev/null ; then
|
||||
do_dialog
|
||||
else
|
||||
do_line_input
|
||||
fi
|
||||
else # in developer console
|
||||
python --version
|
||||
echo "Press ^D to exit"
|
||||
export PS1="(InvokeAI) \u@\h \w> "
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user