Commit Graph

1263 Commits

Author SHA1 Message Date
psychedelicious
b38080336d tidy(mm): remove ONNX from AnyModelConfig 2024-02-29 13:29:00 -05:00
psychedelicious
638322e89f fix(mm): fix ModelCacheBase method name 2024-02-29 13:29:00 -05:00
psychedelicious
bc7572797c chore: ruff 2024-02-29 13:29:00 -05:00
Lincoln Stein
2463710497 recover gracefuly from GPU out of memory errors (next version) 2024-02-29 13:29:00 -05:00
Lincoln Stein
3be3bba007 clear out VRAM when an OOM occurs 2024-02-29 13:29:00 -05:00
Brandon Rising
70570b7213 Allow passing in key on register 2024-02-29 13:28:21 -05:00
psychedelicious
a0a143f495 fix(nodes): make fields on ModelConfigBase required
The setup of `ModelConfigBase` means autogenerated types have critical fields flagged as nullable (like `key` and `base`). Need to manually flag them as required.
2024-02-29 13:28:21 -05:00
Lincoln Stein
adab454c51 several small model install enhancements
- Support extended HF repoid syntax in TUI. This allows
  installation of subfolders and safetensors files, as in
  `XpucT/Deliberate::Deliberate_v5.safetensors`

- Add `error` and `error_traceback` properties to the install
  job objects.

- Rename the `heuristic_import` route to `heuristic_install`.

- Fix the example `config` input in the `heuristic_install` route.
2024-02-29 13:28:21 -05:00
Lincoln Stein
3312dcc58f remove startup dependency on legacy models.yaml file 2024-02-29 13:28:21 -05:00
dunkeroni
dcca220885 feat(nodes): added gradient mask node 2024-02-29 13:28:21 -05:00
Lincoln Stein
75aa93fabb remove errant def that was crashing invokeai-configure 2024-02-29 13:28:20 -05:00
psychedelicious
4191ca1a46 final tidying before marking PR as ready for review
- Replace AnyModelLoader with ModelLoaderRegistry
- Fix type check errors in multiple files
- Remove apparently unneeded `get_model_config_enum()` method from model manager
- Remove last vestiges of old model manager
- Updated tests and documentation

resolve conflict with seamless.py
2024-02-29 13:28:20 -05:00
Lincoln Stein
ab46865e5b Tidy names and locations of modules
- Rename old "model_management" directory to "model_management_OLD" in order to catch
  dangling references to original model manager.
- Caught and fixed most dangling references (still checking)
- Rename lora, textual_inversion and model_patcher modules
- Introduce a RawModel base class to simplfy the Union returned by the
  model loaders.
- Tidy up the model manager 2-related tests. Add useful fixtures, and
  a finalizer to the queue and installer fixtures that will stop the
  services and release threads.
2024-02-29 13:28:20 -05:00
Lincoln Stein
3c1b0d01ac Fix issues identified during PR review by RyanjDick and brandonrising
- ModelMetadataStoreService is now injected into ModelRecordStoreService
  (these two services are really joined at the hip, and should someday be merged)
- ModelRecordStoreService is now injected into ModelManagerService
- Reduced timeout value for the various installer and download wait*() methods
- Introduced a Mock modelmanager for testing
- Removed bare print() statement with _logger in the install helper backend.
- Removed unused code from model loader init file
- Made `locker` a private variable in the `LoadedModel` object.
- Fixed up model merge frontend (will be deprecated anyway!)
2024-02-29 13:28:20 -05:00
Brandon Rising
7a36cd2832 Raise InvalidModelConfigException when unable to detect load class in ModelLoader 2024-02-29 13:16:37 -05:00
Brandon Rising
5728da5132 Update _get_hf_load_class to support clipvision models 2024-02-29 13:16:37 -05:00
Brandon Rising
aa5d124d70 References to context.services.model_manager.store.get_model can only accept keys, remove invalid assertion 2024-02-29 13:16:37 -05:00
Brandon Rising
5cc73ec5dd Remove references to model_records service, change submodel property on ModelInfo to submodel_type to support new params in model manager 2024-02-29 13:16:37 -05:00
Lincoln Stein
ad9f8542f2 improve swagger documentation 2024-02-29 13:16:37 -05:00
Lincoln Stein
1d95fe6116 fix a number of typechecking errors 2024-02-29 13:16:37 -05:00
Lincoln Stein
6e91d5baaf add route for model conversion from safetensors to diffusers
- Begin to add SwaggerUI documentation for AnyModelConfig and other
  discriminated Unions.
2024-02-29 13:16:37 -05:00
Lincoln Stein
93fb2d1a55 add a JIT download_and_cache() call to the model installer 2024-02-29 13:16:37 -05:00
Lincoln Stein
195768c9ee add back the heuristic_import() method and extend repo_ids to arbitrary file paths 2024-02-29 13:16:37 -05:00
Lincoln Stein
d56337f2d8 make model manager v2 ready for PR review
- Replace legacy model manager service with the v2 manager.

- Update invocations to use new load interface.

- Fixed many but not all type checking errors in the invocations. Most
  were unrelated to model manager

- Updated routes. All the new routes live under the route tag
  `model_manager_v2`. To avoid confusion with the old routes,
  they have the URL prefix `/api/v2/models`. The old routes
  have been de-registered.

- Added a pytest for the loader.

- Updated documentation in contributing/MODEL_MANAGER.md
2024-02-29 13:16:37 -05:00
Lincoln Stein
721ff58e44 consolidate model manager parts into a single class 2024-02-29 13:16:37 -05:00
Lincoln Stein
8f1b7355df probe for required encoder for IPAdapters and add to config 2024-02-29 13:16:37 -05:00
Lincoln Stein
dbd2f8dc5f fix invokeai_configure script to work with new mm; rename CLIs 2024-02-29 13:16:37 -05:00
Lincoln Stein
49df4fa120 BREAKING CHANGES: invocations now require model key, not base/type/name
- Implement new model loader and modify invocations and embeddings

- Finish implementation loaders for all models currently supported by
  InvokeAI.

- Move lora, textual_inversion, and model patching support into
  backend/embeddings.

- Restore support for model cache statistics collection (a little ugly,
  needs work).

- Fixed up invocations that load and patch models.

- Move seamless and silencewarnings utils into better location
2024-02-29 13:16:37 -05:00
Lincoln Stein
92843d55eb Multiple refinements on loaders:
- Cache stat collection enabled.
- Implemented ONNX loading.
- Add ability to specify the repo version variant in installer CLI.
- If caller asks for a repo version that doesn't exist, will fall back
  to empty version rather than raising an error.
2024-02-29 13:16:37 -05:00
Lincoln Stein
fdbd288956 added textual inversion and lora loaders 2024-02-29 13:16:36 -05:00
Lincoln Stein
c0dabb5255 loaders for main, controlnet, ip-adapter, clipvision and t2i 2024-02-29 13:16:36 -05:00
Lincoln Stein
e242fe41f2 model loading and conversion implemented for vaes 2024-02-29 13:16:36 -05:00
Lincoln Stein
231c12fd1e add ram cache module and support files 2024-02-29 13:16:36 -05:00
Lincoln Stein
66e2d1b346 add concept of repo variant 2024-02-29 13:16:36 -05:00
psychedelicious
5927ab9c36 chore(backend): rename ModelInfo -> LoadedModelInfo
We have two different classes named `ModelInfo` which might need to be used by API consumers. We need to export both but have to deal with this naming collision.

The `ModelInfo` I've renamed here is the one that is returned when a model is loaded. It's the object least likely to be used by API consumers.
2024-02-29 13:16:36 -05:00
psychedelicious
2d74a39810 feat(nodes): extract LATENT_SCALE_FACTOR to constants.py 2024-02-29 13:16:36 -05:00
psychedelicious
26b17d778d feat(nodes): move ConditioningFieldData to conditioning_data.py 2024-02-29 13:16:35 -05:00
blessedcoolant
ff9bd040cc possible fix: Seamless not working with Custom VAE's 2024-02-14 16:13:11 -05:00
Kent Keirsey
17d5f7bebd Critical Space Removal 2024-02-14 16:13:11 -05:00
Kent Keirsey
30dae0f5aa adding back skipped layer 2024-02-14 16:13:11 -05:00
psychedelicious
3339ad4df8 feat(nodes): seamless.py minor cleanup 2024-02-13 13:34:48 +11:00
Kent Keirsey
c3b2a8cb27 Quick Seamless Fixes 2024-02-13 13:34:48 +11:00
blessedcoolant
e82c21b5ba chore: rename DWPose to DW Openpose 2024-02-12 11:12:45 -05:00
blessedcoolant
f8e566d62a cleanup: unused util functions 2024-02-12 11:12:45 -05:00
blessedcoolant
f588b95c7f cleanup: remove unused code from the DWPose implementation 2024-02-12 11:12:45 -05:00
blessedcoolant
7d80261d47 chore: Add code attribution for the DWPoseDetector 2024-02-12 11:12:45 -05:00
blessedcoolant
67cbfeb33d feat: Add output image resizing for DWPose 2024-02-12 11:12:45 -05:00
blessedcoolant
675c73c94f fix: ruff lint errors 2024-02-12 11:12:45 -05:00
blessedcoolant
0a27b0379f feat: Initial implementation of DWPoseDetector 2024-02-12 11:12:45 -05:00
psychedelicious
c5f069a255 feat(backend): remove dependency on basicsr
`basicsr` has a hard dependency on torchvision <= 0.16 and is unmaintained. Extract the code we need from it and remove the dep.

Closes #5108
2024-02-11 08:34:54 +11:00