Damian Stewart
23eb80b404
attention maps callback stuff for diffusers
2022-12-14 21:04:55 +01:00
Kevin Turner
1f86e527aa
Merge branch 'main' into dev/diffusers
2022-12-14 08:25:03 -08:00
Ivan Efimov
ccf8a46320
Fix: define path as None before usage
2022-12-13 19:46:03 -05:00
rmagur1203
f4e7383490
Load model in inpaint when using free_gpu_mem option ( #1938 )
...
* Load model in inpaint when using free_gpu_mem option
* Passing free_gpu_mem option to inpaint generator
2022-12-12 09:14:30 -05:00
rmagur1203
96a12099ed
Fix the mistake of not importing the gc ( #1939 )
2022-12-12 09:14:09 -05:00
rmagur1203
bd0c0d77d2
Reduce more memories on free_gpu_mem option ( #1915 )
...
* Enhance free_gpu_mem option
Unload cond_stage_model on free_gpu_mem option is setted
* Enhance free_gpu_mem option
Unload cond_stage_model on free_gpu_mem option is setted
2022-12-11 13:49:55 -05:00
Kevin Turner
520c17ab86
diffusers(AddsMaskedGuidance): partial fix for k-schedulers
...
Prevents them from crashing, but results are still hot garbage.
2022-12-10 21:19:32 -08:00
Kevin Turner
cd358c40ad
diffusers: stopgap fix for attention_maps_callback crash after recent merge
2022-12-10 19:48:15 -08:00
Kevin Turner
061c5369a2
Merge remote-tracking branch 'origin/main' into dev/diffusers
2022-12-10 19:18:00 -08:00
Damian Stewart
8cbb50c204
avoid further crash under low-memory conditions
2022-12-10 15:32:11 -05:00
Kevin Turner
63532226a5
Merge remote-tracking branch 'origin/main' into dev/diffusers
...
# Conflicts:
# backend/invoke_ai_web_server.py
# ldm/generate.py
# ldm/invoke/CLI.py
# ldm/invoke/generator/base.py
# ldm/invoke/generator/txt2img.py
# ldm/models/diffusion/cross_attention_control.py
# ldm/modules/attention.py
2022-12-10 08:43:37 -08:00
Kevin Turner
50c48cffc7
diffusers: make masked img2img behave better with multi-step schedulers
...
re-randomizing the noise each step was confusing them.
2022-12-10 08:27:46 -08:00
Kevin Turner
1a67836012
diffusers: use xformers when available
...
diffusers no longer auto-enables this as of 0.10.2.
2022-12-10 08:26:24 -08:00
Damian Stewart
786b8878d6
Save and display per-token attention maps ( #1866 )
...
* attention maps saving to /tmp
* tidy up diffusers branch backporting of cross attention refactoring
* base64-encoding the attention maps image for generationResult
* cleanup/refactor conditioning.py
* attention maps and tokens being sent to web UI
* attention maps: restrict count to actual token count and improve robustness
* add argument type hint to image_to_dataURL function
Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
Co-authored-by: damian <git@damianstewart.com>
Co-authored-by: psychedelicious <4822129+psychedelicious@users.noreply.github.com>
2022-12-10 15:57:41 +01:00
Kevin Turner
a3e41d63ec
Merge remote-tracking branch 'origin/main' into dev/diffusers
...
# Conflicts:
# .github/workflows/test-invoke-conda.yml
# .github/workflows/test-invoke-pip.yml
# environments-and-requirements/requirements-base.txt
2022-12-09 10:34:29 -08:00
Jonathan
4e61069821
Update embiggen.py
2022-12-08 22:34:49 -05:00
Kevin Turner
9199d698f8
diffusers: upgrade to diffusers 0.10, add Heun scheduler
2022-12-08 13:02:47 -08:00
Kevin Turner
9bcb3b1bf7
fixup! refactor(diffusers): reduce some code duplication amongst the different tasks
2022-12-07 18:26:08 -08:00
Kevin Turner
821c7df240
refactor(diffusers): reduce some code duplication amongst the different tasks
2022-12-07 18:20:56 -08:00
Daya Adianto
d7ba041007
Enable force free GPU memory in img2img
2022-12-07 19:25:21 -05:00
Kevin Turner
04a5bc938e
diffusers: txt2img2img (hires_fix)
...
with so much slicing and dicing of pipeline methods to stitch them together
2022-12-06 22:28:09 -08:00
Kevin Turner
bf6376417a
diffusers: reset num_vectors_per_token
...
sync with 44a0055571
2022-12-06 15:52:49 -08:00
Kevin Turner
5c7e6751e0
inpainting for the normal model. I think it works this time.
2022-12-05 12:37:20 -08:00
Damian Stewart
69d42762de
refactor common CrossAttention stuff into a mixin so that the old ldm code can still work if necessary
2022-12-05 20:00:18 +01:00
Kevin Turner
f3570d8344
inpainting for the normal model [WIP]
...
This seems to be performing well until the LAST STEP, at which point it dissolves to confetti.
2022-12-04 23:36:12 -08:00
Kevin Turner
875312080d
diffusers support for the inpainting model
2022-12-04 20:12:04 -08:00
Damian Stewart
ff42027a00
add cross-attention control support to diffusers (fails on MPS)
...
For unknown reasons MPS produces garbage output with .swap(). Use
--always_use_cpu arg to invoke.py for now to test this code on MPS.
2022-12-04 16:07:54 +01:00
Damian Stewart
f48706efee
add always_use_cpu arg to bypass MPS
2022-12-04 15:15:39 +01:00
Damian Stewart
9ea10ece95
monkey-patch diffusers.attention and use Invoke lowvram code
2022-12-03 10:10:37 +01:00
Kevin Turner
9d7fe45702
Merge remote-tracking branch 'origin/main' into dev/diffusers
...
# Conflicts:
# scripts/configure_invokeai.py
2022-12-01 21:38:46 -08:00
Lincoln Stein
bde456f9fa
fix startup messages and a startup crash
...
- make the warnings about patchmatch less redundant
- only warn about being unable to load concepts from Hugging Face
library once
- do not crash when unable to load concepts from Hugging Face
due to network connectivity issues
2022-12-01 07:42:31 -05:00
Kevin Turner
ea1cf83c20
preliminary support for outpainting (no masking yet)
2022-11-30 22:05:58 -08:00
Kevin Turner
494936a8d2
🚧 post-rebase repair
2022-11-30 15:39:40 -08:00
Kevin Turner
7c558d5056
fix "config attributes…not expected" diffusers warnings.
2022-11-30 15:34:19 -08:00
Kevin Turner
8157bff4bc
internal: avoid importing diffusers DummyObject
...
see https://github.com/huggingface/diffusers/issues/1479
2022-11-30 15:34:19 -08:00
Kevin Turner
ca1f76b7ba
create an embedding_manager for diffusers
2022-11-30 15:34:19 -08:00
Kevin Turner
56153c2ebf
lint: correct annotations for Python 3.9.
2022-11-30 15:33:02 -08:00
Kevin Turner
b7864aa1a7
refactor: remove backported img2img.get_timesteps
...
now that we can use it directly from diffusers 0.8.1
2022-11-30 15:33:02 -08:00
Kevin Turner
ceb53ccdfb
dev: upgrade to diffusers 0.8 (from 0.7.1)
...
We get to remove some code by using methods that were factored out in the base class.
2022-11-30 15:33:02 -08:00
Kevin Turner
efbb807905
diffusers integration: support img2img
2022-11-30 15:33:02 -08:00
Kevin Turner
95db6e80ee
cross_attention_control: stub (no-op) implementations for diffusers
2022-11-30 15:01:27 -08:00
Kevin Turner
b6b1a8d97c
diffusers: use InvokeAIDiffuserComponent for conditioning
2022-11-30 15:01:18 -08:00
Kevin Turner
e99faeb8d7
diffusers: restore prompt weighting feature
2022-11-30 15:01:15 -08:00
Kevin Turner
05a1d68ef4
web server: update image_progress callback for diffusers data
2022-11-30 15:01:06 -08:00
Kevin Turner
1e98f4bafc
diffusers: let the scheduler do its scaling of the initial latents
...
Remove IPNDM scheduler; it is not behaving.
2022-11-30 15:01:06 -08:00
Kevin Turner
d55e22981a
txt2img: support switching diffusers schedulers
2022-11-30 15:01:06 -08:00
Kevin Turner
ae9b482acf
model_cache: fix model default image dimensions
2022-11-30 15:01:06 -08:00
Kevin Turner
4c3858e079
model_cache: add ability to load a diffusers model pipeline
...
and update associated things in Generate & Generator to not instantly fail when that happens
2022-11-30 15:00:59 -08:00
Kevin Turner
dcfdb83513
doc: type hints for Generator
2022-11-30 14:56:30 -08:00
Kevin Turner
58ea3bf4c8
spike: proof of concept using diffusers for txt2img
2022-11-30 14:56:26 -08:00