(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
You have two choices for manual installation. The [first one](#pip-Install) uses
basic Python virtual environment (`venv`) command and `pip` package manager. The
[second one](#Conda-method) uses Anaconda3 package manager (`conda`). Both
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.
!!! tip As of InvokeAI v2.3.0 installation using the `conda` package manager
is no longer being supported. It will likely still work, but we are not testing
this installation method.
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),
which provides compatibility with Linux and Mac shells and nice features such as
command-line completion.
## pip Install
To install InvokeAI with virtual environments and the PIP package manager,
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
steps.
3. From within the InvokeAI top-level directory, create and activate a virtual
environment named `.venv` and prompt displaying `InvokeAI`:
```bash
python -m venv .venv \
--prompt InvokeAI \
--upgrade-deps
source .venv/bin/activate
```
4. Make sure that pip is installed in your virtual environment an up to date:
```bash
python -m ensurepip \
--upgrade
python -m pip install \
--upgrade pip
```
5. Install Package
```bash
pip install --use-pep517 .
```
6. Set up the runtime directory
In this step you will initialize a runtime directory that will contain the
models, model config files, directory for textual inversion embeddings, and
your outputs. This keeps the runtime directory separate from the source code
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`.
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
invokeai-configure --root_dir ~/Programs/invokeai
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`:
```bash
python -m venv ${INVOKEAI_ROOT}/.venv \
--prompt invokeai \
--upgrade-deps \
--copies
source ${INVOKEAI_ROOT}/.venv/bin/activate
```
!!! 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
python -m pip install --upgrade pip
```
6. Install Package
```bash
pip install --use-pep517 .
```
Deactivate and reactivate your runtime directory so that the invokeai-specific commands
become available in the environment
```
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
your outputs.
```bash
invokeai-configure --root ${INVOKEAI_ROOT}
```
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
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
If you have already downloaded the weights file(s) for another Stable
@ -127,19 +135,19 @@ please follow these steps:
=== "CLI"
```bash
invoke.py --root ~/Programs/invokeai
invokeai --root ~/invokeai
```
=== "local Webserver"
```bash
invoke.py --web --root ~/Programs/invokeai
invokeai --web --root ~/invokeai
```
=== "Public Webserver"
```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
@ -147,7 +155,8 @@ please follow these steps:
!!! 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!
@ -163,38 +172,6 @@ please follow these steps:
then launch `invokeai` command. If you forget to activate the virtual
environment you will most likeley receive a `command not found` error.
!!! tip
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!)
!!! warning
Do not move the runtime directory after installation. The virtual environment has absolute paths in it that get confused if the directory is moved.