(docs) update manual install documentation

This commit is contained in:
Eugene Brodsky 2023-02-03 08:51:46 -05:00
parent c38b0b906d
commit 64f9fbda2f

View File

@ -14,22 +14,15 @@ title: Installing Manually
## Introduction ## Introduction
You have two choices for manual installation. The [first one](#pip-Install) uses !!! tip As of InvokeAI v2.3.0 installation using the `conda` package manager
basic Python virtual environment (`venv`) command and `pip` package manager. The is no longer being supported. It will likely still work, but we are not testing
[second one](#Conda-method) uses Anaconda3 package manager (`conda`). Both this installation method.
methods require you to enter commands on the terminal, also known as the
"console".
Note that the `conda` installation method is currently deprecated and will not
be supported at some point in the future.
On Windows systems, you are encouraged to install and use the On Windows systems, you are encouraged to install and use the
[PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3), [PowerShell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3),
which provides compatibility with Linux and Mac shells and nice features such as which provides compatibility with Linux and Mac shells and nice features such as
command-line completion. command-line completion.
## pip Install
To install InvokeAI with virtual environments and the PIP package manager, To install InvokeAI with virtual environments and the PIP package manager,
please follow these steps: please follow these steps:
@ -50,44 +43,64 @@ please follow these steps:
This will create InvokeAI folder where you will follow the rest of the This will create InvokeAI folder where you will follow the rest of the
steps. steps.
3. From within the InvokeAI top-level directory, create and activate a virtual 3. Create a directory of to contain your InvokeAI installation (known as the "runtime"
or "root" directory). This is where your models, configs, and outputs will live
by default. Please keep in mind the disk space requirements - you will need at
least 18GB (as of this writing) for the models and the virtual environment.
From now on we will refer to this directory as `INVOKEAI_ROOT`. This keeps the
runtime directory separate from the source code and aids in updating.
```bash
export INVOKEAI_ROOT="~/invokeai"
mkdir ${INVOKEAI_ROOT}
```
4. From within the InvokeAI top-level directory, create and activate a virtual
environment named `.venv` and prompt displaying `InvokeAI`: environment named `.venv` and prompt displaying `InvokeAI`:
```bash ```bash
python -m venv .venv \ python -m venv ${INVOKEAI_ROOT}/.venv \
--prompt InvokeAI \ --prompt invokeai \
--upgrade-deps --upgrade-deps \
source .venv/bin/activate --copies
source ${INVOKEAI_ROOT}/.venv/bin/activate
``` ```
4. Make sure that pip is installed in your virtual environment an up to date: !!! warning
You **may** create your virtual environment anywhere on the filesystem.
But IF you choose a location that is *not* inside the `$INVOKEAI_ROOT` directory,
then you must set the `INVOKEAI_ROOT` environment variable in your shell environment,
for example, by editing `~/.bashrc` or `~/.zshrc` files, or setting the Windows environment
variable. Refer to your operating system / shell documentation for the correct way of doing so.
5. Make sure that pip is installed in your virtual environment an up to date:
```bash ```bash
python -m ensurepip \ python -m pip install --upgrade pip
--upgrade
python -m pip install \
--upgrade pip
``` ```
5. Install Package 6. Install Package
```bash ```bash
pip install --use-pep517 . pip install --use-pep517 .
``` ```
6. Set up the runtime directory Deactivate and reactivate your runtime directory so that the invokeai-specific commands
become available in the environment
In this step you will initialize a runtime directory that will contain the ```
deactivate && source ${INVOKEAI_ROOT}/.venv/bin/activate
```
7. Set up the runtime directory
In this step you will initialize your runtime directory with the downloaded
models, model config files, directory for textual inversion embeddings, and models, model config files, directory for textual inversion embeddings, and
your outputs. This keeps the runtime directory separate from the source code your outputs.
and aids in updating.
You may pick any location for this directory using the `--root_dir` option
(abbreviated --root). If you don't pass this option, it will default to
`~/invokeai`.
```bash ```bash
invokeai-configure --root_dir ~/Programs/invokeai invokeai-configure --root ${INVOKEAI_ROOT}
``` ```
The script `invokeai-configure` will interactively guide you through the The script `invokeai-configure` will interactively guide you through the
@ -101,11 +114,6 @@ please follow these steps:
If you get an error message about a module not being installed, check that If you get an error message about a module not being installed, check that
the `invokeai` environment is active and if not, repeat step 5. the `invokeai` environment is active and if not, repeat step 5.
Note that `invokeai-configure` and `invokeai` should be installed under your
virtual environment directory and the system should find them on the PATH.
If this isn't working on your system, you can call the scripts directory
using `python scripts/configure_invokeai.py` and `python scripts/invoke.py`.
!!! tip !!! tip
If you have already downloaded the weights file(s) for another Stable If you have already downloaded the weights file(s) for another Stable
@ -127,19 +135,19 @@ please follow these steps:
=== "CLI" === "CLI"
```bash ```bash
invoke.py --root ~/Programs/invokeai invokeai --root ~/invokeai
``` ```
=== "local Webserver" === "local Webserver"
```bash ```bash
invoke.py --web --root ~/Programs/invokeai invokeai --web --root ~/invokeai
``` ```
=== "Public Webserver" === "Public Webserver"
```bash ```bash
invoke.py --web --host 0.0.0.0 --root ~/Programs/invokeai invokeai --web --host 0.0.0.0 --root ~/invokeai
``` ```
If you choose the run the web interface, point your browser at If you choose the run the web interface, point your browser at
@ -147,7 +155,8 @@ please follow these steps:
!!! tip !!! tip
You can permanently set the location of the runtime directory by setting the environment variable INVOKEAI_ROOT to the path of the directory. You can permanently set the location of the runtime directory by setting the environment variable `INVOKEAI_ROOT` to the path of the directory. As mentioned previously, this is
**required** if your virtual environment is located outside of your runtime directory.
8. Render away! 8. Render away!
@ -163,38 +172,6 @@ please follow these steps:
then launch `invokeai` command. If you forget to activate the virtual then launch `invokeai` command. If you forget to activate the virtual
environment you will most likeley receive a `command not found` error. environment you will most likeley receive a `command not found` error.
!!! tip !!! warning
Do not move the source code repository after installation. The virtual environment directory has absolute paths in it that get confused if the directory is moved.
## Creating an "install" version of InvokeAI
If you wish you can install InvokeAI and all its dependencies in the runtime
directory. This allows you to delete the source code repository and eliminates
the need to provide `--root_dir` at startup time. Note that this method only
works with the PIP method.
1. Follow the instructions for the PIP install, but in step #2 put the virtual
environment into the runtime directory. For example, assuming the runtime
directory lives in `~/Programs/invokeai`, you'd run:
```bash
python -m venv ~/Programs/invokeai
```
2. Now follow steps 3 to 5 in the PIP recipe, ending with the `pip install`
step.
3. Run one additional step while you are in the source code repository directory
```
pip install --use-pep517 . # note the dot in the end!!!
```
4. That's all! Now, whenever you activate the virtual environment, `invokeai`
will know where to look for the runtime directory without needing a
`--root_dir` argument. In addition, you can now move or delete the source
code repository entirely.
(Don't move the runtime directory!)
Do not move the runtime directory after installation. The virtual environment has absolute paths in it that get confused if the directory is moved.