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
|
#!/bin/bash
|
||||||
|
|
||||||
|
# coauthored by Lincoln Stein, Eugene Brodsky and JoshuaKimsey
|
||||||
|
# Copyright 2023, The InvokeAI Development Team
|
||||||
|
|
||||||
####
|
####
|
||||||
# This launch script assumes that:
|
# This launch script assumes that:
|
||||||
# 1. it is located in the runtime directory,
|
# 1. it is located in the runtime directory,
|
||||||
@ -18,78 +21,135 @@ cd "$scriptdir"
|
|||||||
. .venv/bin/activate
|
. .venv/bin/activate
|
||||||
|
|
||||||
export INVOKEAI_ROOT="$scriptdir"
|
export INVOKEAI_ROOT="$scriptdir"
|
||||||
|
PARAMS=$@
|
||||||
|
|
||||||
# set required env var for torch on mac MPS
|
# set required env var for torch on mac MPS
|
||||||
if [ "$(uname -s)" == "Darwin" ]; then
|
if [ "$(uname -s)" == "Darwin" ]; then
|
||||||
export PYTORCH_ENABLE_MPS_FALLBACK=1
|
export PYTORCH_ENABLE_MPS_FALLBACK=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$0" != "bash" ]; then
|
do_choice() {
|
||||||
while true
|
case $1 in
|
||||||
do
|
1)
|
||||||
echo "Do you want to generate images using the"
|
echo "Generate images with a browser-based interface"
|
||||||
echo "1. command-line interface"
|
clear
|
||||||
echo "2. browser-based UI"
|
invokeai --web $PARAMS
|
||||||
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 $@
|
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
echo "Starting the InvokeAI browser-based UI..."
|
echo "Generate images using a command-line interface"
|
||||||
invokeai --web $@
|
clear
|
||||||
|
invokeai $PARAMS
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
echo "Starting Textual Inversion:"
|
echo "Textual inversion training"
|
||||||
invokeai-ti --gui $@
|
clear
|
||||||
|
invokeai-ti --gui $PARAMS
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
echo "Merging Models:"
|
echo "Merge models (diffusers type only)"
|
||||||
invokeai-merge --gui $@
|
clear
|
||||||
|
invokeai-merge --gui $PARAMS
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
|
echo "Download and install models"
|
||||||
|
clear
|
||||||
invokeai-model-install --root ${INVOKEAI_ROOT}
|
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
|
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
|
invokeai-configure --root ${INVOKEAI_ROOT} --yes --default_only
|
||||||
;;
|
;;
|
||||||
8)
|
8)
|
||||||
echo "Developer Console:"
|
echo "Open the developer console"
|
||||||
|
clear
|
||||||
file_name=$(basename "${BASH_SOURCE[0]}")
|
file_name=$(basename "${BASH_SOURCE[0]}")
|
||||||
bash --init-file "$file_name"
|
bash --init-file "$file_name"
|
||||||
;;
|
;;
|
||||||
9)
|
9)
|
||||||
echo "Update:"
|
echo "Update InvokeAI"
|
||||||
|
clear
|
||||||
invokeai-update
|
invokeai-update
|
||||||
;;
|
;;
|
||||||
10)
|
10)
|
||||||
|
echo "Command-line help"
|
||||||
|
clear
|
||||||
invokeai --help
|
invokeai --help
|
||||||
;;
|
;;
|
||||||
[qQ])
|
*)
|
||||||
exit 0
|
echo "Exiting..."
|
||||||
|
exit
|
||||||
;;
|
;;
|
||||||
*)
|
|
||||||
echo "Invalid selection"
|
|
||||||
exit;;
|
|
||||||
esac
|
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
|
else # in developer console
|
||||||
python --version
|
python --version
|
||||||
echo "Press ^D to exit"
|
echo "Press ^D to exit"
|
||||||
export PS1="(InvokeAI) \u@\h \w> "
|
export PS1="(InvokeAI) \u@\h \w> "
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user