Commit Graph

3672 Commits

Author SHA1 Message Date
Lincoln Stein
6e7dbf99f3
Merge branch 'main' into bugfix/dreambooth_ema 2023-03-23 23:24:15 -04:00
Lincoln Stein
1ba1076888
Tidy up Tests and Provide Documentation (#2869)
Bit of basic housekeeping and documentation to explain to people how to
get local development environment running (including the tests).
2023-03-23 23:23:20 -04:00
Lincoln Stein
cafa108f69
Merge branch 'main' into tests 2023-03-23 23:22:27 -04:00
Lincoln Stein
d770b14358
[deps] upgrade compel for better .swap defaults and a bugfix (#3014) 2023-03-23 19:01:12 -04:00
Lincoln Stein
20414ba4ad
Merge branch 'main' into deps_upgrade_compel 2023-03-23 18:38:46 -04:00
Lincoln Stein
92721a1d45 do not reexport PipelineIntermediateState 2023-03-24 09:32:47 +11:00
Lincoln Stein
f329fddab9 make step_callback work again in generate() call
This PR fixes #2951 and restores the step_callback argument in the
refactored generate() method. Note that this issue states that
"something is still wrong because steps and step are zero." However,
I think this is confusion over the call signature of the callback, which
since the diffusers merge has been `callback(state:PipelineIntermediateState)`

This is the test script that I used to determine that `step` is being passed
correctly:

```

from pathlib import Path
from invokeai.backend import ModelManager, PipelineIntermediateState
from invokeai.backend.globals import global_config_dir
from invokeai.backend.generator import Txt2Img

def my_callback(state:PipelineIntermediateState, total_steps:int):
    print(f'callback(step={state.step}/{total_steps})')

def main():
    manager = ModelManager(Path(global_config_dir()) / "models.yaml")
    model = manager.get_model('stable-diffusion-1.5')
    print ('=== TXT2IMG TEST ===')
    steps=30
    output = next(Txt2Img(model).generate(prompt='banana sushi',
                                          iterations=None,
                                          steps=steps,
                                          step_callback=lambda x: my_callback(x,steps)
                                          )
                  )
    print(f'image={output.image}, seed={output.seed}, steps={output.params.steps}')

if __name__=='__main__':
    main()
```
2023-03-24 09:32:47 +11:00
Lincoln Stein
f2efde27f6
load embeddings after a ckpt legacy model is converted to diffusers (#3013)
This PR corrects a bug in which embeddings were not being applied when a
non-diffusers model was loaded.

- Fixes #2954
- Also improves diagnostic reporting during embedding loading.
2023-03-23 18:10:19 -04:00
Damian Stewart
02c58f22be upgrade compel for better .swap defaults and a bugfix 2023-03-23 22:34:54 +01:00
Lincoln Stein
f751dcd245 load embeddings after a ckpt legacy model is converted to diffusers
- Fixes #2954
- Also improves diagnostic reporting during embedding loading.
2023-03-23 15:21:58 -04:00
blessedcoolant
485f6e5954
Export more for header (#2996)
* export more items needed for dynamic header
* remove build mode that is no longer needed
2023-03-23 01:07:16 +13:00
Mary Hipp Rogers
1f6ce838ba
Merge branch 'main' into export-more-for-header 2023-03-22 07:49:15 -04:00
blessedcoolant
0dc5773849
[nodes] Update fastapi packages to latest (except FastAPI, which has an annotation bug in the newest version) (#3004) 2023-03-22 19:12:45 +13:00
Kyle Schouviller
bc347f749c [nodes] Update fastapi packages to latest (except FastAPI, which has an annotation bug in the newest version) 2023-03-21 19:45:17 -07:00
Mary Hipp Rogers
1b215059e7
Merge branch 'main' into export-more-for-header 2023-03-21 16:29:53 -04:00
Mary Hipp
db079a2733 remove unneeded build:package code 2023-03-21 10:29:27 -04:00
Mary Hipp
26f71d3536 change back 2023-03-21 10:28:29 -04:00
Mary Hipp
eb7ae2588c unused var 2023-03-21 10:21:58 -04:00
Mary Hipp
278c14ba2e try jsx.element 2023-03-21 10:18:38 -04:00
Mary Hipp
74e83dda54 update type 2023-03-21 10:10:48 -04:00
psychedelicious
1f0324102a chore(ui): build 2023-03-19 23:16:29 +11:00
psychedelicious
a782ad092d feat(ui): localise iaialertdialog defaults 2023-03-19 23:16:29 +11:00
psychedelicious
eae4eb419a fix(ui): popovers trigger on click (accessibility) 2023-03-19 23:16:29 +11:00
psychedelicious
fb7f38f46e fix(ui): make alertdialogs centered 2023-03-19 23:16:29 +11:00
psychedelicious
93d0cae455 fix(ui): fix alertdialogs closing immediately 2023-03-19 23:16:29 +11:00
psychedelicious
35f6b5d562 fix(ui): make invoketabs not lazy 2023-03-19 23:16:29 +11:00
blessedcoolant
2aefa06ef1 fix(ui): Clean up manual add forms 2023-03-19 23:16:29 +11:00
psychedelicious
5906888477 feat(ui): add current image loading fallback 2023-03-19 23:16:29 +11:00
psychedelicious
f22c7d0da6 feat(ui): add more w/h options 2023-03-19 23:16:29 +11:00
psychedelicious
93b38707b2 feat(ui): tidy up model manager styling
fixes #2970
2023-03-19 23:16:29 +11:00
blessedcoolant
6ecf53078f fix(ui): Misalignment of model search entries 2023-03-19 23:16:29 +11:00
blessedcoolant
7789e8319c
Fix some text and a link (#2910)
- Fix link to `070_INSTALL_XFORMERS.md`.
- Fix some spelling.
2023-03-19 05:55:18 +13:00
Lincoln Stein
7d7a28beb3
Merge branch 'main' into main-text-fixup-PR 2023-03-18 09:54:41 -07:00
psychedelicious
27a113d872
nodes: api fixes (#2959)
- 86932469e76f1315ee18bfa2fc52b588241dace1 add image_to_dataURL util
- 0c2611059711b45bb6142d30b1d1343ac24268f3 make fast latents method
static
- this method doesn't really need `self` and should be able to be called
without instantiating `Generator`
- 2360bfb6558ea511e9c9576f3d4b5535870d84b4 fix schema gen for
GraphExecutionState
- `GraphExecutionState` uses `default_factory` in its fields; the result
is the OpenAPI schema marks those fields as optional, which propagates
to the generated API client, which means we need a lot of unnecessary
type guards to use this data type. the [simple
fix](https://github.com/pydantic/pydantic/discussions/4577) is to add
config to explicitly say all class properties are required. looks this
this will be resolved in a future pydantic release
- 3cd7319cfdb0f07c6bb12d62d7d02efe1ab12675 fix step callback and fast
latent generation on nodes. have this working in UI. depends on the
small change in #2957
2023-03-16 20:24:28 +11:00
psychedelicious
67f8f222d9 fix(nodes): fix step_callback + fast latents generation
this depends on the small change in #2957
2023-03-16 20:03:08 +11:00
psychedelicious
5347c12fed fix(nodes): fix schema gen for GraphExecutionState 2023-03-16 20:03:08 +11:00
psychedelicious
b194180f76 feat(backend): make fast latents method static 2023-03-16 20:03:08 +11:00
psychedelicious
fb30b7d17a feat(backend): add image_to_dataURL util 2023-03-16 20:03:08 +11:00
blessedcoolant
c341dcaa3d
update compel to fix black screens and use new downweighting algorithm (#2961)
Update `compel` to 1.0.0.

This fixes #2832.

It also changes the way downweighting is applied. In particular,
downweighting should now be much better and more controllable.

From the [compel
changelog](https://github.com/damian0815/compel#changelog):

> Downweighting now works by applying an attention mask to remove the
downweighted tokens, rather than literally removing them from the
sequence. This behaviour is the default, but the old behaviour can be
re-enabled by passing `downweight_mode=DownweightMode.REMOVE` on init of
the `Compel` instance.
>
> Formerly, downweighting a token worked by both multiplying the
weighting of the token's embedding, and doing an inverse-weighted blend
with a copy of the token sequence that had the downweighted tokens
removed. The intuition is that as weight approaches zero, the tokens
being downweighted should be actually removed from the sequence.
However, removing the tokens resulted in the positioning of all
downstream tokens becoming messed up. The blend ended up blending a lot
more than just the tokens in question.
> 
> As of v1.0.0, taking advice from @keturn and @bonlime
(https://github.com/damian0815/compel/issues/7) the procedure is by
default different. Downweighting still involves a blend but what is
blended is a version of the token sequence with the downweighted tokens
masked out, rather than removed. This correctly preserves positioning
embeddings of the other tokens.
2023-03-16 17:49:47 +13:00
Damian Stewart
b695a2574b bump compel version 2023-03-16 01:55:39 +01:00
Damian Stewart
aa68a326c8 update compel 2023-03-15 23:05:55 +01:00
Mary Hipp
c2922d5991 add settingsmodal 2023-03-15 16:12:51 -04:00
Mary Hipp
85888030c3 more things needed for header 2023-03-15 14:38:22 -04:00
blessedcoolant
7cf59c1e60
Merge branch 'main' into main-text-fixup-PR 2023-03-16 04:43:22 +13:00
psychedelicious
9738b0ff69
[nodes] Add Edge data type (#2958)
Adds an `Edge` data type, replacing the current tuple used for edges.
2023-03-15 18:41:56 +11:00
Kyle Schouviller
3021c78390 [nodes] Add Edge data type 2023-03-14 23:09:30 -07:00
blessedcoolant
6eeaf8d9fb
Allow for dynamic header (#2955)
* Update root component to allow optional children that will render as
dynamic header of UI
* Export additional components (logo & themeChanger) for use in said
dynamic header (more to come here)
2023-03-15 07:41:24 +13:00
Mary Hipp
fa9afec0c2 fix npm deps 2023-03-14 14:15:03 -04:00
Mary Hipp
d6862bf8c1 fix npm deps 2023-03-14 14:14:16 -04:00
Mary Hipp
de01c38bbe fresh build 2023-03-14 14:11:42 -04:00