InvokeAI/installer/install.sh.in

235 lines
7.8 KiB
Bash
Raw Normal View History

Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
#!/usr/bin/env bash
# ensure we're in the correct folder in case user's CWD is somewhere else
scriptdir=$(dirname "$0")
cd "$scriptdir"
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
# This version number will be replaced by the one supplied to create_installers.sh.
# Do not change it here - change it in create_installers.sh.
INVOKEAI_VERSION="latest"
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
# make sure we are not already in a venv
# (don't need to check status)
deactivate >/dev/null 2>&1
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
INVOKE_AI_SRC=https://github.com/invoke-ai/InvokeAI/archive/refs/tags/${INVOKEAI_VERSION}.zip
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
INSTRUCTIONS=https://invoke-ai.github.io/InvokeAI/installation/INSTALL_AUTOMATED/
TROUBLESHOOTING=https://invoke-ai.github.io/InvokeAI/installation/INSTALL_AUTOMATED/#troubleshooting
MINIMUM_PYTHON_VERSION=3.9.0
set -euo pipefail
IFS=$'\n\t'
function _err_exit {
if test "$1" -ne 0
then
echo -e "Error code $1; Error caught was '$2'"
if [ "$OS_NAME" == "osx" ]; then
echo "Something went wrong while installing InvokeAI and/or its requirements."
echo "You may need to use the Xcode command line tools to proceed. See step number 3 of"
echo "https://invoke-ai.github.io/InvokeAI/INSTALL_SOURCE#walk_through for"
echo "installation instructions and then run this script again."
else
echo "Something went wrong while installing InvokeAI and/or its requirements."
echo "See https://invoke-ai.github.io/InvokeAI/INSTALL_SOURCE#troubleshooting for troubleshooting"
echo "tips, or visit https://invoke-ai.github.io/InvokeAI/#installation for alternative"
echo "installation methods"
fi
read -p "Press any key to exit..."
exit
fi
}
function readinput() {
local CLEAN_ARGS=""
while [[ $# -gt 0 ]]; do
local i="$1"
case "$i" in
"-i")
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
if read -i "default" 2>/dev/null <<< "test"; then
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
CLEAN_ARGS="$CLEAN_ARGS -i \"$2\""
fi
shift
shift
;;
"-p")
CLEAN_ARGS="$CLEAN_ARGS -p \"$2\""
shift
shift
;;
*)
CLEAN_ARGS="$CLEAN_ARGS $1"
shift
;;
esac
done
eval read $CLEAN_ARGS
}
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
echo "InvokeAI simple installer..."
echo ""
echo "Some of the installation steps take a long time to run. Please be patient."
echo "If the script appears to hang for more than 10 minutes, please interrupt with control-C and retry."
read -n 1 -s -r -p "<Press any key to start the install>"
echo ""
OS_NAME=$(uname -s)
case "${OS_NAME}" in
Linux*) OS_NAME="linux";;
Darwin*) OS_NAME="osx";;
*) echo "Unknown OS: $OS_NAME! This script runs only on Linux or Mac" && exit
esac
OS_ARCH=$(uname -m)
case "${OS_ARCH}" in
x86_64*) OS_ARCH="64";;
arm64*) OS_ARCH="arm64";;
*) echo "Unknown system architecture: $OS_ARCH! This script runs only on x86_64 or arm64" && exit
esac
echo "Installing for $OS_NAME-$OS_ARCH"
# confirm that python is installed and is up to date
PYTHON=""
for candidate in python3.10 python3.9 python3 python python3.11 ; do
if ppath=`which $candidate`; then
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
python_version=$($ppath -V | awk '{ print $2 }')
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
if [ $(version $python_version) -ge $(version "$MINIMUM_PYTHON_VERSION") ]; then
PYTHON=$ppath
echo Python $python_version found at $PYTHON
break
fi
fi
done
if [ -z "$PYTHON" ]; then
echo "A suitable Python interpreter could not be found"
echo "Please install Python 3.9 or higher before running this script. See instructions at $INSTRUCTIONS for help."
read -p "Press any key to exit"
exit -1
fi
ROOTDIR=""
while [ "$ROOTDIR" == "" ]
do
echo
readinput -e -p "Select your preferred location for the 'invokeai' directory [$HOME]: " -i $HOME input
ROOTDIR=${input:=$HOME}/invokeai
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
# This is surprisingly hard to do in plain Bash; easier in ZSH. Just running python in subshell is easiest.
ROOTDIR=$($PYTHON -c "from pathlib import Path; print(Path('${ROOTDIR}').expanduser().resolve())")
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
read -e -p "InvokeAI will be installed into $ROOTDIR. OK? [y]: " input
RESPONSE=${input:='y'}
if [ "$RESPONSE" == 'y' ]; then
if [ -e "$ROOTDIR" ]; then
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
echo
read -e -p "Directory "$ROOTDIR" already exists. Do you want to resume an interrupted install? [y]: " input
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
RESPONSE=${input:='y'}
if [ "$RESPONSE" != 'y' ]; then
ROOTDIR=""
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
fi
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
else
mkdir -p "$ROOTDIR"
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
if [ $? -ne 0 ]; then
echo "Could not create "$ROOTDIR". Try again with a different install location."
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
ROOTDIR=""
fi
fi
else
ROOTDIR=""
fi
done
#--------------------------------------------------------------------------------
echo
echo "** Creating Virtual Environment for InvokeAI **"
$PYTHON -mvenv "$ROOTDIR"/.venv
_err_exit $? "Python failed to create virtual environment "$ROOTDIR"/.venv. Please see $TROUBLESHOOTING for help."
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
#--------------------------------------------------------------------------------
echo
echo "** Activating Virtual Environment for InvokeAI **"
source "$ROOTDIR"/.venv/bin/activate
_err_exit $? "Failed to activate virtual evironment "$ROOTDIR"/.venv. Please see $TROUBLESHOOTING for help."
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
PYTHON="$ROOTDIR"/.venv/bin/python
$PYTHON -mensurepip --upgrade
$PYTHON -mpip install --upgrade pip
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
#--------------------------------------------------------------------------------
echo
echo "*** Installing InvokeAI Dependencies ***"
if [ "$OS_NAME" == "osx" ]; then
echo "macOS detected. Installing MPS and CPU support."
egrep -v '^-e .' environments-and-requirements/requirements-mac-mps-cpu.txt >requirements.txt
else
if (lsmod | grep amdgpu) &>/dev/null ; then
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
readinput -e -p "Linux system with AMD GPU driver detected. Install ROCm AMD accelerated support? (Otherwise, CUDA support will be installed) [n]: " input
RESPONSE=${input:='n'}
if [ "$RESPONSE" != "n" ]; then
echo "Installing ROCm (AMD) support"
egrep -v '^-e .' environments-and-requirements/requirements-lin-amd.txt >requirements.txt
else
echo "Installing CUDA support"
egrep -v '^-e .' environments-and-requirements/requirements-lin-cuda.txt >requirements.txt
fi
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
else
echo "Linux system detected. Installing CUDA and CPU support."
egrep -v '^-e .' environments-and-requirements/requirements-lin-cuda.txt >requirements.txt
fi
fi
$PYTHON -mpip install --prefer-binary -r requirements.txt
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
_err_exit $? "Failed to install InvokeAI's dependencies."
#--------------------------------------------------------------------------------
echo
echo "*** Installing InvokeAI Modules and Executables ***"
$PYTHON -mpip install $INVOKE_AI_SRC
_err_exit $? "Installation of InvokeAI failed."
#--------------------------------------------------------------------------------
echo " *** Setting Up Root Directory "$ROOTDIR" *** "
cp -pr templates/rootdir/* "$ROOTDIR"/
cp templates/invoke.sh.in "$ROOTDIR"/invoke.sh
chmod a+rx "$ROOTDIR"/invoke.sh
cp templates/update.sh.in "$ROOTDIR"/update.sh
chmod a+rx "$ROOTDIR"/update.sh
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
# This allows the updater to work!
cp -pr environments-and-requirements requirements.txt "$ROOTDIR/"
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
#--------------------------------------------------------------------------------
echo
echo "*** Confguring InvokeAI ***"
pushd "$ROOTDIR" >/dev/null
$PYTHON ./.venv/bin/configure_invokeai.py --root="$ROOTDIR"
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
_err_exit $? "Initial configuration failed. Please see above error messages and $TROUBLESHOOTING for help."
#--------------------------------------------------------------------------------
popd
cp templates/invoke.sh.in "$ROOTDIR"/invoke.sh
chmod a+rx "$ROOTDIR"/invoke.sh
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
cp templates/update.sh.in "$ROOTDIR"/update.sh
chmod a+rx "$ROOTDIR"/update.sh
Simple Installer for Unified Directory Structure, Initial Implementation (#1819) * partially working simple installer * works on linux * fix linux requirements files * read root environment variable in right place * fix cat invokeai.init in test workflows * fix classical cp error in test-invoke-pip.yml * respect --root argument now * untested bat installers added * windows install.bat now working fix logic to find frontend files * rename simple_install to "installer" 1. simple_install => 'installer' 2. source and binary install directories are removed * enable update scripts to update requirements - Also pin requirements to known working commits. - This may be a breaking change; exercise with caution - No functional testing performed yet! * update docs and installation requirements NOTE: This may be a breaking commit! Due to the way the installer works, I have to push to a public branch in order to do full end-to-end testing. - Updated installation docs, removing binary and source installers and substituting the "simple" unified installer. - Pin requirements for the "http:" downloads to known working commits. - Removed as much as possible the invoke-ai forks of others' repos. * fix directory path for installer * correct requirement/environment errors * exclude zip files in .gitignore * possible fix for dockerbuild * ready for torture testing - final Windows bat file tweaks - copy environments-and-requirements to the runtime directory so that the `update.sh` script can run. This is not ideal, since we lose control over the requirements. Better for the update script to pull the proper updated requirements script from the repository. * allow update.sh/update.bat to install arbitrary InvokeAI versions - Can pass the zip file path to any InvokeAI release, branch, commit or tag, and the installer will try to install it. - Updated documentation - Added Linux Python install hints. * use binary installer's :err_exit function * user diffusers 0.10.0 * added logic for CPPFLAGS on mac * improve windows install documentation - added information on a couple of gotchas I experienced during windows installation, including DLL loading errors experienced when Visual Studio C++ Redistributable was not present. * tagged to pull from 2.2.4-rc1 - also fix error of shell window closing immediately if suitable python not found Co-authored-by: mauwii <Mauwii@outlook.de>
2022-12-11 05:37:08 +00:00
Lstein release candidate 2.2.5 (#2137) * installer tweaks in preparation for v2.2.5 - pin numpy to 1.23.* to avoid requirements conflict with numba - update.sh and update.bat now accept a tag or branch string, not a URL - update scripts download latest requirements-base before updating. * update.bat.in debugged and working * update pulls from "latest" now * bump version number * fix permissions on create_installer.sh * give Linux user option of installing ROCm or CUDA * rc2.2.5 (install.sh) relative path fixes (#2155) * (installer) fix bug in resolution of relative paths in linux install script point installer at 2.2.5-rc1 selecting ~/Data/myapps/ as location would create a ./~/Data/myapps instead of expanding the ~/ to the value of ${HOME} also, squash the trailing slash in path, if it was entered by the user * (installer) add option to automatically start the app after install also: when exiting, print the command to get back into the app * remove extraneous whitespace * model_cache applies rootdir to config path * bring installers up to date with 2.2.5-rc2 * bump rc version * create_installer now adds version number * rebuild frontend * bump rc# * add locales to frontend dist package - bump to patchlevel 6 * bump patchlevel * use invoke-ai version of GFPGAN - This version is very slightly modified to allow weights files to be pre-downloaded by the configure script. * fix formatting error during startup * bump patch level * workaround #2 for GFPGAN facexlib() weights downloading * bump patch * ready for merge and release * remove extraneous comment * set PYTORCH_ENABLE_MPS_FALLBACK directly in invoke.py Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-01-01 17:54:45 +00:00
echo "You may now run InvokeAI by entering the directory $ROOTDIR and running invoke.sh:"
echo
echo " ${ROOTDIR}/invoke.sh"
echo
read -e -p "Run InvokeAI now? [y]:" input
RESPONSE=${input:='y'}
if [ "$RESPONSE" == 'y' ]; then
exec ${ROOTDIR}/invoke.sh
fi