Commit Graph

55 Commits

Author SHA1 Message Date
psychedelicious
8c15d14099 fix: use locale encoding
We have had a few bugs with v4 related to file encodings, especially on Windows.

Windows uses its own character encodings instead of `utf-8`, often `cp1252`. Some characters cannot be decoded using `utf-8`, causing `UnicodeDecodeError`.

There are a couple places where this can cause problems:
- In the installer bootstrap, we install or upgrade `pip` and decode the result, using `subprocess`.

  The input to this includes the user's home dir. In #6105, the user had one of the problematic characters in their username. `subprocess` attempts and fails to decode the username, which crashes the installer.

  To fix this, we need to use `locale.getpreferredencoding()` when executing the command.
- Similarly, in the model install service and config class, we attempt to load a yaml config file. If a problematic character is in the path to the file (which often includes the user's home dir), we can get the same error.

  One example is  #6129 in which the models.yaml migration fails.

  To fix this, we need to open the file with `locale.getpreferredencoding()`.
2024-04-04 15:30:47 +11:00
psychedelicious
52b58b4a80 feat(installer): remove extra GPU options
- Remove `CUDA_AND_DML`. This was for onnx, which we have since removed.
- Remove `AUTODETECT`. This option causes problems for windows users, as it falls back on default pypi index resulting in a non-CUDA torch being installed.
- Add more explicit settings for extra index URL, based on the torch website
- Fix bug where `xformers` wasn't installed on linux and/or windows when autodetect was selected
2024-04-04 08:43:17 +11:00
psychedelicious
53c19ae937 chore: ruff 2024-03-28 14:24:03 +11:00
psychedelicious
b41422fa1a fix(installer): restore install successful message 2024-03-28 14:18:09 +11:00
psychedelicious
56af97866e docs(installer): update docstrings for install methods 2024-03-26 14:48:29 +11:00
psychedelicious
44626c9452 tidy(installer): remove no-op --version CLI arg of installer
This wasn't used at all.
2024-03-26 14:48:29 +11:00
psychedelicious
dfc08bd964 feat(installer): add support for installing from wheel
This allows us to easily test the installer without needing the desired version to be published on PyPI:
```sh
python3 installer/lib/main.py --wheel installer/dist/InvokeAI-4.0.0rc6-py3-none-any.whl
```

A warning message and confirmation are displayed when the arg is used.

The rest of the installer is unchanged.
2024-03-26 14:48:29 +11:00
psychedelicious
eb2a1993f1 fix(installer): resolve all typing issues 2024-03-26 14:48:29 +11:00
psychedelicious
f592ad3649 fix(installer): remove configure flow from installer 2024-03-20 05:48:02 -07:00
Eugene Brodsky
3d1b5c57ea fix(installer): more reliably upgrade pip 2024-02-07 14:31:26 -05:00
Eugene Brodsky
6a8a3b50bc feat(installer): add an interactive version chooser 2024-02-07 14:31:26 -05:00
Eugene Brodsky
5a816818dc feat(installer): get list of (pre-)releases from github api 2024-02-07 14:31:26 -05:00
Eugene Brodsky
29bcc4b595 fix(installer) slightly better typing for GPU selection 2024-02-07 14:31:26 -05:00
Eugene Brodsky
ca2bb6f0cc fix(installer): bubble up exceptions during install 2024-02-07 14:31:26 -05:00
Eugene Brodsky
1c8fc908b2 fix(installer): minor logic fixes 2024-02-07 14:31:26 -05:00
Eugene Brodsky
d397beaa47 fix(installer): upgrade the temporary pip before installation 2024-02-07 14:31:26 -05:00
Eugene Brodsky
60eea09629 feat(installer): *always* force-reinstall
This has repeatedly shown itself useful in fixing install issues,
especially regarding pytorch CPU/GPU version, so there is little
downside to making this the default.

Performance impact of this should be negligible. Packages will
be reinstalled from pip cache if possible, and downloaded only if
necessary. Impact may be felt on slower disks.
2024-02-07 14:31:26 -05:00
Eugene Brodsky
5b7b1122cb tidy(installer): clean up unused code 2024-02-07 14:31:26 -05:00
Eugene Brodsky
03b1cde97d tidy(installer): remove unused update scripts and references thereto 2024-02-07 14:31:26 -05:00
Eugene Brodsky
7162ff04df tidy(installer): do not preinstall torch separately 2024-02-07 14:31:26 -05:00
Eugene Brodsky
32b1e974ca feat(installer): install from PyPi instead of using prepackaged wheel 2024-02-07 14:31:26 -05:00
Eugene Brodsky
82c3c7fc38 tidy(installer): remove unused experimental venv location 2024-02-07 14:31:26 -05:00
Eugene Brodsky
3dcbb79ef7 chore(installer): typing pass 2024-02-07 14:31:26 -05:00
Eugene Brodsky
02bcff29e8 feat: update ROCm to 5.6 everywhere 2024-02-01 00:07:16 -05:00
psychedelicious
3a9201bd31 feat: pin deps
Organise deps into ~3 categories:
- Core generation dependencies, pinned for reproducible builds.
- Core application dependencies, pinned for reproducible builds.
- Auxiliary dependencies, pinned only if necessary.

I pinned / bumped these to latest:
- `controlnet_aux`
- `fastapi`
- `fastapi-events`
- `huggingface-hub`
- `numpy`
- `python-socketio`
- `torchmetrics`
- `transformers`
- `uvicorn`

I checked the release notes for these and didn't see any breaking changes that would affect us. There is a `fastapi` breaking change in v108 related to background tasks but it doesn't affect us.

I tested on a fresh venv. The app still works and I can generate on macOS.

Hopefully, enforcing explicit pinned versions will reduce the issues where people get CPU torch.

It also means we should periodically bump versions up to ensure we don't get too far behind on our dependencies and have to do painful upgrades.
2024-01-10 00:03:29 -05:00
Wubbbi
f51bb00b5e
Update torch xformers (#5343)
* Update torch to 2.1.2 and xformers to 0.0.23post1

* fix type
2023-12-26 06:48:32 +00:00
Wubbbi
340957f920 Update torch to 2.1.1 and xformers to 0.0.23 2023-12-13 14:49:32 -05:00
Millun Atluri
43d5bb2038 Updated JS files 2023-11-17 13:36:50 +11:00
Millun Atluri
0e5c3a641a Revert torch to use cu121 2023-11-13 20:28:00 -05:00
Wubbbi
fface2cda7 Update torch to ~2.1.0 in the installer 2023-11-13 17:30:51 +01:00
Millun Atluri
cbc905a4d6
Update installer.py to use cu118 instead of 121 2023-11-11 10:36:07 +11:00
Millun Atluri
9976bc6908 Update installer.py to cu121 2023-11-06 17:17:03 -08:00
Lincoln Stein
9542883bb5 update requirements to python 3.10-11 2023-10-17 19:30:31 +11:00
Lincoln Stein
d59e534cad use heuristic to select RAM cache size during headless install; blackified 2023-09-26 08:03:34 -04:00
Lincoln Stein
0c97a1e7e7 give user option to disable the configure TUI during installation 2023-09-26 08:03:34 -04:00
Martin Kristiansen
537ae2f901 Resolving merge conflicts for flake8 2023-08-18 15:52:04 +10:00
Lincoln Stein
f851ad7ba0 Two changes to command-line scripts
- installer - use correct entry point for invokeai-configure
- model merge script - prevent error when `--root` not provided
2023-08-10 20:59:22 -04:00
Lincoln Stein
7bad9bcf53 update dependencies and docs to cu118 2023-08-10 15:19:12 -04:00
Brandon Rising
f5ac73b091 Merge branch 'main' into feat/onnx 2023-07-31 10:58:40 -04:00
Lincoln Stein
03594c949a blackified 2023-07-30 10:18:39 -04:00
Lincoln Stein
adb85036e6 dependency tweaks to avoid installing/uninstalling pkgs 2023-07-30 10:17:04 -04:00
Lincoln Stein
b10b07220e blackify code 2023-07-29 19:20:20 -04:00
Lincoln Stein
c2eb50d1cd make installer use initial INVOKEAI_ROOT as default install location 2023-07-29 19:19:42 -04:00
Lincoln Stein
781322a647 installer respects INVOKEAI_ROOT for default root location 2023-07-29 16:16:44 -04:00
Brandon Rising
1bbf2f269d Update installer 2023-07-28 21:02:48 -04:00
Martin Kristiansen
218b6d0546 Apply black 2023-07-27 10:54:01 -04:00
Lincoln Stein
af239fa122
installer installs torchimetrics 0.11.4 (#3733)
* fix the test of the config system

* Add torchmetrics==0.11.4 to installer

- Closes #3700
- Closes #3658

---------

Co-authored-by: Lincoln Stein <lstein@gmail.com>
Co-authored-by: Eugene Brodsky <ebr@users.noreply.github.com>
2023-07-11 22:15:46 -04:00
Lincoln Stein
fe5e0b103f update README; chnage default root directory to invokeai-3 2023-06-28 17:47:04 -04:00
Lincoln Stein
8f80ba9520 update dependencies to get deterministic image generation 2023-05-06 23:09:24 -04:00
creachec
ee86eedf01
Right link on pytorch installer for linux rocm
Right link on pytorch installer for linux rocm
2023-03-31 17:22:00 -03:00