InvokeAI/ldm
Lincoln Stein fc3378bb74
Load legacy ckpt files as diffusers models (#2468)
* refactor ckpt_to_diffuser to allow converted pipeline to remain in memory

- This idea was introduced by Damian
- Note that although I attempted to use the updated HuggingFace module
  pipelines/stable_diffusion/convert_from_ckpt.py, it was unable to
  convert safetensors files for reasons I didn't dig into.
- Default is to extract EMA weights.

* add --ckpt_convert option to load legacy ckpt files as diffusers models

- not quite working - I'm getting artifacts and glitches in the
  converted diffuser models
- leave as draft for time being

* do not include safety checker in converted files

* add ability to control which vae is used

API now allows the caller to pass an external VAE model to the
checkpoint conversion process. In this way, if an external VAE is
specified in the checkpoint's config stanza, this VAE will be used
when constructing the diffusers model.

Tested with both regular and inpainting 1.X models.

Not tested with SD 2.X models!

---------

Co-authored-by: Jonathan <34005131+JPPhoto@users.noreply.github.com>
Co-authored-by: Damian Stewart <null@damianstewart.com>
2023-02-02 20:15:44 +00:00
..
data Textual Inversion for M1 2022-09-27 01:39:17 +02:00
invoke Load legacy ckpt files as diffusers models (#2468) 2023-02-02 20:15:44 +00:00
models rename override/restore methods to better reflect what they actually do 2023-01-30 16:23:44 +01:00
modules Merge branch 'main' into lstein-improve-ti-frontend 2023-01-24 11:53:03 -05:00
__init__.py Merge dev into main for 2.2.0 (#1642) 2022-11-30 16:12:23 -05:00
generate.py print status message at startup when xformers is available 2023-01-30 22:01:06 -05:00
lr_scheduler.py prettified all the code using "blue" at the urging of @tildebyte 2022-08-26 03:15:42 -04:00
simplet2i.py Squashed commit of the following: 2022-09-12 14:31:48 -04:00
util.py fix perlin noise and txt2img2img 2023-01-16 22:50:13 -05:00