InvokeAI/invokeai/app
psychedelicious c5d1bd1360 feat(mm): use relative paths for invoke-managed models
We switched all model paths to be absolute in #5900. In hindsight, this is a mistake, because it makes the `models_dir` non-portable.

This change reverts to the previous model pathing:
- Invoke-managed models (in the `models_dir`) are stored with relative paths
- Non-invoke-managed models (outside the `models_dir`, i.e. in-place installed models) still have absolute paths.

## Why absolute paths make things non-portable

Let's say my `models_dir` is `/media/rhino/invokeai/models/`. In the DB, all model paths will be absolute children of this path, like this:

- `/media/rhino/invokeai/models/sd-1/main/model1.ckpt`

I want to change my `models_dir` to `/home/bat/invokeai/models/`. I update my `invokeai.yaml` file and physically move the files to that directory.

On startup, the app checks for missing models. Because all of my model paths were absolute, they now point to a nonexistent path. All models are broken.

There are a couple options to recover from this situation, neither of which are reasonable:

1. The user must manually update every model's path. Unacceptable UX.
2. On startup, we check for missing models. For each missing model, we compare its path with the last-known models dir. If there is a match, we replace that portion of the path with the new models dir. Then we re-check to see if the path exists. If it does, we update the models DB entry. Brittle and requires a new DB entry for last-known models dir.

It's better to use relative paths for Invoke-managed models.
2024-03-29 10:56:06 -04:00
..
api feat(mm): remove autoimport; revise startup model scanning 2024-03-28 12:35:41 +11:00
assets/images tweaks in response to psychedelicious review of PR 2023-07-26 15:27:04 +10:00
invocations fix(nodes): esrgan model name typo 2024-03-22 02:22:19 -07:00
services feat(mm): use relative paths for invoke-managed models 2024-03-29 10:56:06 -04:00
shared tidy(nodes): move all field things to fields.py 2024-03-01 10:42:33 +11:00
util feat(mm): move HF token helper to route 2024-03-20 15:05:25 +11:00
__init__.py fix: make invocation_context.py accessible to mkdocs 2024-03-01 10:42:33 +11:00
api_app.py Check for cuDNN version compatibility issues on startup. Prior to this check, the app would silently run with ~50% performance degradation caused by a cuDNN version mismatch. 2024-03-28 07:32:06 +11:00
run_app.py feat: single app entrypoint with CLI arg parsing 2024-03-19 09:24:28 +11:00