Commit Graph

875 Commits

Author SHA1 Message Date
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
44d36a0e0b fix(img2img): do not attempt to do a zero-step img2img when strength is low 2023-02-01 18:42:54 -08:00
abd972f099 Merge branch 'main' into feat/xformers-startup-message 2023-01-31 18:48:09 -08:00
8cdc65effc Merge branch 'main' into fix_2418_simplified 2023-01-31 17:45:54 -08:00
6fdc9ac224 re-enable INVOKE_MODEL_RECONFIGURE 2023-02-01 01:21:07 +01:00
e6d52d7ce6 Merge branch 'main' into fix_2418_simplified 2023-01-31 18:11:56 -05:00
56e2d22b6e Merge branch 'main' into feat/solid-infill 2023-01-31 18:02:17 -05:00
0066187651 Merge branch 'main' into feat/solid-infill 2023-01-31 17:53:09 -05:00
d3d24fa816 fill color is parameterized 2023-01-31 17:52:33 -05:00
4d58fed6b0 Merge branch 'main' into fix/inpainting-blank-slate 2023-01-31 11:04:56 -08:00
eed802f5d9 Merge branch 'main' into fix/hires_inpaint 2023-01-31 09:34:29 -08:00
fc8e3dbcd3 fix crash when editing name of model
- fixes a spurious "unknown model name" error when trying to edit the
  short name of an existing model.
- relaxes naming requirements to include the ':' and '/' characters
  in model names
2023-01-31 09:59:58 -05:00
b9cc56593e print status message at startup when xformers is available 2023-01-30 22:01:06 -05:00
5299324321 workaround for pytorch bug, fixes #2418 2023-01-30 18:45:53 +01:00
d044d4c577 rename override/restore methods to better reflect what they actually do 2023-01-30 16:23:44 +01:00
17d73d09c0 Revert "with diffusers cac, always run the original prompt on the first step"
This reverts commit 27ee939e4b.
2023-01-30 15:38:03 +01:00
478c379534 for cac make t_start=0.1 the default 2023-01-30 15:30:01 +01:00
c5c160a788 Merge branch 'diffusers_cross_attention_control_reimplementation' of github.com:damian0815/InvokeAI into diffusers_cross_attention_control_reimplementation 2023-01-30 14:51:06 +01:00
27ee939e4b with diffusers cac, always run the original prompt on the first step 2023-01-30 14:50:57 +01:00
5ce62e00c9 Merge branch 'main' into diffusers_cross_attention_control_reimplementation 2023-01-29 13:52:01 -06:00
5a8c28de97 Merge remote-tracking branch 'origin/main' into fix/hires_inpaint 2023-01-29 10:51:59 -08:00
07e03b31b7 Update --hires_fix (#2414)
* Update --hires_fix

Change `--hires_fix` to calculate initial width and height based on the model's resolution (if available) and with a minimum size.
2023-01-29 12:27:01 -06:00
b6d37a70ca fix(inpainting model): threshold mask to avoid gray blurry seam 2023-01-28 13:34:22 -08:00
71b6ddf5fb fix(inpainting model): blank areas to be repainted in the masked image
Otherwise the model seems too reluctant to change these areas, even though the mask channel should allow it to.
2023-01-28 11:10:32 -08:00
6556b200b5 remove experimental "blur" infill
It seems counterproductive for use with the inpainting model, and not especially useful otherwise.
2023-01-27 15:25:50 -08:00
d627cd1865 feat(inpaint): add simpler infill methods for use with inpainting model 2023-01-27 14:28:16 -08:00
09b6104bfd refactor(txt2img2img): factor out tensor shape 2023-01-27 12:04:12 -08:00
1bb5b4ab32 fix dimension errors when inpainting model is used with hires-fix 2023-01-27 11:52:05 -08:00
12a29bfbc0 Merge branch 'main' into install/change-script-locations 2023-01-26 17:10:33 -05:00
8e4c044ca2 clean up tab/cursor behavior in textual inversion txt gui 2023-01-26 15:18:28 -05:00
9dc3832b9b clean up merge_models 2023-01-26 15:10:16 -05:00
d3a469d136 fix location of textual_inversion script 2023-01-26 11:56:23 -05:00
cbd967cbc4 add documentation caveat about location of HF cached models 2023-01-26 11:48:03 -05:00
e090c0dc10 try without setting every time 2023-01-26 17:46:51 +01:00
c381788ab9 don't restore None 2023-01-26 17:44:27 +01:00
fb312f9ed3 use the correct value - whoops 2023-01-26 17:30:29 +01:00
729752620b trying out JPPhoto's patch on vast.ai 2023-01-26 17:27:33 +01:00
8ed8bf52d0 use 'auto' slice size 2023-01-26 17:04:22 +01:00
a49d546125 simplified code a bit 2023-01-26 09:46:34 -05:00
288e31fc60 remove dependency on original clipseg library
- This replaces the original clipseg library with the transformers
  version from HuggingFace.
- This should make it possible to register InvokeAI at PyPi and do
  a fully automated pip-based install.
- Minor regression: it is no longer possible to specify which device
  the clipseg model will be loaded into, and it will reside in CPU.
  However, performance is more than acceptable.
2023-01-26 09:35:16 -05:00
5e7ed964d2 wip updating docs 2023-01-25 23:49:38 +01:00
95d147c5df MPS support: negatory 2023-01-25 23:03:30 +01:00
41aed57449 wip tracking down MPS slicing support 2023-01-25 22:27:23 +01:00
34a3f4a820 cleanup 2023-01-25 21:47:17 +01:00
1f5ad1b05e sliced swap working 2023-01-25 21:38:27 +01:00
c52dd7e3f4 Merge branch 'diffusers_cross_attention_control_reimplementation' of github.com:damian0815/InvokeAI into diffusers_cross_attention_control_reimplementation 2023-01-25 14:51:15 +01:00
a4aea1540b more wip sliced attention (.swap doesn't work yet) 2023-01-25 14:51:08 +01:00
3c53b46a35 Merge branch 'main' into diffusers_cross_attention_control_reimplementation 2023-01-24 19:32:34 -08:00
61403fe306 fix second conflict in CLI.py 2023-01-24 14:21:21 -05:00
b2f288d6ec fix conflict in CLI.py 2023-01-24 14:20:40 -05:00