Skip to content

Commit f2b2ebf

Browse files
author
Lincoln Stein
committed
merge with main, resolve conflicts
2 parents 75b28eb + f7968ef commit f2b2ebf

163 files changed

Lines changed: 4301 additions & 6612 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ __pycache__/
3434
.Python
3535
build/
3636
develop-eggs/
37-
dist/
37+
# dist/
3838
downloads/
3939
eggs/
4040
.eggs/
@@ -79,6 +79,7 @@ cov.xml
7979
.pytest.ini
8080
cover/
8181
junit/
82+
notes/
8283

8384
# Translations
8485
*.mo
@@ -201,6 +202,9 @@ checkpoints
201202
# If it's a Mac
202203
.DS_Store
203204

205+
invokeai/frontend/yarn.lock
206+
invokeai/frontend/node_modules
207+
204208
# Let the frontend manage its own gitignore
205209
!invokeai/frontend/web/*
206210

README.md

Lines changed: 196 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,38 @@
3636

3737
</div>
3838

39-
InvokeAI is a leading creative engine built to empower professionals and enthusiasts alike. Generate and create stunning visual media using the latest AI-driven technologies. InvokeAI offers an industry leading Web Interface, interactive Command Line Interface, and also serves as the foundation for multiple commercial products.
39+
_**Note: This is an alpha release. Bugs are expected and not all
40+
features are fully implemented. Please use the GitHub [Issues
41+
pages](https://github.com/invoke-ai/InvokeAI/issues?q=is%3Aissue+is%3Aopen)
42+
to report unexpected problems. Also note that InvokeAI root directory
43+
which contains models, outputs and configuration files, has changed
44+
between the 2.x and 3.x release. If you wish to use your v2.3 root
45+
directory with v3.0, please follow the directions in [Migrating a 2.3
46+
root directory to 3.0](#migrating-to-3).**_
47+
48+
InvokeAI is a leading creative engine built to empower professionals
49+
and enthusiasts alike. Generate and create stunning visual media using
50+
the latest AI-driven technologies. InvokeAI offers an industry leading
51+
Web Interface, interactive Command Line Interface, and also serves as
52+
the foundation for multiple commercial products.
53+
54+
**Quick links**: [[How to
55+
Install](https://invoke-ai.github.io/InvokeAI/#installation)] [<a
56+
href="https://discord.gg/ZmtBAhwWhy">Discord Server</a>] [<a
57+
href="https://invoke-ai.github.io/InvokeAI/">Documentation and
58+
Tutorials</a>] [<a
59+
href="https://github.com/invoke-ai/InvokeAI/">Code and
60+
Downloads</a>] [<a
61+
href="https://github.com/invoke-ai/InvokeAI/issues">Bug Reports</a>]
62+
[<a
63+
href="https://github.com/invoke-ai/InvokeAI/discussions">Discussion,
64+
Ideas & Q&A</a>]
4065

41-
**Quick links**: [[How to Install](https://invoke-ai.github.io/InvokeAI/#installation)] [<a href="https://discord.gg/ZmtBAhwWhy">Discord Server</a>] [<a href="https://invoke-ai.github.io/InvokeAI/">Documentation and Tutorials</a>] [<a href="https://github.com/invoke-ai/InvokeAI/">Code and Downloads</a>] [<a href="https://github.com/invoke-ai/InvokeAI/issues">Bug Reports</a>] [<a href="https://github.com/invoke-ai/InvokeAI/discussions">Discussion, Ideas & Q&A</a>]
66+
<div align="center">
67+
68+
![canvas preview](https://github.com/invoke-ai/InvokeAI/raw/main/docs/assets/canvas_preview.png)
69+
70+
</div>
4271

4372
## Table of Contents
4473

@@ -63,6 +92,9 @@ Table of Contents 📝
6392
For full installation and upgrade instructions, please see:
6493
[InvokeAI Installation Overview](https://invoke-ai.github.io/InvokeAI/installation/)
6594

95+
If upgrading from version 2.3, please read [Migrating a 2.3 root
96+
directory to 3.0](#migrating-to-3) first.
97+
6698
### Automatic Installer (suggested for 1st time users)
6799

68100
1. Go to the bottom of the [Latest Release Page](https://github.com/invoke-ai/InvokeAI/releases/latest)
@@ -100,7 +132,168 @@ and go to http://localhost:9090.
100132

101133
### Command-Line Installation (for developers and users familiar with Terminals)
102134

103-
Please see [InvokeAI Installation Overview](https://invoke-ai.github.io/InvokeAI/installation/) for more details on installing and managing your virtual environment manually.
135+
You must have Python 3.9 or 3.10 installed on your machine. Earlier or later versions are
136+
not supported.
137+
138+
1. Open a command-line window on your machine. The PowerShell is recommended for Windows.
139+
2. Create a directory to install InvokeAI into. You'll need at least 15 GB of free space:
140+
141+
```terminal
142+
mkdir invokeai
143+
````
144+
145+
3. Create a virtual environment named `.venv` inside this directory and activate it:
146+
147+
```terminal
148+
cd invokeai
149+
python -m venv .venv --prompt InvokeAI
150+
```
151+
152+
4. Activate the virtual environment (do it every time you run InvokeAI)
153+
154+
_For Linux/Mac users:_
155+
156+
```sh
157+
source .venv/bin/activate
158+
```
159+
160+
_For Windows users:_
161+
162+
```ps
163+
.venv\Scripts\activate
164+
```
165+
166+
5. Install the InvokeAI module and its dependencies. Choose the command suited for your platform & GPU.
167+
168+
_For Windows/Linux with an NVIDIA GPU:_
169+
170+
```terminal
171+
pip install "InvokeAI[xformers]" --use-pep517 --extra-index-url https://download.pytorch.org/whl/cu117
172+
```
173+
174+
_For Linux with an AMD GPU:_
175+
176+
```sh
177+
pip install InvokeAI --use-pep517 --extra-index-url https://download.pytorch.org/whl/rocm5.4.2
178+
```
179+
180+
_For non-GPU systems:_
181+
```terminal
182+
pip install InvokeAI --use-pep517 --extra-index-url https://download.pytorch.org/whl/cpu
183+
```
184+
185+
_For Macintoshes, either Intel or M1/M2:_
186+
187+
```sh
188+
pip install InvokeAI --use-pep517
189+
```
190+
191+
6. Configure InvokeAI and install a starting set of image generation models (you only need to do this once):
192+
193+
```terminal
194+
invokeai-configure
195+
```
196+
197+
7. Launch the web server (do it every time you run InvokeAI):
198+
199+
```terminal
200+
invokeai --web
201+
```
202+
203+
8. Point your browser to http://localhost:9090 to bring up the web interface.
204+
9. Type `banana sushi` in the box on the top left and click `Invoke`.
205+
206+
Be sure to activate the virtual environment each time before re-launching InvokeAI,
207+
using `source .venv/bin/activate` or `.venv\Scripts\activate`.
208+
209+
## Detailed Installation Instructions
210+
211+
This fork is supported across Linux, Windows and Macintosh. Linux
212+
users can use either an Nvidia-based card (with CUDA support) or an
213+
AMD card (using the ROCm driver). For full installation and upgrade
214+
instructions, please see:
215+
[InvokeAI Installation Overview](https://invoke-ai.github.io/InvokeAI/installation/INSTALL_SOURCE/)
216+
217+
<a name="migrating-to-3"></a>
218+
### Migrating a v2.3 InvokeAI root directory
219+
220+
The InvokeAI root directory is where the InvokeAI startup file,
221+
installed models, and generated images are stored. It is ordinarily
222+
named `invokeai` and located in your home directory. The contents and
223+
layout of this directory has changed between versions 2.3 and 3.0 and
224+
cannot be used directly.
225+
226+
We currently recommend that you use the installer to create a new root
227+
directory named differently from the 2.3 one, e.g. `invokeai-3` and
228+
then use a migration script to copy your 2.3 models into the new
229+
location. However, if you choose, you can upgrade this directory in
230+
place. This section gives both recipes.
231+
232+
#### Creating a new root directory and migrating old models
233+
234+
This is the safer recipe because it leaves your old root directory in
235+
place to fall back on.
236+
237+
1. Follow the instructions above to create and install InvokeAI in a
238+
directory that has a different name from the 2.3 invokeai directory.
239+
In this example, we will use "invokeai-3"
240+
241+
2. When you are prompted to select models to install, select a minimal
242+
set of models, such as stable-diffusion-v1.5 only.
243+
244+
3. After installation is complete launch `invokeai.sh` (Linux/Mac) or
245+
`invokeai.bat` and select option 8 "Open the developers console". This
246+
will take you to the command line.
247+
248+
4. Issue the command `invokeai-migrate3 --from /path/to/v2.3-root --to
249+
/path/to/invokeai-3-root`. Provide the correct `--from` and `--to`
250+
paths for your v2.3 and v3.0 root directories respectively.
251+
252+
This will copy and convert your old models from 2.3 format to 3.0
253+
format and create a new `models` directory in the 3.0 directory. The
254+
old models directory (which contains the models selected at install
255+
time) will be renamed `models.orig` and can be deleted once you have
256+
confirmed that the migration was successful.
257+
258+
#### Migrating in place
259+
260+
For the adventurous, you may do an in-place upgrade from 2.3 to 3.0
261+
without touching the command line. The recipe is as follows>
262+
263+
1. Launch the InvokeAI launcher script in your current v2.3 root directory.
264+
265+
2. Select option [9] "Update InvokeAI" to bring up the updater dialog.
266+
267+
3a. During the alpha release phase, select option [3] and manually
268+
enter the tag name `v3.0.0+a2`.
269+
270+
3b. Once 3.0 is released, select option [1] to upgrade to the latest release.
271+
272+
4. Once the upgrade is finished you will be returned to the launcher
273+
menu. Select option [7] "Re-run the configure script to fix a broken
274+
install or to complete a major upgrade".
275+
276+
This will run the configure script against the v2.3 directory and
277+
update it to the 3.0 format. The following files will be replaced:
278+
279+
- The invokeai.init file, replaced by invokeai.yaml
280+
- The models directory
281+
- The configs/models.yaml model index
282+
283+
The original versions of these files will be saved with the suffix
284+
".orig" appended to the end. Once you have confirmed that the upgrade
285+
worked, you can safely remove these files. Alternatively you can
286+
restore a working v2.3 directory by removing the new files and
287+
restoring the ".orig" files' original names.
288+
289+
#### Migration Caveats
290+
291+
The migration script will migrate your invokeai settings and models,
292+
including textual inversion models, LoRAs and merges that you may have
293+
installed previously. However it does **not** migrate the generated
294+
images stored in your 2.3-format outputs directory. The released
295+
version of 3.0 is expected to have an interface for importing an
296+
entire directory of image files as a batch.
104297
105298
## Hardware Requirements
106299

installer/lib/installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def app_venv(self, path: str = None):
149149

150150
return venv_dir
151151

152-
def install(self, root: str = "~/invokeai", version: str = "latest", yes_to_all=False, find_links: Path = None) -> None:
152+
def install(self, root: str = "~/invokeai-3", version: str = "latest", yes_to_all=False, find_links: Path = None) -> None:
153153
"""
154154
Install the InvokeAI application into the given runtime path
155155

installer/templates/invoke.bat.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ echo 3. Run textual inversion training
1414
echo 4. Merge models (diffusers type only)
1515
echo 5. Download and install models
1616
echo 6. Change InvokeAI startup options
17-
echo 7. Re-run the configure script to fix a broken install
17+
echo 7. Re-run the configure script to fix a broken install or to complete a major upgrade
1818
echo 8. Open the developer console
1919
echo 9. Update InvokeAI
2020
echo 10. Command-line help

installer/templates/invoke.sh.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ do_choice() {
8181
;;
8282
7)
8383
clear
84-
printf "Re-run the configure script to fix a broken install\n"
84+
printf "Re-run the configure script to fix a broken install or to complete a major upgrade\n"
8585
invokeai-configure --root ${INVOKEAI_ROOT} --yes --default_only
8686
;;
8787
8)
@@ -118,12 +118,12 @@ do_choice() {
118118
do_dialog() {
119119
options=(
120120
1 "Generate images with a browser-based interface"
121-
2 "Generate images using a command-line interface"
121+
2 "Explore InvokeAI nodes using a command-line interface"
122122
3 "Textual inversion training"
123123
4 "Merge models (diffusers type only)"
124124
5 "Download and install models"
125125
6 "Change InvokeAI startup options"
126-
7 "Re-run the configure script to fix a broken install"
126+
7 "Re-run the configure script to fix a broken install or to complete a major upgrade"
127127
8 "Open the developer console"
128128
9 "Update InvokeAI")
129129

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from fastapi.routing import APIRouter
2+
from pydantic import BaseModel
3+
4+
from invokeai.version import __version__
5+
6+
app_router = APIRouter(prefix="/v1/app", tags=['app'])
7+
8+
9+
class AppVersion(BaseModel):
10+
"""App Version Response"""
11+
version: str
12+
13+
14+
@app_router.get('/version', operation_id="app_version",
15+
status_code=200,
16+
response_model=AppVersion)
17+
async def get_version() -> AppVersion:
18+
return AppVersion(version=__version__)

0 commit comments

Comments
 (0)