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 0000000000..778782b272 Binary files /dev/null and b/source_installer/WinLongPathsEnabled.reg differ 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