-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mm): restore relative paths for invoke-managed models #6087
Commits on Mar 29, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 26472f9 - Browse repository at this point
Copy the full SHA 26472f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9aacd86 - Browse repository at this point
Copy the full SHA 9aacd86View commit details -
fix(mm): handle relative conversion config paths
I have tested main, controlnet and vae checkpoint conversions.
Configuration menu - View commit details
-
Copy full SHA for 62b1ada - Browse repository at this point
Copy the full SHA 62b1adaView commit details -
Configuration menu - View commit details
-
Copy full SHA for bd6f26c - Browse repository at this point
Copy the full SHA bd6f26cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 18daed4 - Browse repository at this point
Copy the full SHA 18daed4View commit details -
feat(mm): update v3 models.yaml migration logic to handle relative pa…
…ths for legacy config files
Configuration menu - View commit details
-
Copy full SHA for 3609e27 - Browse repository at this point
Copy the full SHA 3609e27View commit details -
migrate legacy conf files that were incorrectly relative to root
Lincoln Stein committedMar 29, 2024 Configuration menu - View commit details
-
Copy full SHA for ece1b6d - Browse repository at this point
Copy the full SHA ece1b6dView commit details -
use is_relative_to() rather than relying on string matching to determ…
…ine relative directory positioning
Lincoln Stein committedMar 29, 2024 Configuration menu - View commit details
-
Copy full SHA for 76cecb2 - Browse repository at this point
Copy the full SHA 76cecb2View commit details