Skip to content

Commit 5e9227c

Browse files
docs: update manual install docs to mirror the launcher's install method
1 parent 9478523 commit 5e9227c

File tree

1 file changed

+62
-45
lines changed

1 file changed

+62
-45
lines changed

docs/installation/manual.md

Lines changed: 62 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,111 +8,128 @@
88

99
If you want to contribute to Invoke, instead follow the [dev environment](../contributing/dev-environment.md) guide.
1010

11-
InvokeAI is distributed as a python package on PyPI, installable with `pip`. There are a few things that are handled by the installer and launcher that you'll need to manage manually, described in this guide.
11+
InvokeAI is distributed as a python package on PyPI, installable with `pip`. There are a few things that are handled by the launcher that you'll need to manage manually, described in this guide.
1212

1313
## Requirements
1414

1515
Before you start, go through the [installation requirements](./requirements.md).
1616

1717
## Walkthrough
1818

19-
1. Create a directory to contain your InvokeAI library, configuration files, and models. This is known as the "runtime" or "root" directory, and typically lives in your home directory under the name `invokeai`.
19+
We'll use [`uv`](https://github.com/astral-sh/uv) to install python and create a virtual environment, then install the `invokeai` package. `uv` is a modern, very fast alternative to `pip`.
2020

21-
=== "Linux/macOS"
22-
23-
```bash
24-
mkdir ~/invokeai
25-
```
26-
27-
=== "Windows (PowerShell)"
28-
29-
```bash
30-
mkdir $Home/invokeai
31-
```
32-
33-
1. Enter the root directory and create a virtual Python environment within it named `.venv`.
21+
The following commands vary depending on the version of Invoke being installed and the system onto which it is being installed.
3422

35-
!!! warning "Virtual Environment Location"
23+
1. Install `uv` as described in its [docs](https://docs.astral.sh/uv/getting-started/installation/#standalone-installer). We suggest using the standalone installer method.
3624

37-
While you may create the virtual environment anywhere in the file system, we recommend that you create it within the root directory as shown here. This allows the application to automatically detect its data directories.
25+
Run `uv --version` to confirm that `uv` is installed and working. After installation, you may need to restart your terminal to get access to `uv`.
3826

39-
If you choose a different location for the venv, then you _must_ set the `INVOKEAI_ROOT` environment variable or specify the root directory using the `--root` CLI arg.
27+
2. Create a directory for your installation, typically in your home directory (e.g. `~/invokeai` or `$Home/invokeai`):
4028

4129
=== "Linux/macOS"
4230

4331
```bash
32+
mkdir ~/invokeai
4433
cd ~/invokeai
45-
python3 -m venv .venv --prompt InvokeAI
4634
```
4735

4836
=== "Windows (PowerShell)"
4937

5038
```bash
39+
mkdir $Home/invokeai
5140
cd $Home/invokeai
52-
python3 -m venv .venv --prompt InvokeAI
5341
```
5442

55-
1. Activate the new environment:
43+
3. Create a virtual environment in that directory:
44+
45+
```sh
46+
uv venv --relocatable --prompt invoke --python 3.11 --python-preference only-managed .venv
47+
```
48+
49+
This command creates a portable virtual environment at `.venv` complete with a portable python 3.11. It doesn't matter if your system has no python installed, or has a different version - `uv` will handle everything.
50+
51+
4. Activate the virtual environment:
5652
5753
=== "Linux/macOS"
5854
5955
```bash
6056
source .venv/bin/activate
6157
```
6258
63-
=== "Windows"
59+
=== "Windows (PowerShell)"
6460
6561
```ps
6662
.venv\Scripts\activate
6763
```
6864
69-
!!! info "Permissions Error (Windows)"
65+
5. Choose a version to install. Review the [GitHub releases page](https://github.com/invoke-ai/InvokeAI/releases).
7066
71-
If you get a permissions error at this point, run this command and try again.
67+
6. Determine the package package specifier to use when installing. This is a performance optimization.
7268
73-
`Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
69+
- If you have an Nvidia 20xx series GPU or older, use `invokeai[xformers]`.
70+
- If you have an Nvidia 30xx series GPU or newer, or do not have an Nvidia GPU, use `invokeai`.
7471
75-
The command-line prompt should change to to show `(InvokeAI)`, indicating the venv is active.
72+
7. Determine the `PyPI` index URL to use for installation, if any. This is necessary to get the right version of torch installed.
7673
77-
1. Make sure that pip is installed in your virtual environment and up to date:
74+
=== "Invoke v5 or later"
7875
79-
```bash
80-
python3 -m pip install --upgrade pip
81-
```
76+
- If you are on Windows with an Nvidia GPU, use `https://download.pytorch.org/whl/cu124`.
77+
- If you are on Linux with no GPU, use `https://download.pytorch.org/whl/cpu`.
78+
- If you are on Linux with an AMD GPU, use `https://download.pytorch.org/whl/rocm62`.
79+
- **In all other cases, do not use an index.**
8280
83-
1. Install the InvokeAI Package. The base command is `pip install InvokeAI --use-pep517`, but you may need to change this depending on your system and the desired features.
81+
=== "Invoke v4"
8482
85-
- You may need to provide an [extra index URL](https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-extra-index-url). Select your platform configuration using [this tool on the PyTorch website](https://pytorch.org/get-started/locally/). Copy the `--extra-index-url` string from this and append it to your install command.
83+
- If you are on Windows with an Nvidia GPU, use `https://download.pytorch.org/whl/cu124`.
84+
- If you are on Linux with no GPU, use `https://download.pytorch.org/whl/cpu`.
85+
- If you are on Linux with an AMD GPU, use `https://download.pytorch.org/whl/rocm52`.
86+
- **In all other cases, do not use an index.**
8687
87-
```bash
88-
pip install InvokeAI --use-pep517 --extra-index-url https://download.pytorch.org/whl/cu121
89-
```
88+
8. Install the `invokeai` package. Substitute the package specifier and version.
9089
91-
- If you have a CUDA GPU and want to install with `xformers`, you need to add an option to the package name. Note that `xformers` is not strictly necessary. PyTorch includes an implementation of the SDP attention algorithm with similar performance for most GPUs.
90+
```sh
91+
uv pip install <PACKAGE_SPECIFIER>=<VERSION> --python 3.11 --python-preference only-managed --force-reinstall
92+
```
9293
93-
```bash
94-
pip install "InvokeAI[xformers]" --use-pep517
95-
```
94+
If you determined you needed to use a `PyPI` index URL in the previous step, you'll need to add `--index=<INDEX_URL>` like this:
95+
96+
```sh
97+
uv pip install <PACKAGE_SPECIFIER>=<VERSION> --python 3.11 --python-preference only-managed --index=<INDEX_URL> --force-reinstall
98+
```
9699

97-
1. Deactivate and reactivate your venv so that the invokeai-specific commands become available in the environment:
100+
9. Deactivate and reactivate your venv so that the invokeai-specific commands become available in the environment:
98101

99102
=== "Linux/macOS"
100103

101104
```bash
102105
deactivate && source .venv/bin/activate
103106
```
104107

105-
=== "Windows"
108+
=== "Windows (PowerShell)"
106109

107110
```ps
108111
deactivate
109112
.venv\Scripts\activate
110113
```
111114

112-
1. Run the application:
115+
10. Run the application, specifying the directory you created earlier as the root directory:
116+
117+
=== "Linux/macOS"
118+
119+
```bash
120+
invokeai-web --root ~/invokeai
121+
```
122+
123+
=== "Windows (PowerShell)"
124+
125+
```bash
126+
invokeai-web --root $Home/invokeai
127+
```
128+
129+
## Headless Install and Launch Scripts
113130

114-
Run `invokeai-web` to start the UI. You must activate the virtual environment before running the app.
131+
If you run Invoke on a headless server, you might want to install and run Invoke on the command line.
115132

116-
!!! warning
133+
We do not plan to maintain scripts to do this moving forward, instead focusing our dev resources on the GUI [launcher](../installation/quick_start.md).
117134

118-
If the virtual environment is _not_ inside the root directory, then you _must_ specify the path to the root directory with `--root \path\to\invokeai` or the `INVOKEAI_ROOT` environment variable.
135+
You can create your own scripts for this by copying the handful of commands in this guide. `uv`'s [`pip` interface docs](https://docs.astral.sh/uv/reference/cli/#uv-pip-install) may be useful.

0 commit comments

Comments
 (0)