Commit Graph

2475 Commits

Author SHA1 Message Date
psychedelicious
88d02585e7 Limits history to 256 for each of undo and redo 2022-11-27 03:35:49 +13:00
psychedelicious
f82e82f1bb Debounce > 300ms 2022-11-27 03:35:49 +13:00
psychedelicious
317762861f Fixes invert mask 2022-11-27 03:35:49 +13:00
psychedelicious
3f1360368d Fixes undo/redo 2022-11-27 03:35:49 +13:00
psychedelicious
d5467e7db5 Attempts to fix redux-persist debounce patch 2022-11-27 03:35:49 +13:00
psychedelicious
9284983429 Updates package.json to use redux-persist patches 2022-11-27 03:35:49 +13:00
psychedelicious
bb79c78fe8 Fixes AttributeError: 'dict' object has no attribute 'invert_mask' 2022-11-27 03:35:49 +13:00
psychedelicious
e3735ebb45 Adds debouncing 2022-11-27 03:35:49 +13:00
psychedelicious
eb17dfdeaa Patches redux-persist and redux-deep-persist with debounced persists
Our app changes redux state very, very often. As our undo/redo history grows, the calls to persist state start to take in the 100ms range, due to a the deep cloning of the history. This causes very noticeable performance lag.

The deep cloning is required because we need to blacklist certain items in redux from being persisted (e.g. the app's connection status).

Debouncing the whole process of persistence is a simple and effective solution. Unfortunately, `redux-persist` dropped `debounce` between v4 and v5, replacing it with `throttle`. `throttle`, instead of delaying the expensive action until a period of X ms of inactivity, simply ensures the action is executed at least every X ms. Of course, this does not fix our performance issue. 

The patch is very simple. It adds a `debounce` argument - a number of milliseconds - and debounces `redux-persist`'s `update()` method (provided by `createPersistoid`) by that many ms.

Before this, I also tried writing a custom storage adapter for `redux-persist` to debounce the calls to `localStorage.setItem()`. While this worked and was far less invasive, it doesn't actually address the issue. It turns out `setItem()` is a very fast part of the process.

We use `redux-deep-persist` to simplify the `redux-persist` configuration, which can get complicated when you need to blacklist or whitelist deeply nested state. There is also a patch here for that library because it uses the same types as `redux-persist`.

Unfortunately, the last release of `redux-persist` used a package `flat-stream` which was malicious and has been removed from npm. The latest commits to `redux-persist` (about 1 year ago) do not build; we cannot use the master branch. And between the last release and last commit, the changes have all been breaking.

Patching this last release (about 3 years old at this point) directly is far simpler than attempting to fix the upstream library's master branch or figuring out an alternative to the malicious and now non-existent dependency.
2022-11-27 03:35:49 +13:00
psychedelicious
1114ac97e2 Fixes (?) spacebar issues 2022-11-27 03:35:49 +13:00
psychedelicious
c7ef41af54 Changes "Invert Mask" to "Preserve Masked Areas" 2022-11-27 03:35:49 +13:00
psychedelicious
7075a17091 Implements invert mask 2022-11-27 03:35:49 +13:00
blessedcoolant
7f0fb47cf3 Remove save button from Canvas Controls (cleanup) 2022-11-27 03:35:49 +13:00
blessedcoolant
775f032c56 Mask Brush Preview now always at 0.5 opacity
The new mask is only visible properly at max opacity but at max opacity the brush preview becomes fully opaque blocking the view. So the mask brush preview no remains at 0.5 no matter what the Brush opacity is.
2022-11-27 03:35:49 +13:00
blessedcoolant
5410d42da0 Disable stage info in Inpainting Tab 2022-11-27 03:35:49 +13:00
psychedelicious
e21e901fa2 Fixes inpainting + code cleanup 2022-11-27 03:35:49 +13:00
psychedelicious
00385240e7 Adds mask design file 2022-11-27 03:35:49 +13:00
psychedelicious
0a96d2a888 Fixes mask for FF 2022-11-27 03:35:49 +13:00
psychedelicious
016551e036 Fixes warning about NaN? 2022-11-27 03:35:49 +13:00
psychedelicious
b8bb46042c SVG mask 2022-11-27 03:35:49 +13:00
psychedelicious
b44e9c7752 Changes mask to diagonal line pattern 2022-11-27 03:35:49 +13:00
blessedcoolant
8ed10c732b Revert "Fix Inpainting Canvas Rendering"
This reverts commit 114a74982944fbcd0feb3ce79e81fade4d3da147.
2022-11-27 03:35:49 +13:00
blessedcoolant
82a53782d0 Fix Inpainting Canvas Rendering 2022-11-27 03:35:49 +13:00
psychedelicious
6adebf065f Fixes bad import 2022-11-27 03:35:49 +13:00
psychedelicious
83f369053f Fixes issue with intermediates size
Sorry @lstein !
2022-11-27 03:35:49 +13:00
blessedcoolant
77d3839860 Do not show progress images in the viewer 2022-11-27 03:35:49 +13:00
psychedelicious
c02a0da837 Builds fresh bundle 2022-11-27 03:35:49 +13:00
blessedcoolant
4f4c6bbe33 Fix delete hotkey not working 2022-11-27 03:35:49 +13:00
blessedcoolant
72ea5453ce Fix broken styling on the Clear Mask button 2022-11-27 03:35:49 +13:00
psychedelicious
458081f9c9 Builds fresh bundle 2022-11-27 03:35:49 +13:00
psychedelicious
d1fbe81a60 Pins react-hotkeys-hook to v4.0.2
See: https://github.com/JohannesKlauss/react-hotkeys-hook/issues/835
2022-11-27 03:35:49 +13:00
psychedelicious
6c7191712f Rebases against development 2022-11-27 03:35:49 +13:00
devops117
248068fe5d make the docstring more readable and improve the list_models logic
Signed-off-by: devops117 <55235206+devops117@users.noreply.github.com>
2022-11-26 08:49:41 -05:00
Lincoln Stein
fdf41cc739
Installer final tweaks (#1550)
This is the same as PR #1537 except that it removes a redundant
`scripts` argument from `setup.py` that appeared at some point.

I also had to unpin the github dependencies in `requirements.in` in
order to get conda CI tests to pass. However, dependencies are still
pinned in `requirements-base.txt` and the environment files, and install
itself is working. So I think we are good.
2022-11-25 11:24:30 -05:00
Lincoln Stein
e98068a546 unpinned clip, clipseg, gfpgan and k-diffusion
- conflicts with their counterparts in the environment files was
  causing the CI conda-based tests to fail.
- installer seems to work still
2022-11-25 04:49:41 +00:00
Lincoln Stein
b945ae4e01 two more fixups
1. removed redundant `data_files` argument from setup.py
2. upped requirement to Python >= 3.9. This is due to a feature
   used in `argparse` that is only available in 3.9 or higher.
2022-11-25 03:50:52 +00:00
Lincoln Stein
b23c471cf0
make mauwii code owner for docker build (#1549) 2022-11-25 04:46:10 +01:00
Lincoln Stein
964e584bd3 remove redundant scripts arg from setup.py 2022-11-25 03:03:24 +00:00
Lincoln Stein
461358bdde
Merge branch 'development' into feat-install-unify-setup-requirements-pip 2022-11-24 21:55:39 -05:00
Matthias Wild
2433cc344a
add test-invoke-pip.yml (#1521)
* add test-invoke-pip.yml

* update requirements-base.txt to fix tests

* install requirements-base.txt separate
since it requires to have torch already installed
also restore origin requirements-base.txt after suc. test in my fork

* restore origin requirements
add `basicsr>=1.4.2` to requirements-base.txt
remove second installation step

* re-add previously overseen req in lin-cuda

* fix typo in setup.py - `scripts/preload_models.py`

* use GFBGAN from branch `basicsr-1.4.2`

* remove `basicsr>=1.4.2` from base reqs

* add INVOKEAI_ROOT to env

* disable upgrade of `pip`, `setuptools` and `wheel`

* try to use a venv which should not contain `wheel`

* add relative path to pip command

* use `configure_invokeai.py --no-interactive --yes`

* set grpcio to `<1.51.0`

* revert changes to use venv

* remove `--prefer-binary`

* disable step to create models.yaml
since this will not be used anymore with new `configure_invokeai.py`

* use `pip install --no-binary=":all:"`

* another try to use venv

* try uninstalling wheel before installing reqs

* dont use requirements.txt as filename

* update cache-dependency-path

* add facexlib to requirements-base.txt

* first install requirements-base.txt

* first install `-e .`, then install requirements
I know that this is obviously the wrong order, but still have a feeling

* add facexlib to requirements.in

* remove `-e .` from reqs and install after reqs

* unpin torch and torchvision in requirements.in

* fix model dl path

* fix curl output path

* create directory before downloading model

* set INVOKEAI_ROOT_PATH
https://docs.github.com/en/actions/learn-github-actions/environment-variables#naming-conventions-for-environment-variables

* INVOKEAI_ROOT ${{ env.GITHUB_WORKSPACE }}/invokeai

* fix matrix stable-diffusion-model-dl-path

* fix INVOKEAI_ROOT

* fix INVOKEAI_ROOT

* add --root and --outdir to run-tests step

* create models.yaml from example

* fix scripts variable in setup.py
by removing unused scripts

* fix archive-results path

* fix workflow to reflect latest code changes

* fix copy paste error

* fix job name

* fix matrix.stable-diffusion-model

* restructure matrix

* fix `activate conda env` step

* update the environment yamls
use same 4 git packages as for pip

* rename job in test-invoke-conda

* add tqdm to environment-lin-amd.yml

* fix python commands in test-invoke-conda.yml

Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com>
2022-11-25 01:24:24 +01:00
Lincoln Stein
16df759499 fix non-interactive behavior of config_invokeai.py
This corrects behavior of --no-interactive, which was in fact
asking for interaction!

New behavior:

If you pass --no-interactive it will behave exactly as it did before
and completely skip the downloading of SD models.

If you pass --yes it will do almost the same, but download the
recommended models. The combination of the two arguments is the same
as --no-interactive.
2022-11-23 23:07:47 -05:00
Ben Alkov
5a1a36ec29 feat(install); unify setup.py, requirements.in, pip
This allows populating setup.py's 'install_requires' directly from 'requirements.in'

- setup.py:
  - read 'requirements.in' instead of 'requirements.txt'
  - add correct upstream pytorch repo to "dependency_links"
- requirements.in:
  - append "name @" to git packages
  - fix torch repo URL -> 'download.pytorch.org/whl/torch_stable.html'

Signed-off-by: Ben Alkov <ben.alkov@gmail.com>
2022-11-23 13:34:42 -05:00
Lincoln Stein
71c4f401b0 Merge branch 'fix-model-load-error-handling' of github.com:/invoke-ai/InvokeAI into fix-model-load-error-handling 2022-11-22 19:15:06 +00:00
Lincoln Stein
c59b9897d9 remove file that shouldn't have been in PR 2022-11-22 19:14:52 +00:00
Lincoln Stein
4cf1c856ed
Merge branch 'development' into fix-model-load-error-handling 2022-11-22 14:11:26 -05:00
David Burnett
a78a1020be grpcio 1.51.0 is broken on M1 Macs. limit it to last good version til fixed 2022-11-22 12:05:45 -05:00
Lincoln Stein
90cb7a6442 fix behavior when models.yaml missing entirely 2022-11-22 16:56:38 +00:00
Lincoln Stein
8f5cded86e fix regression in ldm.invoke.model_cache.list_models()
- this was introduced in PR #1525 and not caught during my
  code review
2022-11-22 16:46:26 +00:00
Lincoln Stein
02d02a86b1 gracefully handle broken or missing models at initial load time
- If initial model fails to load, invoke.py will inform the user that
  something is wrong with models.yaml or the models themselves and
  drop user into configure_invokeai.py to repair the problem.

- The model caching system will longer try to reload the current model
  if there is none.
2022-11-22 16:36:11 +00:00
Lincoln Stein
ba9c695463 Merge branch 'development' into fix-model-load-error-reporting 2022-11-22 16:24:00 +00:00