|
| 1 | +--- |
| 2 | +title: Installing with the Automated Installer |
| 3 | +--- |
| 4 | + |
| 5 | +# InvokeAI Automated Installation |
| 6 | + |
| 7 | +## Introduction |
| 8 | + |
| 9 | +The automated installer is a shell script that attempts to automate every step |
| 10 | +needed to install and run InvokeAI on a stock computer running recent versions |
| 11 | +of Linux, MacOS or Windows. It will leave you with a version that runs a stable |
| 12 | +version of InvokeAI with the option to upgrade to experimental versions later. |
| 13 | + |
| 14 | +## Walk through |
| 15 | + |
| 16 | +1. Make sure that your system meets the |
| 17 | + [hardware requirements](../index.md#hardware-requirements) and has the |
| 18 | + appropriate GPU drivers installed. In particular, if you are a Linux user |
| 19 | + with an AMD GPU installed, you may need to install the |
| 20 | + [ROCm driver](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html). |
| 21 | + |
| 22 | + !!! info "Required Space" |
| 23 | + |
| 24 | + Installation requires roughly 18G of free disk space to load the libraries and |
| 25 | + recommended model weights files. |
| 26 | + |
| 27 | +2. Check that your system has an up-to-date Python installed. To do this, open |
| 28 | + up a command-line window ("Terminal" on Linux and Macintosh, "Command" or |
| 29 | + "Powershell" on Windows) and type `python --version`. If Python is |
| 30 | + installed, it will print out the version number. If it is version `3.9.1` or |
| 31 | + higher, you meet requirements. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + !!! warning "If you see an older version, or get a command not found error" |
| 36 | + |
| 37 | + Go to [Python Downloads](https://www.python.org/downloads/) and |
| 38 | + download the appropriate installer package for your platform. We recommend |
| 39 | + [Version 3.10.9](https://www.python.org/downloads/release/python-3109/), |
| 40 | + which has been extensively tested with InvokeAI. |
| 41 | + |
| 42 | + !!! warning "At this time we do not recommend Python 3.11" |
| 43 | + |
| 44 | + _Please select your platform in the section below for platform-specific |
| 45 | + setup requirements._ |
| 46 | + |
| 47 | + === "Windows users" |
| 48 | + |
| 49 | + - During the Python configuration process, |
| 50 | + look out for a checkbox to add Python to your PATH |
| 51 | + and select it. If the install script complains that it can't |
| 52 | + find python, then open the Python installer again and choose |
| 53 | + "Modify" existing installation. |
| 54 | + |
| 55 | + - Installation requires an up to date version of the Microsoft Visual C libraries. Please install the 2015-2022 libraries available here: https://learn.microsoft.com/en-us/cpp/windows/deploying-native-desktop-applications-visual-cpp?view=msvc-170 |
| 56 | + |
| 57 | + === "Mac users" |
| 58 | + |
| 59 | + - After installing Python, you may need to run the |
| 60 | + following command from the Terminal in order to install the Web |
| 61 | + certificates needed to download model data from https sites. If |
| 62 | + you see lots of CERTIFICATE ERRORS during the last part of the |
| 63 | + install, this is the problem, and you can fix it with this command: |
| 64 | + |
| 65 | + `/Applications/Python\ 3.10/Install\ Certificates.command` |
| 66 | + |
| 67 | + - You may need to install the Xcode command line tools. These |
| 68 | + are a set of tools that are needed to run certain applications in a |
| 69 | + Terminal, including InvokeAI. This package is provided directly by Apple. |
| 70 | + |
| 71 | + - To install, open a terminal window and run `xcode-select |
| 72 | + --install`. You will get a macOS system popup guiding you through the |
| 73 | + install. If you already have them installed, you will instead see some |
| 74 | + output in the Terminal advising you that the tools are already installed. |
| 75 | + |
| 76 | + - More information can be found here: |
| 77 | + https://www.freecodecamp.org/news/install-xcode-command-line-tools/ |
| 78 | + |
| 79 | + === "Linux users" |
| 80 | + |
| 81 | + For reasons that are not entirely clear, installing the correct version of Python can be a bit of a challenge on Ubuntu, Linux Mint, and otherUbuntu-derived distributions. |
| 82 | + |
| 83 | + In particular, Ubuntu version 20.04 LTS comes with an old version of Python, does not come with the PIP package manager installed, and to make matters worse, the `python` command points to Python2, not Python3. |
| 84 | + |
| 85 | + Here is the quick recipe for bringing your system up to date: |
| 86 | + |
| 87 | + ``` |
| 88 | + sudo apt update |
| 89 | + sudo apt install python3.9 |
| 90 | + sudo apt install python3-pip |
| 91 | + cd /usr/bin |
| 92 | + sudo ln -sf python3.9 python3 |
| 93 | + sudo ln -sf python3 python |
| 94 | + ``` |
| 95 | +
|
| 96 | + You can still access older versions of Python by calling `python2`, `python3.8`, |
| 97 | + etc. |
| 98 | +
|
| 99 | +3. The source installer is distributed in ZIP files. Go to the |
| 100 | + [latest release](https://github.com/invoke-ai/InvokeAI/releases/latest), and |
| 101 | + look for a series of files named: |
| 102 | +
|
| 103 | + - [InvokeAI-installer-2.2.4-mac.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-mac.zip) |
| 104 | + - [InvokeAI-installer-2.2.4-windows.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-windows.zip) |
| 105 | + - [InvokeAI-installer-2.2.4-linux.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-linux.zip) |
| 106 | +
|
| 107 | + Download the one that is appropriate for your operating system. |
| 108 | +
|
| 109 | +4. Unpack the zip file into a convenient directory. This will create a new |
| 110 | + directory named "InvokeAI-Installer". This example shows how this would look |
| 111 | + using the `unzip` command-line tool, but you may use any graphical or |
| 112 | + command-line Zip extractor: |
| 113 | +
|
| 114 | + ```cmd |
| 115 | + C:\Documents\Linco> unzip InvokeAI-installer-2.2.4-windows.zip |
| 116 | + Archive: C: \Linco\Downloads\InvokeAI-installer-2.2.4-windows.zip |
| 117 | + creating: InvokeAI-Installer\ |
| 118 | + inflating: InvokeAI-Installer\install.bat |
| 119 | + inflating: InvokeAI-Installer\readme.txt |
| 120 | + ... |
| 121 | + ``` |
| 122 | +
|
| 123 | + After successful installation, you can delete the `InvokeAI-Installer` |
| 124 | + directory. |
| 125 | +
|
| 126 | +5. **Windows only** Please double-click on the file WinLongPathsEnabled.reg and |
| 127 | + accept the dialog box that asks you if you wish to modify your registry. |
| 128 | + This activates long filename support on your system and will prevent |
| 129 | + mysterious errors during installation. |
| 130 | +
|
| 131 | +6. If you are using a desktop GUI, double-click the installer file. It will be |
| 132 | + named `install.bat` on Windows systems and `install.sh` on Linux and |
| 133 | + Macintosh systems. |
| 134 | +
|
| 135 | + On Windows systems you will probably get an "Untrusted Publisher" warning. |
| 136 | + Click on "More Info" and select "Run Anyway." You trust us, right? |
| 137 | +
|
| 138 | +7. Alternatively, from the command line, run the shell script or .bat file: |
| 139 | +
|
| 140 | + ```cmd |
| 141 | + C:\Documents\Linco> cd InvokeAI-Installer |
| 142 | + C:\Documents\Linco\invokeAI> install.bat |
| 143 | + ``` |
| 144 | +
|
| 145 | +8. The script will ask you to choose where to install InvokeAI. Select a |
| 146 | + directory with at least 18G of free space for a full install. InvokeAI and |
| 147 | + all its support files will be installed into a new directory named |
| 148 | + `invokeai` located at the location you specify. |
| 149 | +
|
| 150 | + - The default is to install the `invokeai` directory in your home directory, |
| 151 | + usually `C:\Users\YourName\invokeai` on Windows systems, |
| 152 | + `/home/YourName/invokeai` on Linux systems, and `/Users/YourName/invokeai` |
| 153 | + on Macintoshes, where "YourName" is your login name. |
| 154 | +
|
| 155 | + - The script uses tab autocompletion to suggest directory path completions. |
| 156 | + Type part of the path (e.g. "C:\Users") and press ++tab++ repeatedly |
| 157 | + to suggest completions. |
| 158 | +
|
| 159 | +9. Sit back and let the install script work. It will install the third-party |
| 160 | + libraries needed by InvokeAI, then download the current InvokeAI release and |
| 161 | + install it. |
| 162 | +
|
| 163 | + Be aware that some of the library download and install steps take a long |
| 164 | + time. In particular, the `pytorch` package is quite large and often appears |
| 165 | + to get "stuck" at 99.9%. Have patience and the installation step will |
| 166 | + eventually resume. However, there are occasions when the library install |
| 167 | + does legitimately get stuck. If you have been waiting for more than ten |
| 168 | + minutes and nothing is happening, you can interrupt the script with ^C. You |
| 169 | + may restart it and it will pick up where it left off. |
| 170 | +
|
| 171 | +10. After installation completes, the installer will launch a script called |
| 172 | + `configure_invokeai.py`, which will guide you through the first-time process |
| 173 | + of selecting one or more Stable Diffusion model weights files, downloading |
| 174 | + and configuring them. We provide a list of popular models that InvokeAI |
| 175 | + performs well with. However, you can add more weight files later on using |
| 176 | + the command-line client or the Web UI. See |
| 177 | + [Installing Models](INSTALLING_MODELS.md) for details. |
| 178 | +
|
| 179 | + Note that the main Stable Diffusion weights file is protected by a license |
| 180 | + agreement that you must agree to in order to use. The script will list the |
| 181 | + steps you need to take to create an account on the official site that hosts |
| 182 | + the weights files, accept the agreement, and provide an access token that |
| 183 | + allows InvokeAI to legally download and install the weights files. |
| 184 | +
|
| 185 | + If you have already downloaded the weights file(s) for another Stable |
| 186 | + Diffusion distribution, you may skip this step (by selecting "skip" when |
| 187 | + prompted) and configure InvokeAI to use the previously-downloaded files. The |
| 188 | + process for this is described in [Installing Models](INSTALLING_MODELS.md). |
| 189 | +
|
| 190 | +11. The script will now exit and you'll be ready to generate some images. Look |
| 191 | + for the directory `invokeai` installed in the location you chose at the |
| 192 | + beginning of the install session. Look for a shell script named `invoke.sh` |
| 193 | + (Linux/Mac) or `invoke.bat` (Windows). Launch the script by double-clicking |
| 194 | + it or typing its name at the command-line: |
| 195 | +
|
| 196 | + ```cmd |
| 197 | + C:\Documents\Linco> cd invokeai |
| 198 | + C:\Documents\Linco\invokeAI> invoke.bat |
| 199 | + ``` |
| 200 | +
|
| 201 | + - The `invoke.bat` (`invoke.sh`) script will give you the choice of starting |
| 202 | + (1) the command-line interface, or (2) the web GUI. If you start the |
| 203 | + latter, you can load the user interface by pointing your browser at |
| 204 | + http://localhost:9090. |
| 205 | +
|
| 206 | + - The script also offers you a third option labeled "open the developer |
| 207 | + console". If you choose this option, you will be dropped into a |
| 208 | + command-line interface in which you can run python commands directly, |
| 209 | + access developer tools, and launch InvokeAI with customized options. |
| 210 | +
|
| 211 | +12. You can launch InvokeAI with several different command-line arguments that |
| 212 | + customize its behavior. For example, you can change the location of the |
| 213 | + image output directory, or select your favorite sampler. See the |
| 214 | + [Command-Line Interface](../features/CLI.md) for a full list of the options. |
| 215 | +
|
| 216 | + - To set defaults that will take effect every time you launch InvokeAI, |
| 217 | + use a text editor (e.g. Notepad) to exit the file |
| 218 | + `invokeai\invokeai.init`. It contains a variety of examples that you can |
| 219 | + follow to add and modify launch options. |
| 220 | +
|
| 221 | +!!! warning "The `invokeai` directory contains the `invoke` application, its |
| 222 | +configuration files, the model weight files, and outputs of image generation. |
| 223 | +Once InvokeAI is installed, do not move or remove this directory." |
| 224 | +
|
| 225 | +## Troubleshooting |
| 226 | +
|
| 227 | +### _Package dependency conflicts_ |
| 228 | +
|
| 229 | +If you have previously installed InvokeAI or another Stable Diffusion package, |
| 230 | +the installer may occasionally pick up outdated libraries and either the |
| 231 | +installer or `invoke` will fail with complaints about library conflicts. You can |
| 232 | +address this by entering the `invokeai` directory and running `update.sh`, which |
| 233 | +will bring InvokeAI up to date with the latest libraries. |
| 234 | +
|
| 235 | +### ldm from pypi |
| 236 | +
|
| 237 | +!!! warning |
| 238 | +
|
| 239 | + Some users have tried to correct dependency problems by installing |
| 240 | + the `ldm` package from PyPi.org. Unfortunately this is an unrelated package that |
| 241 | + has nothing to do with the 'latent diffusion model' used by InvokeAI. Installing |
| 242 | + ldm will make matters worse. If you've installed ldm, uninstall it with |
| 243 | + `pip uninstall ldm`. |
| 244 | +
|
| 245 | +### Corrupted configuration file |
| 246 | +
|
| 247 | +Everything seems to install ok, but `invoke` complains of a corrupted |
| 248 | +configuration file and goes back into the configuration process (asking you to |
| 249 | +download models, etc), but this doesn't fix the problem. |
| 250 | +
|
| 251 | +This issue is often caused by a misconfigured configuration directive in the |
| 252 | +`invokeai\invokeai.init` initialization file that contains startup settings. The |
| 253 | +easiest way to fix the problem is to move the file out of the way and re-run |
| 254 | +`configure_invokeai.py`. Enter the developer's console (option 3 of the launcher |
| 255 | +script) and run this command: |
| 256 | +
|
| 257 | +```cmd |
| 258 | +configure_invokeai.py --root=. |
| 259 | +``` |
| 260 | + |
| 261 | +Note the dot (.) after `--root`. It is part of the command. |
| 262 | + |
| 263 | +_If none of these maneuvers fixes the problem_ then please report the problem to |
| 264 | +the [InvokeAI Issues](https://github.com/invoke-ai/InvokeAI/issues) section, or |
| 265 | +visit our [Discord Server](https://discord.gg/ZmtBAhwWhy) for interactive |
| 266 | +assistance. |
| 267 | + |
| 268 | +### other problems |
| 269 | + |
| 270 | +If you run into problems during or after installation, the InvokeAI team is |
| 271 | +available to help you. Either create an |
| 272 | +[Issue](https://github.com/invoke-ai/InvokeAI/issues) at our GitHub site, or |
| 273 | +make a request for help on the "bugs-and-support" channel of our |
| 274 | +[Discord server](https://discord.gg/ZmtBAhwWhy). We are a 100% volunteer |
| 275 | +organization, but typically somebody will be available to help you within 24 |
| 276 | +hours, and often much sooner. |
| 277 | + |
| 278 | +## Updating to newer versions |
| 279 | + |
| 280 | +This distribution is changing rapidly, and we add new features on a daily basis. |
| 281 | +To update to the latest released version (recommended), run the `update.sh` |
| 282 | +(Linux/Mac) or `update.bat` (Windows) scripts. This will fetch the latest |
| 283 | +release and re-run the `configure_invokeai` script to download any updated |
| 284 | +models files that may be needed. You can also use this to add additional models |
| 285 | +that you did not select at installation time. |
| 286 | + |
| 287 | +You can now close the developer console and run `invoke` as before. If you get |
| 288 | +complaints about missing models, then you may need to do the additional step of |
| 289 | +running `configure_invokeai.py`. This happens relatively infrequently. To do |
| 290 | +this, simply open up the developer's console again and type |
| 291 | +`python scripts/configure_invokeai.py`. |
| 292 | + |
| 293 | +You may also use the `update` script to install any selected version of |
| 294 | +InvokeAI. From https://github.com/invoke-ai/InvokeAI, navigate to the zip file |
| 295 | +link of the version you wish to install. You can find the zip links by going to |
| 296 | +the one of the release pages and looking for the **Assets** section at the |
| 297 | +bottom. Alternatively, you can browse "branches" and "tags" at the top of the |
| 298 | +big code directory on the InvokeAI welcome page. When you find the version you |
| 299 | +want to install, go to the green "<> Code" button at the top, and copy the |
| 300 | +"Download ZIP" link. |
| 301 | + |
| 302 | +Now run `update.sh` (or `update.bat`) with the URL of the desired InvokeAI |
| 303 | +version as its argument. For example, this will install the old 2.2.0 release. |
| 304 | + |
| 305 | +```cmd |
| 306 | +update.sh https://github.com/invoke-ai/InvokeAI/archive/refs/tags/v2.2.0.zip |
| 307 | +``` |
| 308 | + |
0 commit comments