Commit Graph

121 Commits

Author SHA1 Message Date
Lincoln Stein
c2487e4330 Kohya lora models load but generate freezes 2023-03-30 07:38:39 -04:00
Jordan
d9c46277ea add peft setup (need to install huggingface/peft) 2023-02-25 20:21:20 -07:00
Jordan
523e44ccfe simplify manager 2023-02-24 01:32:09 -07:00
Jordan
4ce8b1ba21 setup cross conditioning for lora 2023-02-23 19:27:45 -07:00
Jordan
68a3132d81 move legacy lora manager to its own file 2023-02-23 17:41:20 -07:00
Jordan
b69f9d4af1 initial setup of cross attention 2023-02-23 17:30:34 -07:00
Jordan
6a1129ab64 switch all none diffusers stuff to legacy, and load through compel prompts 2023-02-23 16:48:33 -07:00
Jordan
f64a4db5fa setup legacy class to abstract hacky logic for none diffusers lora and format prompt for compel 2023-02-23 05:56:39 -07:00
Jordan
3f477da46c Merge branch 'add_lora_support' of https://github.com/jordanramstad/InvokeAI into add_lora_support 2023-02-23 01:45:34 -07:00
Jordan
71972c3709 re-enable load attn procs support (no multiplier) 2023-02-23 01:44:13 -07:00
Jordan
d4083221a6 Merge branch 'main' into add_lora_support 2023-02-22 13:28:04 -08:00
Jordan
5b4a241f5c Merge branch 'main' into add_lora_support 2023-02-21 20:38:33 -08:00
Jordan
cd333e414b move key converter to wrapper 2023-02-21 21:38:15 -07:00
Jordan
af3543a8c7 further cleanup and implement wrapper 2023-02-21 20:42:40 -07:00
Jonathan
a461875abd Merge branch 'main' into refactor_use_compel 2023-02-21 21:14:28 -06:00
Lincoln Stein
d41dcdfc46 move trigger_str registration into try block 2023-02-21 21:38:42 -05:00
Jordan
f70b7272f3 cleanup / concept of loading through diffusers 2023-02-21 19:33:39 -07:00
Lincoln Stein
5e41811fb5 move trigger text munging to upper level per review 2023-02-21 17:04:42 -05:00
Jordan
24d92979db fix typo 2023-02-21 02:08:02 -07:00
Jordan
c669336d6b Update lora_manager.py 2023-02-21 02:05:11 -07:00
Jordan
5529309e73 adjusting back to hooks, forcing to be last in execution 2023-02-21 01:34:06 -07:00
Jordan
49c0516602 change hook to override 2023-02-20 23:45:57 -07:00
Lincoln Stein
91f7abb398 replace repeated triggers with <filename> 2023-02-20 22:33:13 -05:00
Jordan
de89041779 optimize functions for unloading 2023-02-20 17:02:36 -07:00
Jordan
488326dd95 Merge branch 'add_lora_support' of https://github.com/jordanramstad/InvokeAI into add_lora_support 2023-02-20 16:50:16 -07:00
Jordan
c3edede73f add notes and adjust functions 2023-02-20 16:49:59 -07:00
Jordan
6e730bd654 Merge branch 'main' into add_lora_support 2023-02-20 15:34:52 -08:00
Jordan
884a5543c7 adjust loader to use a settings dict 2023-02-20 16:33:53 -07:00
Jordan
ac972ebbe3 update prompt setup so lora's can be loaded in other ways 2023-02-20 16:06:30 -07:00
Damian Stewart
6420b81a5d Merge remote-tracking branch 'upstream/main' into refactor_use_compel 2023-02-20 23:34:38 +01:00
Jordan
3c6c18b34c cleanup suggestions from neecap 2023-02-20 15:19:29 -07:00
Jordan
8f6e43d4a4 code cleanup 2023-02-20 14:06:58 -07:00
Lincoln Stein
1d9845557f reduced verbosity of embed loading messages 2023-02-20 15:18:55 -05:00
Lincoln Stein
0d22fd59ed restore ability of textual inversion manager to read .pt files
- Fixes longstanding bug in the token vector size code which caused
  .pt files to be assigned the wrong token vector length. These
  were then tossed out during directory scanning.
2023-02-20 14:34:14 -05:00
neecapp
e744774171 Rewrite lora manager with hooks 2023-02-20 13:49:16 -05:00
Jordan
096e1d3a5d start of rewrite for add / remove 2023-02-20 02:37:44 -07:00
Lincoln Stein
172ce3dc25 correctly detect when an embedding is incompatible with the current model
- Fixed the test for token length; tested on several .pt and .bin files
- Also added a __main__ entrypoint for CLI.py, to make pdb debugging a bit
  more convenient.
2023-02-19 22:30:57 -05:00
Jordan
82e4d5aed2 change to new method to load safetensors 2023-02-19 17:33:24 -07:00
Damian Stewart
ded3f13a33 move all prompting stuff to use compel 2023-02-19 20:42:29 +01:00
Jonathan
d3c1b747ee Fix behavior when encountering a bad embedding (#2721)
When encountering a bad embedding, InvokeAI was asking about reconfiguring models. This is because the embedding load error was never handled - it now is.
2023-02-19 14:04:59 +00:00
Jordan
afc8639c25 add pending support for safetensors with cloneofsimo/lora 2023-02-18 21:07:34 -07:00
Jordan
141be95c2c initial setup of lora support 2023-02-18 05:29:04 -07:00
Lincoln Stein
2fa14200aa Merge branch 'main' into api/add-trigger-string-retrieval 2023-02-16 22:12:39 -05:00
Kevin Turner
8a0d45ac5a new OffloadingDevice loads one model at a time, on demand (#2596)
* new OffloadingDevice loads one model at a time, on demand

* fixup! new OffloadingDevice loads one model at a time, on demand

* fix(prompt_to_embeddings): call the text encoder directly instead of its forward method

allowing any associated hooks to run with it.

* more attempts to get things on the right device from the offloader

* more attempts to get things on the right device from the offloader

* make offloading methods an explicit part of the pipeline interface

* inlining some calls where device is only used once

* ensure model group is ready after pipeline.to is called

* fixup! Strategize slicing based on free [V]RAM (#2572)

* doc(offloading): docstrings for offloading.ModelGroup

* doc(offloading): docstrings for offloading-related pipeline methods

* refactor(offloading): s/SimpleModelGroup/FullyLoadedModelGroup

* refactor(offloading): s/HotSeatModelGroup/LazilyLoadedModelGroup

to frame it is the same terms as "FullyLoadedModelGroup"

---------

Co-authored-by: Damian Stewart <null@damianstewart.com>
2023-02-16 23:48:27 +00:00
Lincoln Stein
e29399e032 don't even try to load incompatible embeddings 2023-02-13 17:00:52 -05:00
Lincoln Stein
bc18a94d8c add ability to retrieve current list of embedding trigger strings
This PR adds a new attributer to ldm.generate, `embedding_trigger_strings`:

```
gen = Generate(...)
strings = gen.embedding_trigger_strings
strings = gen.embedding_trigger_strings()
```

The trigger strings will change when the model is updated to show only
those strings which are compatible with the current
model. Dynamically-downloaded triggers from the HF Concepts Library
will only show up after they are used for the first time. However, the
full list of concepts available for download can be retrieved
programatically like this:

```
from ldm.invoke.concepts_lib import HuggingFAceConceptsLibrary
concepts = HuggingFaceConceptsLibrary()
trigger_strings = concepts.list_concepts()
```
2023-02-13 14:11:36 -05:00
Lincoln Stein
00839d02ab Merge branch 'main' into lstein-improve-ti-frontend 2023-01-24 11:53:03 -05:00
Kevin Turner
0d4e6cbff5 Merge branch 'main' into bugfix/embed-loading-messages 2023-01-23 00:12:33 -08:00
Kevin Turner
87f3da92e9 Merge branch 'main' into fix/sd2-padding-token 2023-01-21 13:11:02 -08:00
Damian Stewart
e94c8fa285 fix long prompt weighting bug in ckpt codepath 2023-01-21 12:08:21 +01:00