From 1b743f7d9b04b50a1e09a7f3c4a1326f98bda9c5 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 1 Dec 2022 19:35:32 +0000 Subject: [PATCH 1/4] source installer improvements and documentation - Source installer provides more context for what it is doing, and sends user to help/troubleshooting pages when something goes wrong. - install.sh and install.bat are renamed to install.sh.in and install.bat.in to discourage users from running them from within the - Documentation updated --- .../WinLongPathsEnabled.reg | Bin .../create_installers.sh | 0 {installer => binary_installer}/install.bat | 0 {installer => binary_installer}/install.sh | 0 {installer => binary_installer}/invoke.bat | 0 {installer => binary_installer}/invoke.sh | 0 .../py3.10-darwin-arm64-mps-reqs.txt | 0 .../py3.10-darwin-x86_64-cpu-reqs.txt | 0 .../py3.10-linux-x86_64-cuda-reqs.txt | 0 .../py3.10-windows-x86_64-cuda-reqs.txt | 0 {installer => binary_installer}/readme.txt | 0 .../requirements.in | 0 docs/installation/INSTALL_SOURCE.md | 76 +++++++++++++++++- docs/installation/index.md | 39 ++++++++- source_installer/WinLongPathsEnabled.reg | Bin 0 -> 284 bytes source_installer/create_installers.sh | 6 +- .../{install.bat => install.bat.in} | 24 +++--- .../{install.sh => install.sh.in} | 23 +++--- .../{invoke.bat => invoke.bat.in} | 0 source_installer/{invoke.sh => invoke.sh.in} | 0 .../{update.bat => update.bat.in} | 0 source_installer/{update.sh => update.sh.in} | 0 22 files changed, 144 insertions(+), 24 deletions(-) rename {installer => binary_installer}/WinLongPathsEnabled.reg (100%) rename {installer => binary_installer}/create_installers.sh (100%) rename {installer => binary_installer}/install.bat (100%) rename {installer => binary_installer}/install.sh (100%) rename {installer => binary_installer}/invoke.bat (100%) rename {installer => binary_installer}/invoke.sh (100%) rename {installer => binary_installer}/py3.10-darwin-arm64-mps-reqs.txt (100%) rename {installer => binary_installer}/py3.10-darwin-x86_64-cpu-reqs.txt (100%) rename {installer => binary_installer}/py3.10-linux-x86_64-cuda-reqs.txt (100%) rename {installer => binary_installer}/py3.10-windows-x86_64-cuda-reqs.txt (100%) rename {installer => binary_installer}/readme.txt (100%) rename {installer => binary_installer}/requirements.in (100%) create mode 100644 source_installer/WinLongPathsEnabled.reg rename source_installer/{install.bat => install.bat.in} (85%) rename source_installer/{install.sh => install.sh.in} (84%) rename source_installer/{invoke.bat => invoke.bat.in} (100%) rename source_installer/{invoke.sh => invoke.sh.in} (100%) rename source_installer/{update.bat => update.bat.in} (100%) rename source_installer/{update.sh => update.sh.in} (100%) diff --git a/installer/WinLongPathsEnabled.reg b/binary_installer/WinLongPathsEnabled.reg similarity index 100% rename from installer/WinLongPathsEnabled.reg rename to binary_installer/WinLongPathsEnabled.reg diff --git a/installer/create_installers.sh b/binary_installer/create_installers.sh similarity index 100% rename from installer/create_installers.sh rename to binary_installer/create_installers.sh diff --git a/installer/install.bat b/binary_installer/install.bat similarity index 100% rename from installer/install.bat rename to binary_installer/install.bat diff --git a/installer/install.sh b/binary_installer/install.sh similarity index 100% rename from installer/install.sh rename to binary_installer/install.sh diff --git a/installer/invoke.bat b/binary_installer/invoke.bat similarity index 100% rename from installer/invoke.bat rename to binary_installer/invoke.bat diff --git a/installer/invoke.sh b/binary_installer/invoke.sh similarity index 100% rename from installer/invoke.sh rename to binary_installer/invoke.sh diff --git a/installer/py3.10-darwin-arm64-mps-reqs.txt b/binary_installer/py3.10-darwin-arm64-mps-reqs.txt similarity index 100% rename from installer/py3.10-darwin-arm64-mps-reqs.txt rename to binary_installer/py3.10-darwin-arm64-mps-reqs.txt diff --git a/installer/py3.10-darwin-x86_64-cpu-reqs.txt b/binary_installer/py3.10-darwin-x86_64-cpu-reqs.txt similarity index 100% rename from installer/py3.10-darwin-x86_64-cpu-reqs.txt rename to binary_installer/py3.10-darwin-x86_64-cpu-reqs.txt diff --git a/installer/py3.10-linux-x86_64-cuda-reqs.txt b/binary_installer/py3.10-linux-x86_64-cuda-reqs.txt similarity index 100% rename from installer/py3.10-linux-x86_64-cuda-reqs.txt rename to binary_installer/py3.10-linux-x86_64-cuda-reqs.txt diff --git a/installer/py3.10-windows-x86_64-cuda-reqs.txt b/binary_installer/py3.10-windows-x86_64-cuda-reqs.txt similarity index 100% rename from installer/py3.10-windows-x86_64-cuda-reqs.txt rename to binary_installer/py3.10-windows-x86_64-cuda-reqs.txt diff --git a/installer/readme.txt b/binary_installer/readme.txt similarity index 100% rename from installer/readme.txt rename to binary_installer/readme.txt diff --git a/installer/requirements.in b/binary_installer/requirements.in similarity index 100% rename from installer/requirements.in rename to binary_installer/requirements.in diff --git a/docs/installation/INSTALL_SOURCE.md b/docs/installation/INSTALL_SOURCE.md index 2e3061d343..97b39937b2 100644 --- a/docs/installation/INSTALL_SOURCE.md +++ b/docs/installation/INSTALL_SOURCE.md @@ -55,7 +55,7 @@ off the process. named `install.bat` on Windows systems and `install.sh` on Linux and Macintosh systems. -4. Alternatively, form the command line, run the shell script or .bat file: +4. Alternatively, from the command line, run the shell script or .bat file: ```cmd C:\Documents\Linco> cd invokeAI @@ -66,6 +66,15 @@ off the process. requirements including Conda, Git and Python, then download the current InvokeAI code and install it along with its dependencies. + Be aware that some of the library download and install steps take a long time. + In particular, the `pytorch` package is quite large and often appears to get + "stuck" at 99.9%. Similarly, the `pip installing requirements` step may + appear to hang. Have patience and the installation step will eventually + resume. However, there are occasions when the library install does + legitimately get stuck. If you have been waiting for more than ten minutes + and nothing is happening, you can interrupt the script with ^C. You may restart + it and it will pick up where it left off. + 6. After installation completes, the installer will launch a script called `configure_invokeai.py`, which will guide you through the first-time process of selecting one or more Stable Diffusion model weights files, downloading and @@ -110,6 +119,71 @@ python scripts/invoke.py --web --max_load_models=3 \ These options are described in detail in the [Command-Line Interface](../features/CLI.md) documentation. +## Troubleshooting + +_Package dependency conflicts_ If you have previously installed +InvokeAI or another Stable Diffusion package, the installer may +occasionally pick up outdated libraries and either the installer or +`invoke` will fail with complaints out library conflicts. There are +two steps you can take to clear this problem. Both of these are done +from within the "developer's console", which you can get to by +launching `invoke.sh` (or `invoke.bat`) and selecting launch option +#3: + +1. Remove the previous `invokeai` environment completely. From within + the developer's console, give the command `conda env remove -n + invokeai`. This will delete previous files installed by `invoke`. + + Then exit from the developer's console and launch the script + `update.sh` (or `update.bat`). This will download the most recent + InvokeAI (including bug fixes) and reinstall the environment. + You should then be able to run `invoke.sh`/`invoke.bat`. + +2. If this doesn't work, you can try cleaning your system's conda + cache. This is slightly more extreme, but won't interfere with + any other python-based programs installed on your computer. + From the developer's console, run the command `conda clean -a` + and answer "yes" to all prompts. + + After this is done, run `update.sh` and try again as before. + +_"Corrupted configuration file."__ Everything seems to install ok, but +`invoke` complains of a corrupted configuration file and goes calls +`configure_invokeai.py` to fix, but this doesn't fix the problem. + +This issue is often caused by a misconfigured configuration directive +in the `.invokeai` initialization file that contains startup settings. +This can be corrected by fixing the offending line. + +First find `.invokeai`. It is a small text file located in your home +directory, `~/.invokeai` on Mac and Linux systems, and `C:\Users\*your +name*\.invokeai` on Windows systems. Open it with a text editor +(e.g. Notepad on Windows, TextEdit on Macs, or `nano` on Linux) +and look for the lines starting with `--root` and `--outdir`. + +An example is here: + +```cmd +--root="/home/lstein/invokeai" +--outdir="/home/lstein/invokeai/outputs" +``` + +There should not be whitespace before or after the directory paths, +and the paths should not end with slashes: + +```cmd +--root="/home/lstein/invokeai " # wrong! no whitespace here +--root="/home\lstein\invokeai\" # wrong! shouldn't end in a slash +``` + +Fix the problem with your text editor and save as a **plain text** +file. This should clear the issue. + +_If none of these maneuvers fixes the problem_ then please report the +problem to the [InvokeAI +Issues](https://github.com/invoke-ai/InvokeAI/issues) section, or +visit our [Discord Server](https://discord.gg/ZmtBAhwWhy) for interactive assistance. + ## Updating to newer versions This section describes how to update InvokeAI to new versions of the software. diff --git a/docs/installation/index.md b/docs/installation/index.md index 4abd2204d6..1da3ccb90b 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -5,7 +5,31 @@ title: Overview We offer several ways to install InvokeAI, each one suited to your experience and preferences. -1. [Source code installer](INSTALL_SOURCE.md) +1. [InvokeAI binary installer](INSTALL_INVOKE.md) + + This is a installer script that installs InvokeAI and all the + third party libraries it depends on. It includes access to a + "developer console" which will help us debug problems with you and + give you to access experimental features. + + When a new InvokeAI release is available, you will run an `update` + script to download and install the new version. Intermediate versions + that contain experimental and possibly unstable features will not be + available. + + This installer is designed for people who want the system to "just + work", don't have an interest in tinkering with it, and do not + care about upgrading to unreleased experimental features. + + **Important Caveats** + - This script does not support AMD GPUs. For Linux AMD support, + please use the manual or source code installer methods. + - The tab autocomplete feature of the command-line client, + which completes commonly used filenames and commands, will + not work in this version. All Web UI functions are fully + operational, however. + +2. [InvokeAI source code installer](INSTALL_SOURCE.md) This is a script that will install Python, the Anaconda ("conda") package manager, all of InvokeAI's its essential third party @@ -13,8 +37,17 @@ experience and preferences. console" which will help us debug problems with you and give you to access experimental features. - This method is recommended for individuals who are installing - InvokeAI for the first time. + When a new InvokeAI feature is available, even between releases, + you will be able to upgrade and try it out by running an `update` + script. This method is recommended for individuals who wish to + stay on the cutting edge of InvokeAI development and are not + afraid of occasional breakage. + + **Important Caveats** + - This script is a bit cranky and occasionally hangs or times out, + forcing you to cancel and restart the script (it will pick up where + it left off). It also takes noticeably longer to run than the + binary installer. 2. [Manual Installation](INSTALL_MANUAL.md) diff --git a/source_installer/WinLongPathsEnabled.reg b/source_installer/WinLongPathsEnabled.reg new file mode 100644 index 0000000000000000000000000000000000000000..778782b2724d59ad0caa2bd5ce8c0d38dc74f39b GIT binary patch literal 284 zcmXw!%WA?v6o$XG(033YK5YxP#O6xZS>`aBvBbmIGD%8NB0`B7CjPS5;vM@~aiGV@t8Thl^DtfzuDHh_cKHL!axnJ* literal 0 HcmV?d00001 diff --git a/source_installer/create_installers.sh b/source_installer/create_installers.sh index 46f75d25da..e52aa1e3a1 100755 --- a/source_installer/create_installers.sh +++ b/source_installer/create_installers.sh @@ -5,7 +5,8 @@ cd "$(dirname "${BASH_SOURCE[0]}")" # make the installer zip for linux and mac rm -rf invokeAI mkdir -p invokeAI -cp install.sh invokeAI +cp install.sh.in invokeAI/install.sh +chmod a+x invokeAI/install.sh cp readme.txt invokeAI zip -r invokeAI-src-installer-linux.zip invokeAI @@ -14,10 +15,11 @@ zip -r invokeAI-src-installer-mac.zip invokeAI # make the installer zip for windows rm -rf invokeAI mkdir -p invokeAI -cp install.bat invokeAI +cp install.bat.in invokeAI/install.bat cp readme.txt invokeAI cp WinLongPathsEnabled.reg invokeAI zip -r invokeAI-src-installer-windows.zip invokeAI +rm -rf invokeAI echo "The installer zips are ready to be distributed.." diff --git a/source_installer/install.bat b/source_installer/install.bat.in similarity index 85% rename from source_installer/install.bat rename to source_installer/install.bat.in index eaace2c084..b846d79f9e 100644 --- a/source_installer/install.bat +++ b/source_installer/install.bat.in @@ -9,8 +9,13 @@ @rem This enables a user to install this project without manually installing conda and git. -echo "Installing InvokeAI.." -echo. +echo "InvokeAI source 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." +echo "" +pause +echo "" @rem config set MAMBA_ROOT_PREFIX=%cd%\installer_files\mamba @@ -84,16 +89,16 @@ copy environments-and-requirements\environment-win-cuda.yml environment.yml call conda env create 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" - echo "installation methods." - echo "Press any key to continue" + echo "Something went wrong while installing Python libraries and cannot continue." + 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" pause exit /b ) -copy source_installer\invoke.bat invoke.bat -copy source_installer\update.bat update.bat +copy source_installer\invoke.bat.in .\invoke.bat +copy source_installer\update.bat.in .\update.bat call conda activate invokeai @rem preload the models @@ -114,5 +119,6 @@ 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 -exit 0 +exit /b + diff --git a/source_installer/install.sh b/source_installer/install.sh.in similarity index 84% rename from source_installer/install.sh rename to source_installer/install.sh.in index 64abdb03e9..22a075727f 100755 --- a/source_installer/install.sh +++ b/source_installer/install.sh.in @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # This script will install git and conda (if not found on the PATH variable) # using micromamba (an 8mb static-linked single-file binary, conda replacement). @@ -11,7 +11,11 @@ cd "$(dirname "${BASH_SOURCE[0]}")" -echo "Installing InvokeAI.." +echo "InvokeAI source 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 "" echo "" OS_NAME=$(uname -s) @@ -112,21 +116,22 @@ status=$? if test $status -ne 0 then - 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" + echo "Something went wrong while installing Python libraries and cannot continue." + 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" else - ln -sf ./source_installer/invoke.sh . - ln -sf ./source_installer/update.sh . + ln -sf ./source_installer/invoke.sh.in ./invoke.sh + ln -sf ./source_installer/update.sh.in ./update.sh conda activate invokeai # preload the models echo "Calling the preload_models.py script" - python scripts/preload_models.py + python scripts/configure_invokeai.py status=$? if test $status -ne 0 then - echo "The preload_models.py script crashed or was cancelled." + echo "The configure_invoke.py script crashed or was cancelled." echo "InvokeAI is not ready to run. Try again by running" echo "update.sh in this directory." else diff --git a/source_installer/invoke.bat b/source_installer/invoke.bat.in similarity index 100% rename from source_installer/invoke.bat rename to source_installer/invoke.bat.in diff --git a/source_installer/invoke.sh b/source_installer/invoke.sh.in similarity index 100% rename from source_installer/invoke.sh rename to source_installer/invoke.sh.in diff --git a/source_installer/update.bat b/source_installer/update.bat.in similarity index 100% rename from source_installer/update.bat rename to source_installer/update.bat.in diff --git a/source_installer/update.sh b/source_installer/update.sh.in similarity index 100% rename from source_installer/update.sh rename to source_installer/update.sh.in From 9fb2a43780d0c940f03ee70d7c707312537580f9 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 1 Dec 2022 19:40:47 +0000 Subject: [PATCH 2/4] rename "installer" to "binary_installer" - Fix up internal names so scripts run properly --- binary_installer/install.bat | 6 +++--- binary_installer/install.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/binary_installer/install.bat b/binary_installer/install.bat index 9f6934e128..c4bbdd2358 100644 --- a/binary_installer/install.bat +++ b/binary_installer/install.bat @@ -127,7 +127,7 @@ if %errorlevel% neq 0 goto err_exit echo ***** Updated pip and wheel ***** set err_msg=----- requirements file copy failed ----- -copy installer\py3.10-windows-x86_64-cuda-reqs.txt requirements.txt +copy binary_installer\py3.10-windows-x86_64-cuda-reqs.txt requirements.txt if %errorlevel% neq 0 goto err_exit set err_msg=----- main pip install failed ----- @@ -140,11 +140,11 @@ set err_msg=----- InvokeAI setup failed ----- .venv\Scripts\python -m pip install %no_cache_dir% --no-warn-script-location -e . if %errorlevel% neq 0 goto err_exit -copy installer\invoke.bat .\invoke.bat +copy binary_installer\invoke.bat .\invoke.bat echo ***** Installed invoke launcher script ****** @rem more cleanup -rd /s /q installer installer_files +rd /s /q binary_installer installer_files @rem preload the models call .venv\Scripts\python scripts\configure_invokeai.py diff --git a/binary_installer/install.sh b/binary_installer/install.sh index 8e1e9185b3..b0c3286c07 100644 --- a/binary_installer/install.sh +++ b/binary_installer/install.sh @@ -198,7 +198,7 @@ _err_exit $? _err_msg echo -e "\n***** Updated pip and wheel *****\n" _err_msg="\n----- requirements file copy failed -----\n" -cp installer/py3.10-${OS_NAME}-"${OS_ARCH}"-${CD}-reqs.txt requirements.txt +cp binary_installer/py3.10-${OS_NAME}-"${OS_ARCH}"-${CD}-reqs.txt requirements.txt _err_exit $? _err_msg _err_msg="\n----- main pip install failed -----\n" @@ -213,11 +213,11 @@ _err_exit $? _err_msg echo -e "\n***** Installed InvokeAI *****\n" -cp installer/invoke.sh . +cp binary_installer/invoke.sh . echo -e "\n***** Installed invoke launcher script ******\n" # more cleanup -rm -rf installer/ installer_files/ +rm -rf binary_installer/ installer_files/ # preload the models .venv/bin/python3 scripts/configure_invokeai.py From 540315edaa20ebe5fb90ea9facd927d900e38f26 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 1 Dec 2022 14:58:07 -0500 Subject: [PATCH 3/4] rename to binary_installer in build docs --- docs/installation/BUILDING_BINARY_INSTALLERS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation/BUILDING_BINARY_INSTALLERS.md b/docs/installation/BUILDING_BINARY_INSTALLERS.md index d4b4004e7c..5f45edb513 100644 --- a/docs/installation/BUILDING_BINARY_INSTALLERS.md +++ b/docs/installation/BUILDING_BINARY_INSTALLERS.md @@ -12,7 +12,7 @@ inside the InvokeAI git root folder, run the following commands: ```commandline conda activate invokeai # or however you activate python pip install pip-tools -pip-compile --allow-unsafe --generate-hashes --output-file=installer/.txt installer/requirements.in +pip-compile --allow-unsafe --generate-hashes --output-file=binary_installer/.txt binary_installer/requirements.in ``` where `.txt` is whichever of ```commandline @@ -27,7 +27,7 @@ matches the current OS and architecture. ## 3. Set github repository and branch Once all reqs files have been collected and committed **to the branch -to be installed**, edit `installer/install.sh.in` and `installer/install.bat.in` so that `RELEASE_URL` +to be installed**, edit `binary_installer/install.sh.in` and `binary_installer/install.bat.in` so that `RELEASE_URL` and `RELEASE_SOURCEBALL` point to the github repo and branch that is to be installed. From 6ec64ecb3cf992de8f189f3bd697ca28d835e7cc Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 1 Dec 2022 15:07:54 -0500 Subject: [PATCH 4/4] fix commit conflict markers --- binary_installer/install.bat.in | 6 +----- binary_installer/install.sh.in | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/binary_installer/install.bat.in b/binary_installer/install.bat.in index aaf71160af..feba071f80 100644 --- a/binary_installer/install.bat.in +++ b/binary_installer/install.bat.in @@ -140,11 +140,7 @@ set err_msg=----- InvokeAI setup failed ----- .venv\Scripts\python -m pip install %no_cache_dir% --no-warn-script-location -e . if %errorlevel% neq 0 goto err_exit -<<<<<<< HEAD:binary_installer/install.bat -copy binary_installer\invoke.bat .\invoke.bat -======= -copy installer\invoke.bat.in .\invoke.bat ->>>>>>> main:binary_installer/install.bat.in +copy binary_installer\invoke.bat.in .\invoke.bat echo ***** Installed invoke launcher script ****** @rem more cleanup diff --git a/binary_installer/install.sh.in b/binary_installer/install.sh.in index c080884903..7597ce524e 100644 --- a/binary_installer/install.sh.in +++ b/binary_installer/install.sh.in @@ -213,12 +213,8 @@ _err_exit $? _err_msg echo -e "\n***** Installed InvokeAI *****\n" -<<<<<<< HEAD:binary_installer/install.sh -cp binary_installer/invoke.sh . -======= -cp installer/invoke.sh.in ./invoke.sh +cp binary_installer/invoke.sh.in ./invoke.sh chmod a+x ./invoke.sh ->>>>>>> main:binary_installer/install.sh.in echo -e "\n***** Installed invoke launcher script ******\n" # more cleanup