From 64339af2dcda21aa79843f7f1bf5d1ede9d52406 Mon Sep 17 00:00:00 2001 From: Damian Stewart Date: Wed, 14 Dec 2022 22:03:21 +0100 Subject: [PATCH 01/26] restrict to 75 tokens and correctly handle blends --- ldm/invoke/conditioning.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ldm/invoke/conditioning.py b/ldm/invoke/conditioning.py index aba329ccde..cf6e84ec60 100644 --- a/ldm/invoke/conditioning.py +++ b/ldm/invoke/conditioning.py @@ -36,13 +36,16 @@ Union[FlattenedPrompt, Blend], FlattenedPrompt): return prompt, negative_prompt -def get_tokens_for_prompt(model, parsed_prompt: FlattenedPrompt) -> [str]: +def get_tokens_for_prompt(model, parsed_prompt: FlattenedPrompt, truncate_if_too_long=True) -> [str]: text_fragments = [x.text if type(x) is Fragment else (" ".join([f.text for f in x.original]) if type(x) is CrossAttentionControlSubstitute else str(x)) for x in parsed_prompt.children] text = " ".join(text_fragments) tokens = model.cond_stage_model.tokenizer.tokenize(text) + if truncate_if_too_long: + max_tokens_length = model.cond_stage_model.max_length - 2 # typically 75 + tokens = tokens[0:max_tokens_length] return tokens @@ -116,8 +119,12 @@ def _get_conditioning_for_prompt(parsed_prompt: Union[Blend, FlattenedPrompt], p ">> Hybrid conditioning cannot currently be combined with cross attention control. Cross attention control will be ignored.") cac_args = None - eos_token_index = 1 - if type(parsed_prompt) is not Blend: + if type(parsed_prompt) is Blend: + blend: Blend = parsed_prompt + all_token_sequences = [get_tokens_for_prompt(model, p) for p in blend.prompts] + longest_token_sequence = max(all_token_sequences, key=lambda t: len(t)) + eos_token_index = len(longest_token_sequence)+1 + else: tokens = get_tokens_for_prompt(model, parsed_prompt) eos_token_index = len(tokens)+1 return ( From d94f955d9dded3d7957851114c13782465e96202 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Mon, 12 Dec 2022 17:51:35 -0500 Subject: [PATCH 02/26] fix manual install documentation --- docs/installation/INSTALL_MANUAL.md | 362 ++++++++++++++++++++-------- 1 file changed, 256 insertions(+), 106 deletions(-) diff --git a/docs/installation/INSTALL_MANUAL.md b/docs/installation/INSTALL_MANUAL.md index d94c441776..6f15cd8906 100644 --- a/docs/installation/INSTALL_MANUAL.md +++ b/docs/installation/INSTALL_MANUAL.md @@ -12,16 +12,203 @@ title: Manual Installation ## Introduction -You have two choices for manual installation, the [first one](#Conda_method) -based on the Anaconda3 package manager (`conda`), and -[a second one](#PIP_method) which uses basic Python virtual environment (`venv`) -commands and the PIP package manager. Both methods require you to enter commands -on the terminal, also known as the "console". +You have two choices for manual installation, the [first +one](#PIP_method) uses basic Python virtual environment (`venv`) +commands and the PIP package manager. The [second one](#Conda_method) +based on the Anaconda3 package manager (`conda`). Both methods require +you to enter commands on the terminal, also known as the "console". + +Note that the conda install method is currently deprecated and will not +be supported at some point in the future. On Windows systems you are encouraged to install and use the [Powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3), -which provides compatibility with Linux and Mac shells and nice features such as -command-line completion. +which provides compatibility with Linux and Mac shells and nice +features such as command-line completion. + +## pip Install + +To install InvokeAI with virtual environments and the PIP package +manager, please follow these steps: + +1. Make sure you are using Python 3.9 or 3.10. The rest of the install + procedure depends on this: + + ```bash + python -V + ``` + +2. From within the InvokeAI top-level directory, create and activate a virtual + environment named `invokeai`: + + ```bash + python -mvenv invokeai + source invokeai/bin/activate + ``` + +3. Make sure that pip is installed in your virtual environment an up to date: + + ```bash + python -mensurepip --upgrade + python -mpip install --upgrade pip + ``` + +4. Pick the correct `requirements*.txt` file for your hardware and operating + system. + + We have created a series of environment files suited for different operating + systems and GPU hardware. They are located in the + `environments-and-requirements` directory: + +
+ + | filename | OS | + | :---------------------------------: | :-------------------------------------------------------------: | + | requirements-lin-amd.txt | Linux with an AMD (ROCm) GPU | + | requirements-lin-arm64.txt | Linux running on arm64 systems | + | requirements-lin-cuda.txt | Linux with an NVIDIA (CUDA) GPU | + | requirements-mac-mps-cpu.txt | Macintoshes with MPS acceleration | + | requirements-lin-win-colab-cuda.txt | Windows with an NVIDA (CUDA) GPU
(supports Google Colab too) | + +
+ + Select the appropriate requirements file, and make a link to it from + `requirements.txt` in the top-level InvokeAI directory. The command to do + this from the top-level directory is: + + !!! example "" + + === "Macintosh and Linux" + + !!! info "Replace `xxx` and `yyy` with the appropriate OS and GPU codes." + + ```bash + ln -sf environments-and-requirements/requirements-xxx-yyy.txt requirements.txt + ``` + + === "Windows" + + !!! info "on Windows, admin privileges are required to make links, so we use the copy command instead" + + ```cmd + copy environments-and-requirements\requirements-lin-win-colab-cuda.txt requirements.txt + ``` + + !!! warning + + Please do not link or copy `environments-and-requirements/requirements-base.txt`. + This is a base requirements file that does not have the platform-specific + libraries. Also, be sure to link or copy the platform-specific file to + a top-level file named `requirements.txt` as shown here. Running pip on + a requirements file in a subdirectory will not work as expected. + + When this is done, confirm that a file named `requirements.txt` has been + created in the InvokeAI root directory and that it points to the correct + file in `environments-and-requirements`. + +5. Run PIP + + Be sure that the `invokeai` environment is active before doing this: + + ```bash + pip install --prefer-binary -r requirements.txt + ``` + +6. Set up the runtime directory + + In this step you will initialize a runtime directory that will + contain the models, model config files, directory for textual + inversion embeddings, and your outputs. This keeps the runtime + directory separate from the source code and aids in updating. + + You may pick any location for this directory using the `--root_dir` + option (abbreviated --root). If you don't pass this option, it will + default to `invokeai` in your home directory. + + ```bash + configure_invokeai.py --root_dir ~/Programs/invokeai + ``` + + The script `configure_invokeai.py` will interactively guide you through the + process of downloading and installing the weights files needed for InvokeAI. + Note that the main Stable Diffusion weights file is protected by a license + agreement that you have to agree to. The script will list the steps you need + to take to create an account on the site that hosts the weights files, + accept the agreement, and provide an access token that allows InvokeAI to + legally download and install the weights files. + + If you get an error message about a module not being installed, check that + the `invokeai` environment is active and if not, repeat step 5. + + Note that `configure_invokeai.py` and `invoke.py` should be installed + under your virtual environment directory and the system should find them + on the PATH. If this isn't working on your system, you can call the + scripts directory using `python scripts/configure_invoke.py` and + `python scripts/invoke.py`. + + !!! tip + + If you have already downloaded the weights file(s) for another Stable + Diffusion distribution, you may skip this step (by selecting "skip" when + prompted) and configure InvokeAI to use the previously-downloaded files. The + process for this is described in [here](INSTALLING_MODELS.md). + +7. Run the command-line- or the web- interface: + + Activate the environment (with `source invokeai/bin/activate`), and then + run the script `invoke.py`. If you selected a non-default location + for the runtime directory, please specify the path with the `--root_dir` + option (abbreviated below as `--root`): + + !!! example "" + + !!! warning "Make sure that the virtual environment is activated, which should create `(invokeai)` in front of your prompt!" + + === "CLI" + + ```bash + invoke.py --root ~/Programs/invokeai + ``` + + === "local Webserver" + + ```bash + invoke.py --web --root ~/Programs/invokeai + ``` + + === "Public Webserver" + + ```bash + invoke.py --web --host 0.0.0.0 --root ~/Programs/invokeai + ``` + + If you choose the run the web interface, point your browser at + http://localhost:9090 in order to load the GUI. + + !!! tip + + You can permanently set the location of the runtime directory by setting the environment variable INVOKEAI_ROOT to the path of the directory. + +8. Render away! + + Browse the [features](../features/CLI.md) section to learn about all the things you + can do with InvokeAI. + + Note that some GPUs are slow to warm up. In particular, when using an AMD + card with the ROCm driver, you may have to wait for over a minute the first + time you try to generate an image. Fortunately, after the warm up period + rendering will be fast. + +9. Subsequently, to relaunch the script, be sure to run "conda activate + invokeai", enter the `InvokeAI` directory, and then launch the invoke + script. If you forget to activate the 'invokeai' environment, the script + will fail with multiple `ModuleNotFound` errors. + + !!! tip + + Do not move the source code repository after installation. The virtual environment directory has absolute paths in it that get confused if the directory is moved. + +--- ### Conda method @@ -145,17 +332,19 @@ command-line completion. Your command-line prompt should change to indicate that `invokeai` is active by prepending `(invokeai)`. -8. Pre-Load the model weights files: +8. Set up the runtime directory - !!! tip + In this step you will initialize a runtime directory that will + contain the models, model config files, directory for textual + inversion embeddings, and your outputs. This keeps the runtime + directory separate from the source code and aids in updating. - If you have already downloaded the weights file(s) for another Stable - Diffusion distribution, you may skip this step (by selecting "skip" when - prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [here](INSTALLING_MODELS.md). + You may pick any location for this directory using the `--root_dir` + option (abbreviated --root). If you don't pass this option, it will + default to `invokeai` in your home directory. ```bash - python scripts/configure_invokeai.py + python scripts/configure_invokeai.py --root_dir ~/Programs/invokeai ``` The script `configure_invokeai.py` will interactively guide you through the @@ -169,8 +358,26 @@ command-line completion. If you get an error message about a module not being installed, check that the `invokeai` environment is active and if not, repeat step 5. + Note that `configure_invokeai.py` and `invoke.py` should be + installed under your conda directory and the system should find + them automatically on the PATH. If this isn't working on your + system, you can call the scripts directory using `python + scripts/configure_invoke.py` and `python scripts/invoke.py`. + + !!! tip + + If you have already downloaded the weights file(s) for another Stable + Diffusion distribution, you may skip this step (by selecting "skip" when + prompted) and configure InvokeAI to use the previously-downloaded files. The + process for this is described in [here](INSTALLING_MODELS.md). + 9. Run the command-line- or the web- interface: + Activate the environment (with `source invokeai/bin/activate`), and then + run the script `invoke.py`. If you selected a non-default location + for the runtime directory, please specify the path with the `--root_dir` + option (abbreviated below as `--root`): + !!! example "" !!! warning "Make sure that the conda environment is activated, which should create `(invokeai)` in front of your prompt!" @@ -178,24 +385,28 @@ command-line completion. === "CLI" ```bash - python scripts/invoke.py + invoke.py --root ~/Programs/invokeai ``` === "local Webserver" ```bash - python scripts/invoke.py --web + invoke.py --web --root ~/Programs/invokeai ``` === "Public Webserver" ```bash - python scripts/invoke.py --web --host 0.0.0.0 + invoke.py --web --host 0.0.0.0 --root ~/Programs/invokeai ``` If you choose the run the web interface, point your browser at http://localhost:9090 in order to load the GUI. + !!! tip + + You can permanently set the location of the runtime directory by setting the environment variable INVOKEAI_ROOT to the path of your choice. + 10. Render away! Browse the [features](../features/CLI.md) section to learn about all the things you @@ -211,6 +422,34 @@ command-line completion. script. If you forget to activate the 'invokeai' environment, the script will fail with multiple `ModuleNotFound` errors. +## Creating an "install" version of InvokeAI + +If you wish you can install InvokeAI and all its dependencies in the +runtime directory. This allows you to delete the source code +repository and eliminates the need to provide `--root_dir` at startup +time. Note that this method only works with the PIP method. + +1. Follow the instructions for the PIP install, but in step #2 put the + virtual environment into the runtime directory. For example, assuming the + runtime directory lives in `~/Programs/invokeai`, you'd run: + + ```bash + python -menv ~/Programs/invokeai + ``` + +2. Now follow steps 3 to 5 in the PIP recipe, ending with the `pip install` + step. + +3. Run one additional step while you are in the source code repository + directory `pip install .` (note the dot at the end). + +4. That's all! Now, whenever you activate the virtual environment, + `invoke.py` will know where to look for the runtime directory without + needing a `--root_dir` argument. In addition, you can now move or + delete the source code repository entirely. + + (Don't move the runtime directory!) + ## Updating to newer versions of the script This distribution is changing rapidly. If you used the `git clone` method @@ -228,95 +467,6 @@ be needed to take advantage of new features or released models. The `--no-interactive` flag will prevent the script from prompting you to download the big Stable Diffusion weights files. -## pip Install - -To install InvokeAI with only the PIP package manager, please follow these -steps: - -1. Make sure you are using Python 3.9 or higher. The rest of the install - procedure depends on this: - - ```bash - python -V - ``` - -2. Install the `virtualenv` tool if you don't have it already: - - ```bash - pip install virtualenv - ``` - -3. From within the InvokeAI top-level directory, create and activate a virtual - environment named `invokeai`: - - ```bash - virtualenv invokeai - source invokeai/bin/activate - ``` - -4. Pick the correct `requirements*.txt` file for your hardware and operating - system. - - We have created a series of environment files suited for different operating - systems and GPU hardware. They are located in the - `environments-and-requirements` directory: - -
- - | filename | OS | - | :---------------------------------: | :-------------------------------------------------------------: | - | requirements-lin-amd.txt | Linux with an AMD (ROCm) GPU | - | requirements-lin-arm64.txt | Linux running on arm64 systems | - | requirements-lin-cuda.txt | Linux with an NVIDIA (CUDA) GPU | - | requirements-mac-mps-cpu.txt | Macintoshes with MPS acceleration | - | requirements-lin-win-colab-cuda.txt | Windows with an NVIDA (CUDA) GPU
(supports Google Colab too) | - -
- - Select the appropriate requirements file, and make a link to it from - `requirements.txt` in the top-level InvokeAI directory. The command to do - this from the top-level directory is: - - !!! example "" - - === "Macintosh and Linux" - - !!! info "Replace `xxx` and `yyy` with the appropriate OS and GPU codes." - - ```bash - ln -sf environments-and-requirements/requirements-xxx-yyy.txt requirements.txt - ``` - - === "Windows" - - !!! info "on Windows, admin privileges are required to make links, so we use the copy command instead" - - ```cmd - copy environments-and-requirements\requirements-lin-win-colab-cuda.txt requirements.txt - ``` - - !!! warning - - Please do not link or copy `environments-and-requirements/requirements-base.txt`. - This is a base requirements file that does not have the platform-specific - libraries. Also, be sure to link or copy the platform-specific file to - a top-level file named `requirements.txt` as shown here. Running pip on - a requirements file in a subdirectory will not work as expected. - - When this is done, confirm that a file named `requirements.txt` has been - created in the InvokeAI root directory and that it points to the correct - file in `environments-and-requirements`. - -5. Run PIP - - Be sure that the `invokeai` environment is active before doing this: - - ```bash - pip install --prefer-binary -r requirements.txt - ``` - ---- - ## Troubleshooting Here are some common issues and their suggested solutions. From 89880e1f72f1297039eec4ca1b06905ebc045918 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Tue, 13 Dec 2022 03:58:28 +0000 Subject: [PATCH 03/26] affirm that work with the webGUI --- docs/features/CONCEPTS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/features/CONCEPTS.md b/docs/features/CONCEPTS.md index ebb0a59706..8d4493deac 100644 --- a/docs/features/CONCEPTS.md +++ b/docs/features/CONCEPTS.md @@ -77,8 +77,8 @@ the file for malicious code. Should any errors occur, you will be warned and the concept will fail to load. Generation will then continue treating the trigger term as a normal string of characters (e.g. as literal "<ghibli-face>"). -Currently auto-installation of concepts is a feature only available on the -command-line client. Support for the WebUI is a work in progress. +You can also use in the WebGUI's prompt textbox. There +is no autocompletion at this time. ## Installing your Own TI Files From 652aaa809ba64afec47c9f4b9f4e26734dff8b0e Mon Sep 17 00:00:00 2001 From: mauwii Date: Tue, 13 Dec 2022 10:57:17 +0100 Subject: [PATCH 04/26] add missed backticks and some icons for tab also puth the alf screenshot in a table to fit the other examples --- docs/features/CONCEPTS.md | 41 +++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/docs/features/CONCEPTS.md b/docs/features/CONCEPTS.md index 8d4493deac..f92e52f9e0 100644 --- a/docs/features/CONCEPTS.md +++ b/docs/features/CONCEPTS.md @@ -37,8 +37,9 @@ generated using the command-line client and the Stable Diffusion 1.5 model: You can also combine styles and concepts:
- ![](../assets/concepts/image5.png) -
A portrait of <alf> in <cartoona-animal> style
+ | A portrait of <alf> in <cartoona-animal> style | + | :--------------------------------------------------------: | + | ![](../assets/concepts/image5.png) |
## Using a Hugging Face Concept @@ -49,24 +50,26 @@ find out what each concept is for, you can browse the look at examples of what each concept produces. When you have an idea of a concept you wish to try, go to the command-line -client (CLI) and type a "<" character and the beginning of the Hugging Face -concept name you wish to load. Press the Tab key, and the CLI will show you all -matching concepts. You can also type "<" and Tab to get a listing of all ~800 -concepts, but be prepared to scroll up to see them all! If there is more than -one match you can continue to type and Tab until the concept is completed. +client (CLI) and type a `<` character and the beginning of the Hugging Face +concept name you wish to load. Press ++tab++, and the CLI will show you all +matching concepts. You can also type `<` and hit ++tab++ to get a listing of all +~800 concepts, but be prepared to scroll up to see them all! If there is more +than one match you can continue to type and ++tab++ until the concept is +completed. -For example if you type "<x" and Tab, you'll be prompted with the -completions: +!!! example -``` - -``` + if you type in ` + ``` -Finish your prompt and generate as usual. You may include multiple concept terms -in the prompt. + Now type `id` and press ++tab++. It will be autocompleted to `` + because this is a unique match. + + Finish your prompt and generate as usual. You may include multiple concept terms + in the prompt. If you have never used this concept before, you will see a message that the TI model is being downloaded and installed. After this, the concept will be saved @@ -75,10 +78,10 @@ locally (in the `models/sd-concepts-library` directory) for future use. Several steps happen during downloading and installation, including a scan of the file for malicious code. Should any errors occur, you will be warned and the concept will fail to load. Generation will then continue treating the trigger -term as a normal string of characters (e.g. as literal "<ghibli-face>"). +term as a normal string of characters (e.g. as literal ``). -You can also use in the WebGUI's prompt textbox. There -is no autocompletion at this time. +You can also use `` in the WebGUI's prompt textbox. There is no +autocompletion at this time. ## Installing your Own TI Files From 834e56a51398c7fac17d40009c65221684e0c462 Mon Sep 17 00:00:00 2001 From: Kent Keirsey <31807370+hipsterusername@users.noreply.github.com> Date: Tue, 13 Dec 2022 21:54:31 -0500 Subject: [PATCH 05/26] update Contributors directive to merge to main --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index f0522755ca..f6ce709e49 100644 --- a/README.md +++ b/README.md @@ -167,10 +167,7 @@ To join, just raise your hand on the InvokeAI Discord server (#dev-chat) or the If you are unfamiliar with how to contribute to GitHub projects, here is a -[Getting Started Guide](https://opensource.com/article/19/7/create-pull-request-github). A full set of contribution guidelines, along with templates, are in progress, but for now the most -important thing is to **make your pull request against the "development" branch**, and not against -"main". This will help keep public breakage to a minimum and will allow you to propose more radical -changes. +[Getting Started Guide](https://opensource.com/article/19/7/create-pull-request-github). A full set of contribution guidelines, along with templates, are in progress. You can **make your pull request against the "main" branch**. We hope you enjoy using our software as much as we enjoy creating it, and we hope that some of those of you who are reading this will elect From 6c015eedb3708758f934308f479dea22798fefdd Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 15 Dec 2022 09:34:10 -0500 Subject: [PATCH 06/26] better error reporting when root directory not found (#2001) - The invoke.py script now checks that the root (runtime) directory contains the expected config/models.yaml file and if it doesn't exits with a helpful error message about how to set the proper root. - Formerly the script would fail with a "bad model" message and try to redownload its models, which is not helpful in the case that the root is missing or damaged. --- ldm/invoke/CLI.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ldm/invoke/CLI.py b/ldm/invoke/CLI.py index b5e32d7222..565f21e389 100644 --- a/ldm/invoke/CLI.py +++ b/ldm/invoke/CLI.py @@ -45,9 +45,15 @@ def main(): print('--max_loaded_models must be >= 1; using 1') args.max_loaded_models = 1 - # alert - setting globals here + # alert - setting a global here Globals.try_patchmatch = args.patchmatch + if not os.path.exists(os.path.join(Globals.root,'configs','models.yaml')): + print(f"\n** Error. The file {os.path.join(Globals.root,'configs','models.yaml')} could not be found.") + print(f'** Please check the location of your invokeai directory and use the --root_dir option to point to the correct path.') + print(f'** This script will now exit.') + sys.exit(-1) + print(f'>> InvokeAI runtime directory is "{Globals.root}"') # loading here to avoid long delays on startup From f39cb668fc3f9d1ba25c46951c264d49768e0024 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 14 Dec 2022 21:08:14 +0000 Subject: [PATCH 07/26] update requirements and environment files - Update pypatchmatch to 0.1.5 (see request from @Kyle0654 here https://discord.com/channels/1020123559063990373/1034740515209486387/1052465462757310464 ) - Removed basicsrs workaround for environment files, now that we know problem was caused by Windows long path issue. --- environments-and-requirements/environment-lin-aarch64.yml | 4 ++-- environments-and-requirements/environment-lin-amd.yml | 4 ++-- environments-and-requirements/environment-lin-cuda.yml | 4 ++-- environments-and-requirements/environment-mac.yml | 6 +++--- environments-and-requirements/environment-win-cuda.yml | 4 ++-- environments-and-requirements/requirements-base.txt | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/environments-and-requirements/environment-lin-aarch64.yml b/environments-and-requirements/environment-lin-aarch64.yml index 5f71828453..1baf45f2ed 100644 --- a/environments-and-requirements/environment-lin-aarch64.yml +++ b/environments-and-requirements/environment-lin-aarch64.yml @@ -32,6 +32,7 @@ dependencies: - pip: - dependency_injector==4.40.0 - getpass_asterisk + - gfpgan==1.3.8 - omegaconf==2.1.1 - picklescan - pyreadline3 @@ -41,6 +42,5 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg - - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch + - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-lin-amd.yml b/environments-and-requirements/environment-lin-amd.yml index d9badf3455..2e3e5f257a 100644 --- a/environments-and-requirements/environment-lin-amd.yml +++ b/environments-and-requirements/environment-lin-amd.yml @@ -18,6 +18,7 @@ dependencies: - flask_cors==3.0.10 - flask_socketio==5.3.0 - getpass_asterisk + - gfpgan==1.3.8 - imageio-ffmpeg==0.4.2 - imageio==2.9.0 - kornia==0.6.0 @@ -43,6 +44,5 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg - - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch + - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-lin-cuda.yml b/environments-and-requirements/environment-lin-cuda.yml index a938dc7b6f..38fb3e727a 100644 --- a/environments-and-requirements/environment-lin-cuda.yml +++ b/environments-and-requirements/environment-lin-cuda.yml @@ -21,6 +21,7 @@ dependencies: - flask_cors==3.0.10 - flask_socketio==5.3.0 - getpass_asterisk + - gfpgan==1.3.8 - imageio-ffmpeg==0.4.2 - imageio==2.9.0 - kornia==0.6.0 @@ -42,6 +43,5 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg - - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch + - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-mac.yml b/environments-and-requirements/environment-mac.yml index f2b598920b..116ec7a5ce 100644 --- a/environments-and-requirements/environment-mac.yml +++ b/environments-and-requirements/environment-mac.yml @@ -25,10 +25,11 @@ dependencies: - diffusers=0.6 - einops=0.3 - eventlet - - grpcio=1.46 - flask=2.1 - flask-socketio=5.3 - flask-cors=3.0 + - gfpgan==1.3.8 + - grpcio=1.46 - humanfriendly=10.0 - imageio=2.21 - imageio-ffmpeg=0.4 @@ -58,8 +59,7 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg - - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch + - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . variables: PYTORCH_ENABLE_MPS_FALLBACK: 1 diff --git a/environments-and-requirements/environment-win-cuda.yml b/environments-and-requirements/environment-win-cuda.yml index 52b92e1d00..3bdf94a4f5 100644 --- a/environments-and-requirements/environment-win-cuda.yml +++ b/environments-and-requirements/environment-win-cuda.yml @@ -21,6 +21,7 @@ dependencies: - flask_cors==3.0.10 - flask_socketio==5.3.0 - getpass_asterisk + - gfpgan==1.3.8 - imageio-ffmpeg==0.4.2 - imageio==2.9.0 - kornia==0.6.0 @@ -42,6 +43,5 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg - - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.1#egg=gfpgan - - git+https://github.com/invoke-ai/PyPatchMatch@0.1.4#egg=pypatchmatch + - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/requirements-base.txt b/environments-and-requirements/requirements-base.txt index 1301f72323..1d8d722d5e 100644 --- a/environments-and-requirements/requirements-base.txt +++ b/environments-and-requirements/requirements-base.txt @@ -35,6 +35,6 @@ torch-fidelity torchmetrics transformers==4.25.* https://github.com/Birch-san/k-diffusion/archive/refs/heads/mps.zip#egg=k-diffusion -https://github.com/invoke-ai/PyPatchMatch/archive/refs/tags/0.1.4.zip#egg=pypatchmatch +https://github.com/invoke-ai/PyPatchMatch/archive/refs/tags/0.1.5.zip#egg=pypatchmatch https://github.com/openai/CLIP/archive/eaa22acb90a5876642d0507623e859909230a52d.zip#egg=clip https://github.com/invoke-ai/clipseg/archive/relaxed-python-requirement.zip#egg=clipseg From b8e1151a9cf7cc496f8c22905fd2ae570d036b19 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Wed, 14 Dec 2022 21:27:39 +0000 Subject: [PATCH 08/26] change pypatchmatch only --- environments-and-requirements/environment-lin-aarch64.yml | 2 +- environments-and-requirements/environment-lin-amd.yml | 2 +- environments-and-requirements/environment-lin-cuda.yml | 2 +- environments-and-requirements/environment-mac.yml | 4 ++-- environments-and-requirements/environment-win-cuda.yml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/environments-and-requirements/environment-lin-aarch64.yml b/environments-and-requirements/environment-lin-aarch64.yml index 1baf45f2ed..4f37fe7acd 100644 --- a/environments-and-requirements/environment-lin-aarch64.yml +++ b/environments-and-requirements/environment-lin-aarch64.yml @@ -32,7 +32,6 @@ dependencies: - pip: - dependency_injector==4.40.0 - getpass_asterisk - - gfpgan==1.3.8 - omegaconf==2.1.1 - picklescan - pyreadline3 @@ -42,5 +41,6 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg + - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-lin-amd.yml b/environments-and-requirements/environment-lin-amd.yml index 2e3e5f257a..d893baad27 100644 --- a/environments-and-requirements/environment-lin-amd.yml +++ b/environments-and-requirements/environment-lin-amd.yml @@ -18,7 +18,6 @@ dependencies: - flask_cors==3.0.10 - flask_socketio==5.3.0 - getpass_asterisk - - gfpgan==1.3.8 - imageio-ffmpeg==0.4.2 - imageio==2.9.0 - kornia==0.6.0 @@ -44,5 +43,6 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg + - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-lin-cuda.yml b/environments-and-requirements/environment-lin-cuda.yml index 38fb3e727a..3ef150ba00 100644 --- a/environments-and-requirements/environment-lin-cuda.yml +++ b/environments-and-requirements/environment-lin-cuda.yml @@ -21,7 +21,6 @@ dependencies: - flask_cors==3.0.10 - flask_socketio==5.3.0 - getpass_asterisk - - gfpgan==1.3.8 - imageio-ffmpeg==0.4.2 - imageio==2.9.0 - kornia==0.6.0 @@ -43,5 +42,6 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg + - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . diff --git a/environments-and-requirements/environment-mac.yml b/environments-and-requirements/environment-mac.yml index 116ec7a5ce..3e78d9ac95 100644 --- a/environments-and-requirements/environment-mac.yml +++ b/environments-and-requirements/environment-mac.yml @@ -25,11 +25,10 @@ dependencies: - diffusers=0.6 - einops=0.3 - eventlet + - grpcio=1.46 - flask=2.1 - flask-socketio=5.3 - flask-cors=3.0 - - gfpgan==1.3.8 - - grpcio=1.46 - humanfriendly=10.0 - imageio=2.21 - imageio-ffmpeg=0.4 @@ -59,6 +58,7 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k-diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg + - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.2#egg=gfpgan - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . variables: diff --git a/environments-and-requirements/environment-win-cuda.yml b/environments-and-requirements/environment-win-cuda.yml index 3bdf94a4f5..4e05db6d35 100644 --- a/environments-and-requirements/environment-win-cuda.yml +++ b/environments-and-requirements/environment-win-cuda.yml @@ -21,7 +21,6 @@ dependencies: - flask_cors==3.0.10 - flask_socketio==5.3.0 - getpass_asterisk - - gfpgan==1.3.8 - imageio-ffmpeg==0.4.2 - imageio==2.9.0 - kornia==0.6.0 @@ -43,5 +42,6 @@ dependencies: - git+https://github.com/openai/CLIP.git@main#egg=clip - git+https://github.com/Birch-san/k-diffusion.git@mps#egg=k_diffusion - git+https://github.com/invoke-ai/clipseg.git@relaxed-python-requirement#egg=clipseg + - git+https://github.com/invoke-ai/GFPGAN@basicsr-1.4.1#egg=gfpgan - git+https://github.com/invoke-ai/PyPatchMatch@0.1.5#egg=pypatchmatch - -e . From 7a4e647287b06f36561636ea385e7a2131004d23 Mon Sep 17 00:00:00 2001 From: Kevin Turner <83819+keturn@users.noreply.github.com> Date: Thu, 15 Dec 2022 11:30:58 -0800 Subject: [PATCH 09/26] build: GitHub Action to lint python files with pyflakes (#1332) --- .github/workflows/pyflakes.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/pyflakes.yml diff --git a/.github/workflows/pyflakes.yml b/.github/workflows/pyflakes.yml new file mode 100644 index 0000000000..fcf8103d46 --- /dev/null +++ b/.github/workflows/pyflakes.yml @@ -0,0 +1,19 @@ +on: + pull_request: + push: + branches: + - main + - development + - 'release-candidate-*' + +jobs: + pyflakes: + name: runner / pyflakes + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: pyflakes + uses: reviewdog/action-pyflakes@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-review From 2a2f38a016f383e8be94b0ba2d35e8ad33300d00 Mon Sep 17 00:00:00 2001 From: wfng92 <43742196+wfng92@users.noreply.github.com> Date: Fri, 16 Dec 2022 04:59:19 +0800 Subject: [PATCH 10/26] Correct timestep for img2img initial noise addition (#1946) * Correct timestep for img2img initial noise addition * apply fix to inpaint and txt2img2img as well Co-authored-by: Lincoln Stein --- ldm/invoke/generator/img2img.py | 2 +- ldm/invoke/generator/inpaint.py | 2 +- ldm/invoke/generator/txt2img2img.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ldm/invoke/generator/img2img.py b/ldm/invoke/generator/img2img.py index f188d9b23d..1881d847d8 100644 --- a/ldm/invoke/generator/img2img.py +++ b/ldm/invoke/generator/img2img.py @@ -45,7 +45,7 @@ class Img2Img(Generator): # encode (scaled latent) z_enc = sampler.stochastic_encode( self.init_latent, - torch.tensor([t_enc]).to(self.model.device), + torch.tensor([t_enc - 1]).to(self.model.device), noise=x_T ) diff --git a/ldm/invoke/generator/inpaint.py b/ldm/invoke/generator/inpaint.py index b86e21efe6..a2613f48ea 100644 --- a/ldm/invoke/generator/inpaint.py +++ b/ldm/invoke/generator/inpaint.py @@ -279,7 +279,7 @@ class Inpaint(Img2Img): # encode (scaled latent) z_enc = sampler.stochastic_encode( self.init_latent, - torch.tensor([t_enc]).to(self.model.device), + torch.tensor([t_enc - 1]).to(self.model.device), noise=x_T ) diff --git a/ldm/invoke/generator/txt2img2img.py b/ldm/invoke/generator/txt2img2img.py index b8d0f81322..a1ebf423b9 100644 --- a/ldm/invoke/generator/txt2img2img.py +++ b/ldm/invoke/generator/txt2img2img.py @@ -84,7 +84,7 @@ class Txt2Img2Img(Generator): z_enc = ddim_sampler.stochastic_encode( samples, - torch.tensor([t_enc]).to(self.model.device), + torch.tensor([t_enc-1]).to(self.model.device), noise=self.get_noise(width,height,False) ) From 392c0725f36446594dae9e6fcb6b60dbb96e2ad0 Mon Sep 17 00:00:00 2001 From: Kaspar Emanuel Date: Wed, 14 Dec 2022 22:34:25 +0000 Subject: [PATCH 11/26] Remove circular dependencies in frontend --- frontend/package.json | 13 + frontend/src/app/invokeai.d.ts | 3 +- frontend/src/app/socketio/actions.ts | 2 +- frontend/src/app/socketio/emitters.ts | 4 +- frontend/src/app/socketio/listeners.ts | 2 +- frontend/src/app/store.ts | 6 - frontend/src/app/storeHooks.ts | 6 + .../src/common/components/GuidePopover.tsx | 2 +- .../src/common/components/ImageUploader.tsx | 2 +- .../src/common/util/parameterTranslation.ts | 7 +- .../ClearCanvasHistoryButtonModal.tsx | 2 +- .../features/canvas/components/IAICanvas.tsx | 2 +- .../IAICanvasBoundingBoxOverlay.tsx | 2 +- .../canvas/components/IAICanvasGrid.tsx | 2 +- .../components/IAICanvasIntermediateImage.tsx | 3 +- .../components/IAICanvasMaskCompositer.tsx | 2 +- .../canvas/components/IAICanvasMaskLines.tsx | 2 +- .../components/IAICanvasObjectRenderer.tsx | 2 +- .../canvas/components/IAICanvasResizer.tsx | 2 +- .../components/IAICanvasStagingArea.tsx | 2 +- .../IAICanvasStagingAreaToolbar.tsx | 2 +- .../canvas/components/IAICanvasStatusText.tsx | 2 +- .../IAICanvasStatusTextCursorPos.tsx | 2 +- .../components/IAICanvasToolPreview.tsx | 2 +- .../IAICanvasToolbar/IAICanvasBoundingBox.tsx | 2 +- .../IAICanvasToolbar/IAICanvasMaskOptions.tsx | 2 +- .../IAICanvasToolbar/IAICanvasRedoButton.tsx | 2 +- .../IAICanvasSettingsButtonPopover.tsx | 2 +- .../IAICanvasToolChooserOptions.tsx | 2 +- .../IAICanvasToolbar/IAICanvasToolbar.tsx | 2 +- .../IAICanvasToolbar/IAICanvasUndoButton.tsx | 2 +- .../canvas/hooks/useCanvasDragMove.ts | 2 +- .../features/canvas/hooks/useCanvasHotkeys.ts | 2 +- .../canvas/hooks/useCanvasMouseDown.ts | 2 +- .../canvas/hooks/useCanvasMouseMove.ts | 2 +- .../canvas/hooks/useCanvasMouseOut.ts | 2 +- .../features/canvas/hooks/useCanvasMouseUp.ts | 2 +- .../features/canvas/hooks/useCanvasZoom.ts | 2 +- .../canvas/hooks/useColorUnderCursor.ts | 2 +- .../components/CurrentImageButtons.tsx | 2 +- .../components/CurrentImageDisplay.tsx | 3 +- .../components/CurrentImagePreview.tsx | 3 +- .../gallery/components/DeleteImageModal.tsx | 12 +- .../gallery/components/HoverableImage.tsx | 2 +- .../gallery/components/ImageGallery.tsx | 5 +- .../ImageMetadataViewer.tsx | 2 +- .../gallery/hooks/useGetImageByUuid.ts | 2 +- .../features/gallery/store/gallerySlice.ts | 2 +- .../features/lightbox/components/Lightbox.tsx | 3 +- .../BoundingBoxSettings.tsx | 2 +- .../Canvas/InfillAndScalingOptions.tsx | 2 +- .../AdvancedOptions/Canvas/InpaintReplace.tsx | 2 +- .../Canvas/SeamCorrectionOptions.tsx | 2 +- .../FaceRestore/FaceRestoreOptions.tsx | 2 +- .../FaceRestore/FaceRestoreToggle.tsx | 3 +- .../AdvancedOptions/ImageToImage/ImageFit.tsx | 7 +- .../ImageToImage/ImageToImageStrength.tsx | 3 +- .../AdvancedOptions/Output/HiresOptions.tsx | 7 +- .../Output/SeamlessOptions.tsx | 7 +- .../AdvancedOptions/Seed/Perlin.tsx | 7 +- .../AdvancedOptions/Seed/RandomizeSeed.tsx | 10 +- .../components/AdvancedOptions/Seed/Seed.tsx | 7 +- .../AdvancedOptions/Seed/ShuffleSeed.tsx | 3 +- .../AdvancedOptions/Seed/Threshold.tsx | 7 +- .../Upscale/UpscaleOptions.tsx | 2 +- .../AdvancedOptions/Upscale/UpscaleToggle.tsx | 3 +- .../Variations/GenerateVariations.tsx | 7 +- .../Variations/SeedWeights.tsx | 7 +- .../Variations/VariationAmount.tsx | 7 +- .../MainAdvancedOptionsCheckbox.tsx | 3 +- .../components/MainOptions/MainCFGScale.tsx | 6 +- .../components/MainOptions/MainHeight.tsx | 6 +- .../components/MainOptions/MainIterations.tsx | 6 +- .../components/MainOptions/MainSampler.tsx | 3 +- .../components/MainOptions/MainSteps.tsx | 6 +- .../components/MainOptions/MainWidth.tsx | 3 +- .../options/components/OptionsAccordion.tsx | 3 +- .../ProcessButtons/CancelButton.tsx | 3 +- .../ProcessButtons/InvokeButton.tsx | 2 +- .../components/ProcessButtons/Loopback.tsx | 3 +- .../ProcessButtons/ProcessButtons.tsx | 2 +- .../components/PromptInput/PromptInput.tsx | 3 +- .../options/store/optionsSelectors.ts | 2 +- .../features/options/store/optionsSlice.ts | 2 +- .../components/ClearTempFolderButtonModal.tsx | 2 +- .../features/system/components/Console.tsx | 2 +- .../system/components/ModelSelect.tsx | 2 +- .../system/components/ProgressBar.tsx | 2 +- .../components/SettingsModal/ModelList.tsx | 3 +- .../SettingsModal/SettingsModal.tsx | 5 +- .../system/components/StatusIndicator.tsx | 3 +- .../system/components/ThemeChanger.tsx | 3 +- .../features/system/hooks/useToastWatcher.ts | 2 +- .../tabs/components/FloatingGalleryButton.tsx | 2 +- .../FloatingOptionsPanelButtons.tsx | 3 +- .../ImageToImage/ImageToImageDisplay.tsx | 3 +- .../ImageToImage/InitImagePreview.tsx | 3 +- .../ImageToImage/InitialImageOverlay.tsx | 3 +- .../tabs/components/InvokeOptionsPanel.tsx | 3 +- .../features/tabs/components/InvokeTabs.tsx | 19 +- .../tabs/components/InvokeWorkarea.tsx | 3 +- .../UnifiedCanvasDisplayBeta.tsx | 2 +- .../UnifiedCanvasBrushSize.tsx | 3 +- .../UnifiedCanvasClearMask.tsx | 2 +- .../UnifiedCanvasColorPicker.tsx | 2 +- .../UnifiedCanvasDarkenOutsideSelection.tsx | 3 +- .../UnifiedCanvasEnableMask.tsx | 3 +- .../UnifiedCanvasLimitStrokesToBox.tsx | 3 +- .../UnifiedCanvasPreserveMask.tsx | 3 +- .../UnifiedCanvasSettings.tsx | 2 +- .../UnifiedCanvasShowGrid.tsx | 3 +- .../UnifiedCanvasSnapToGrid.tsx | 3 +- .../UnifiedCanvasToolSettingsBeta.tsx | 2 +- .../UnifiedCanvasCopyToClipboard.tsx | 3 +- .../UnifiedCanvasDownloadImage.tsx | 3 +- .../UnifiedCanvasFileUploader.tsx | 2 +- .../UnifiedCanvasLayerSelect.tsx | 2 +- .../UnifiedCanvasMergeVisible.tsx | 3 +- .../UnifiedCanvasMoveTool.tsx | 3 +- .../UnifiedCanvasProcessingButtons.tsx | 3 +- .../UnifiedCanvasResetCanvas.tsx | 2 +- .../UnifiedCanvasResetView.tsx | 2 +- .../UnifiedCanvasSaveToGallery.tsx | 3 +- .../UnifiedCanvasToolSelect.tsx | 2 +- .../UnifiedCanvasToolbarBeta.tsx | 3 +- .../UnifiedCanvas/UnifiedCanvasDisplay.tsx | 2 +- .../UnifiedCanvas/UnifiedCanvasWorkarea.tsx | 3 +- frontend/src/features/tabs/tabMap.ts | 10 + frontend/src/main.tsx | 4 +- frontend/src/persistor.ts | 4 + frontend/yarn.lock | 697 +++++++++++++++++- 131 files changed, 917 insertions(+), 220 deletions(-) create mode 100644 frontend/src/app/storeHooks.ts create mode 100644 frontend/src/features/tabs/tabMap.ts create mode 100644 frontend/src/persistor.ts diff --git a/frontend/package.json b/frontend/package.json index e2443deccd..b142094b7b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,6 +8,8 @@ "build": "tsc && vite build", "build-dev": "tsc && vite build -m development", "preview": "vite preview", + "madge": "madge --circular src/main.tsx", + "lint": "eslint src/", "postinstall": "patch-package" }, "dependencies": { @@ -58,6 +60,7 @@ "eslint": "^8.23.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react-hooks": "^4.6.0", + "madge": "^5.0.1", "patch-package": "^6.5.0", "postinstall-postinstall": "^2.1.0", "sass": "^1.55.0", @@ -67,5 +70,15 @@ "vite": "^3.0.7", "vite-plugin-eslint": "^1.8.1", "vite-tsconfig-paths": "^3.5.2" + }, + "madge": { + "detectiveOptions": { + "ts": { + "skipTypeImports": true + }, + "tsx": { + "skipTypeImports": true + } + } } } diff --git a/frontend/src/app/invokeai.d.ts b/frontend/src/app/invokeai.d.ts index ea53b54546..aa7a43eb38 100644 --- a/frontend/src/app/invokeai.d.ts +++ b/frontend/src/app/invokeai.d.ts @@ -12,8 +12,7 @@ * 'gfpgan'. */ -import { Category as GalleryCategory } from 'features/gallery/store/gallerySlice'; -import { InvokeTabName } from 'features/tabs/components/InvokeTabs'; +import { InvokeTabName } from 'features/tabs/tabMap'; import { IRect } from 'konva/lib/types'; /** diff --git a/frontend/src/app/socketio/actions.ts b/frontend/src/app/socketio/actions.ts index 31894213b4..e0455ecbd1 100644 --- a/frontend/src/app/socketio/actions.ts +++ b/frontend/src/app/socketio/actions.ts @@ -1,6 +1,6 @@ import { createAction } from '@reduxjs/toolkit'; import { GalleryCategory } from 'features/gallery/store/gallerySlice'; -import { InvokeTabName } from 'features/tabs/components/InvokeTabs'; +import { InvokeTabName } from 'features/tabs/tabMap'; import * as InvokeAI from 'app/invokeai'; /** diff --git a/frontend/src/app/socketio/emitters.ts b/frontend/src/app/socketio/emitters.ts index e622769f41..8a82b01a00 100644 --- a/frontend/src/app/socketio/emitters.ts +++ b/frontend/src/app/socketio/emitters.ts @@ -17,9 +17,9 @@ import { modelChangeRequested, setIsProcessing, } from 'features/system/store/systemSlice'; -import { InvokeTabName } from 'features/tabs/components/InvokeTabs'; +import { InvokeTabName } from 'features/tabs/tabMap'; import * as InvokeAI from 'app/invokeai'; -import { RootState } from 'app/store'; +import type { RootState } from 'app/store'; /** * Returns an object containing all functions which use `socketio.emit()`. diff --git a/frontend/src/app/socketio/listeners.ts b/frontend/src/app/socketio/listeners.ts index e3cab60828..2868bcbbb1 100644 --- a/frontend/src/app/socketio/listeners.ts +++ b/frontend/src/app/socketio/listeners.ts @@ -39,7 +39,7 @@ import { requestSystemConfig, } from './actions'; import { addImageToStagingArea } from 'features/canvas/store/canvasSlice'; -import { tabMap } from 'features/tabs/components/InvokeTabs'; +import { tabMap } from 'features/tabs/tabMap'; /** * Returns an object containing listener callbacks for socketio events. diff --git a/frontend/src/app/store.ts b/frontend/src/app/store.ts index 8bb9f87f6e..73423f3ff2 100644 --- a/frontend/src/app/store.ts +++ b/frontend/src/app/store.ts @@ -1,6 +1,4 @@ import { combineReducers, configureStore } from '@reduxjs/toolkit'; -import { useDispatch, useSelector } from 'react-redux'; -import type { TypedUseSelectorHook } from 'react-redux'; import { persistReducer } from 'redux-persist'; import storage from 'redux-persist/lib/storage'; // defaults to localStorage for web @@ -101,7 +99,3 @@ export const store = configureStore({ export type AppGetState = typeof store.getState; export type RootState = ReturnType; export type AppDispatch = typeof store.dispatch; - -// Use throughout your app instead of plain `useDispatch` and `useSelector` -export const useAppDispatch: () => AppDispatch = useDispatch; -export const useAppSelector: TypedUseSelectorHook = useSelector; diff --git a/frontend/src/app/storeHooks.ts b/frontend/src/app/storeHooks.ts new file mode 100644 index 0000000000..391929d74b --- /dev/null +++ b/frontend/src/app/storeHooks.ts @@ -0,0 +1,6 @@ +import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; +import { AppDispatch, RootState } from './store'; + +// Use throughout your app instead of plain `useDispatch` and `useSelector` +export const useAppDispatch: () => AppDispatch = useDispatch; +export const useAppSelector: TypedUseSelectorHook = useSelector; diff --git a/frontend/src/common/components/GuidePopover.tsx b/frontend/src/common/components/GuidePopover.tsx index f8ad81eaaa..61f076976c 100644 --- a/frontend/src/common/components/GuidePopover.tsx +++ b/frontend/src/common/components/GuidePopover.tsx @@ -6,7 +6,7 @@ import { Box, } from '@chakra-ui/react'; import { SystemState } from 'features/system/store/systemSlice'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { RootState } from 'app/store'; import { createSelector } from '@reduxjs/toolkit'; import { ReactElement } from 'react'; diff --git a/frontend/src/common/components/ImageUploader.tsx b/frontend/src/common/components/ImageUploader.tsx index 04cce48b5d..81db0877f0 100644 --- a/frontend/src/common/components/ImageUploader.tsx +++ b/frontend/src/common/components/ImageUploader.tsx @@ -5,7 +5,7 @@ import { useEffect, KeyboardEvent, } from 'react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { FileRejection, useDropzone } from 'react-dropzone'; import { useToast } from '@chakra-ui/react'; import { ImageUploaderTriggerContext } from 'app/contexts/ImageUploaderTriggerContext'; diff --git a/frontend/src/common/util/parameterTranslation.ts b/frontend/src/common/util/parameterTranslation.ts index 1dc2dfedc7..eed9db2e07 100644 --- a/frontend/src/common/util/parameterTranslation.ts +++ b/frontend/src/common/util/parameterTranslation.ts @@ -4,11 +4,8 @@ import { SystemState } from 'features/system/store/systemSlice'; import { stringToSeedWeightsArray } from './seedWeightPairs'; import randomInt from './randomInt'; -import { InvokeTabName } from 'features/tabs/components/InvokeTabs'; -import { - CanvasState, - isCanvasMaskLine, -} from 'features/canvas/store/canvasTypes'; +import { InvokeTabName } from 'features/tabs/tabMap'; +import { CanvasState, isCanvasMaskLine } from 'features/canvas/store/canvasTypes'; import generateMask from 'features/canvas/util/generateMask'; import openBase64ImageInTab from './openBase64ImageInTab'; import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider'; diff --git a/frontend/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx b/frontend/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx index 391680a49a..5271692fef 100644 --- a/frontend/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx +++ b/frontend/src/features/canvas/components/ClearCanvasHistoryButtonModal.tsx @@ -1,4 +1,4 @@ -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIAlertDialog from 'common/components/IAIAlertDialog'; import IAIButton from 'common/components/IAIButton'; import { clearCanvasHistory } from 'features/canvas/store/canvasSlice'; diff --git a/frontend/src/features/canvas/components/IAICanvas.tsx b/frontend/src/features/canvas/components/IAICanvas.tsx index 8c221ef70f..32f65bb676 100644 --- a/frontend/src/features/canvas/components/IAICanvas.tsx +++ b/frontend/src/features/canvas/components/IAICanvas.tsx @@ -1,7 +1,7 @@ import { useCallback, useRef } from 'react'; import Konva from 'konva'; import { Layer, Stage } from 'react-konva'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { canvasSelector, isStagingSelector, diff --git a/frontend/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx b/frontend/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx index 2b2237df58..72612d92f5 100644 --- a/frontend/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx +++ b/frontend/src/features/canvas/components/IAICanvasBoundingBoxOverlay.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import { Group, Rect } from 'react-konva'; import { canvasSelector } from '../store/canvasSelectors'; diff --git a/frontend/src/features/canvas/components/IAICanvasGrid.tsx b/frontend/src/features/canvas/components/IAICanvasGrid.tsx index 7495f0ee7d..0caa13297b 100644 --- a/frontend/src/features/canvas/components/IAICanvasGrid.tsx +++ b/frontend/src/features/canvas/components/IAICanvasGrid.tsx @@ -2,7 +2,7 @@ import { useColorMode } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import { ReactNode, useCallback, useLayoutEffect, useState } from 'react'; import { Group, Line as KonvaLine } from 'react-konva'; diff --git a/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx b/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx index e6e61f4ccd..65cedebdee 100644 --- a/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx +++ b/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx @@ -1,5 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; -import { RootState, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { GalleryState } from 'features/gallery/store/gallerySlice'; import { ImageConfig } from 'konva/lib/shapes/Image'; import _ from 'lodash'; diff --git a/frontend/src/features/canvas/components/IAICanvasMaskCompositer.tsx b/frontend/src/features/canvas/components/IAICanvasMaskCompositer.tsx index 5da87dc063..7fe0ef6095 100644 --- a/frontend/src/features/canvas/components/IAICanvasMaskCompositer.tsx +++ b/frontend/src/features/canvas/components/IAICanvasMaskCompositer.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { RectConfig } from 'konva/lib/shapes/Rect'; import { Rect } from 'react-konva'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; diff --git a/frontend/src/features/canvas/components/IAICanvasMaskLines.tsx b/frontend/src/features/canvas/components/IAICanvasMaskLines.tsx index e980c1a2e3..2988466e85 100644 --- a/frontend/src/features/canvas/components/IAICanvasMaskLines.tsx +++ b/frontend/src/features/canvas/components/IAICanvasMaskLines.tsx @@ -1,6 +1,6 @@ import { GroupConfig } from 'konva/lib/Group'; import { Group, Line } from 'react-konva'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { createSelector } from '@reduxjs/toolkit'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { isCanvasMaskLine } from '../store/canvasTypes'; diff --git a/frontend/src/features/canvas/components/IAICanvasObjectRenderer.tsx b/frontend/src/features/canvas/components/IAICanvasObjectRenderer.tsx index 3e3233d599..58c1554592 100644 --- a/frontend/src/features/canvas/components/IAICanvasObjectRenderer.tsx +++ b/frontend/src/features/canvas/components/IAICanvasObjectRenderer.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import { Group, Line, Rect } from 'react-konva'; import { diff --git a/frontend/src/features/canvas/components/IAICanvasResizer.tsx b/frontend/src/features/canvas/components/IAICanvasResizer.tsx index cdeb981e51..eb298a91c8 100644 --- a/frontend/src/features/canvas/components/IAICanvasResizer.tsx +++ b/frontend/src/features/canvas/components/IAICanvasResizer.tsx @@ -1,6 +1,6 @@ import { Spinner } from '@chakra-ui/react'; import { useLayoutEffect, useRef } from 'react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import { resizeAndScaleCanvas, diff --git a/frontend/src/features/canvas/components/IAICanvasStagingArea.tsx b/frontend/src/features/canvas/components/IAICanvasStagingArea.tsx index 0f779f17a8..72b764c011 100644 --- a/frontend/src/features/canvas/components/IAICanvasStagingArea.tsx +++ b/frontend/src/features/canvas/components/IAICanvasStagingArea.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { GroupConfig } from 'konva/lib/Group'; import _ from 'lodash'; import { Group, Rect } from 'react-konva'; diff --git a/frontend/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx b/frontend/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx index 89825af7e3..8e861bc318 100644 --- a/frontend/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx +++ b/frontend/src/features/canvas/components/IAICanvasStagingAreaToolbar.tsx @@ -1,6 +1,6 @@ import { ButtonGroup, Flex } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import _ from 'lodash'; import { useCallback } from 'react'; diff --git a/frontend/src/features/canvas/components/IAICanvasStatusText.tsx b/frontend/src/features/canvas/components/IAICanvasStatusText.tsx index 2263ea3d57..5066192fa3 100644 --- a/frontend/src/features/canvas/components/IAICanvasStatusText.tsx +++ b/frontend/src/features/canvas/components/IAICanvasStatusText.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import IAICanvasStatusTextCursorPos from './IAICanvasStatusText/IAICanvasStatusTextCursorPos'; diff --git a/frontend/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx b/frontend/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx index de8e9c3941..73f3c69838 100644 --- a/frontend/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx +++ b/frontend/src/features/canvas/components/IAICanvasStatusText/IAICanvasStatusTextCursorPos.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import React from 'react'; import _ from 'lodash'; diff --git a/frontend/src/features/canvas/components/IAICanvasToolPreview.tsx b/frontend/src/features/canvas/components/IAICanvasToolPreview.tsx index 12681d2173..a20aea63b4 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolPreview.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolPreview.tsx @@ -2,7 +2,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { GroupConfig } from 'konva/lib/Group'; import _ from 'lodash'; import { Circle, Group } from 'react-konva'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { rgbaColorToString } from 'features/canvas/util/colorToString'; import { diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx index 48a45f2b59..b3f612ca7b 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasBoundingBox.tsx @@ -5,7 +5,7 @@ import { Vector2d } from 'konva/lib/types'; import _ from 'lodash'; import { useCallback, useEffect, useRef, useState } from 'react'; import { Group, Rect, Transformer } from 'react-konva'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { roundDownToMultiple, roundToMultiple, diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx index c0ad07afea..d6317c523b 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasMaskOptions.tsx @@ -7,7 +7,7 @@ import { setMaskColor, setShouldPreserveMaskedArea, } from 'features/canvas/store/canvasSlice'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import IAIIconButton from 'common/components/IAIIconButton'; import { FaMask, FaTrash } from 'react-icons/fa'; diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx index 2f743f0334..99974000fc 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasRedoButton.tsx @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { useHotkeys } from 'react-hotkeys-hook'; import { FaRedo } from 'react-icons/fa'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx index eeafe6512d..d95ef7a59b 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasSettingsButtonPopover.tsx @@ -10,7 +10,7 @@ import { setShouldShowIntermediates, setShouldSnapToGrid, } from 'features/canvas/store/canvasSlice'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import IAIIconButton from 'common/components/IAIIconButton'; import { FaWrench } from 'react-icons/fa'; diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx index 280d3e3e45..a2f392bee3 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolChooserOptions.tsx @@ -7,7 +7,7 @@ import { setBrushSize, setTool, } from 'features/canvas/store/canvasSlice'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import IAIIconButton from 'common/components/IAIIconButton'; import { diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx index 3740b865e4..f02b2fc4e4 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasToolbar.tsx @@ -8,7 +8,7 @@ import { setLayer, setTool, } from 'features/canvas/store/canvasSlice'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import IAIIconButton from 'common/components/IAIIconButton'; import { diff --git a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx index 43e24ae680..c035f7adc6 100644 --- a/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx +++ b/frontend/src/features/canvas/components/IAICanvasToolbar/IAICanvasUndoButton.tsx @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { useHotkeys } from 'react-hotkeys-hook'; import { FaUndo } from 'react-icons/fa'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; diff --git a/frontend/src/features/canvas/hooks/useCanvasDragMove.ts b/frontend/src/features/canvas/hooks/useCanvasDragMove.ts index 44daf090d9..43ebdd8b61 100644 --- a/frontend/src/features/canvas/hooks/useCanvasDragMove.ts +++ b/frontend/src/features/canvas/hooks/useCanvasDragMove.ts @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { KonvaEventObject } from 'konva/lib/Node'; import _ from 'lodash'; import { useCallback } from 'react'; diff --git a/frontend/src/features/canvas/hooks/useCanvasHotkeys.ts b/frontend/src/features/canvas/hooks/useCanvasHotkeys.ts index c0c540ecd7..cbf09fcbea 100644 --- a/frontend/src/features/canvas/hooks/useCanvasHotkeys.ts +++ b/frontend/src/features/canvas/hooks/useCanvasHotkeys.ts @@ -10,7 +10,7 @@ import { setShouldSnapToGrid, setTool, } from 'features/canvas/store/canvasSlice'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { useRef } from 'react'; import { canvasSelector, diff --git a/frontend/src/features/canvas/hooks/useCanvasMouseDown.ts b/frontend/src/features/canvas/hooks/useCanvasMouseDown.ts index b2d93178f8..afeeb8f037 100644 --- a/frontend/src/features/canvas/hooks/useCanvasMouseDown.ts +++ b/frontend/src/features/canvas/hooks/useCanvasMouseDown.ts @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import Konva from 'konva'; import { KonvaEventObject } from 'konva/lib/Node'; diff --git a/frontend/src/features/canvas/hooks/useCanvasMouseMove.ts b/frontend/src/features/canvas/hooks/useCanvasMouseMove.ts index ae42ca90a6..e2b09e4f72 100644 --- a/frontend/src/features/canvas/hooks/useCanvasMouseMove.ts +++ b/frontend/src/features/canvas/hooks/useCanvasMouseMove.ts @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import Konva from 'konva'; import { Vector2d } from 'konva/lib/types'; diff --git a/frontend/src/features/canvas/hooks/useCanvasMouseOut.ts b/frontend/src/features/canvas/hooks/useCanvasMouseOut.ts index e038d8db19..57f36faf0a 100644 --- a/frontend/src/features/canvas/hooks/useCanvasMouseOut.ts +++ b/frontend/src/features/canvas/hooks/useCanvasMouseOut.ts @@ -1,4 +1,4 @@ -import { useAppDispatch } from 'app/store'; +import { useAppDispatch } from 'app/storeHooks'; import { useCallback } from 'react'; import { mouseLeftCanvas } from 'features/canvas/store/canvasSlice'; diff --git a/frontend/src/features/canvas/hooks/useCanvasMouseUp.ts b/frontend/src/features/canvas/hooks/useCanvasMouseUp.ts index 7b1826b9c0..5bbe1ac8d7 100644 --- a/frontend/src/features/canvas/hooks/useCanvasMouseUp.ts +++ b/frontend/src/features/canvas/hooks/useCanvasMouseUp.ts @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import Konva from 'konva'; import _ from 'lodash'; diff --git a/frontend/src/features/canvas/hooks/useCanvasZoom.ts b/frontend/src/features/canvas/hooks/useCanvasZoom.ts index af3284a0ab..2d3cf3703d 100644 --- a/frontend/src/features/canvas/hooks/useCanvasZoom.ts +++ b/frontend/src/features/canvas/hooks/useCanvasZoom.ts @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import Konva from 'konva'; import { KonvaEventObject } from 'konva/lib/Node'; import _ from 'lodash'; diff --git a/frontend/src/features/canvas/hooks/useColorUnderCursor.ts b/frontend/src/features/canvas/hooks/useColorUnderCursor.ts index 4739070e13..29a6bbcbbb 100644 --- a/frontend/src/features/canvas/hooks/useColorUnderCursor.ts +++ b/frontend/src/features/canvas/hooks/useColorUnderCursor.ts @@ -1,4 +1,4 @@ -import { useAppDispatch } from 'app/store'; +import { useAppDispatch } from 'app/storeHooks'; import Konva from 'konva'; import _ from 'lodash'; import { diff --git a/frontend/src/features/gallery/components/CurrentImageButtons.tsx b/frontend/src/features/gallery/components/CurrentImageButtons.tsx index b8b207e7ac..24629744d4 100644 --- a/frontend/src/features/gallery/components/CurrentImageButtons.tsx +++ b/frontend/src/features/gallery/components/CurrentImageButtons.tsx @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { isEqual } from 'lodash'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { RootState } from 'app/store'; import { OptionsState, diff --git a/frontend/src/features/gallery/components/CurrentImageDisplay.tsx b/frontend/src/features/gallery/components/CurrentImageDisplay.tsx index a5c7816364..22393ea7b5 100644 --- a/frontend/src/features/gallery/components/CurrentImageDisplay.tsx +++ b/frontend/src/features/gallery/components/CurrentImageDisplay.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import CurrentImageButtons from './CurrentImageButtons'; import { MdPhoto } from 'react-icons/md'; import CurrentImagePreview from './CurrentImagePreview'; diff --git a/frontend/src/features/gallery/components/CurrentImagePreview.tsx b/frontend/src/features/gallery/components/CurrentImagePreview.tsx index cc641b2caf..ca83cbe751 100644 --- a/frontend/src/features/gallery/components/CurrentImagePreview.tsx +++ b/frontend/src/features/gallery/components/CurrentImagePreview.tsx @@ -1,7 +1,8 @@ import { IconButton, Image } from '@chakra-ui/react'; import { useState } from 'react'; import { FaAngleLeft, FaAngleRight } from 'react-icons/fa'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { GalleryCategory, GalleryState, diff --git a/frontend/src/features/gallery/components/DeleteImageModal.tsx b/frontend/src/features/gallery/components/DeleteImageModal.tsx index afc756d4bc..2ee876ca05 100644 --- a/frontend/src/features/gallery/components/DeleteImageModal.tsx +++ b/frontend/src/features/gallery/components/DeleteImageModal.tsx @@ -14,15 +14,9 @@ import { Flex, } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { - ChangeEvent, - cloneElement, - forwardRef, - ReactElement, - SyntheticEvent, - useRef, -} from 'react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { ChangeEvent, ReactElement, SyntheticEvent } from 'react'; +import { cloneElement, forwardRef, useRef } from 'react'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { deleteImage } from 'app/socketio/actions'; import { RootState } from 'app/store'; import { diff --git a/frontend/src/features/gallery/components/HoverableImage.tsx b/frontend/src/features/gallery/components/HoverableImage.tsx index 50bb8ab0b9..935f37b7ce 100644 --- a/frontend/src/features/gallery/components/HoverableImage.tsx +++ b/frontend/src/features/gallery/components/HoverableImage.tsx @@ -6,7 +6,7 @@ import { Tooltip, useToast, } from '@chakra-ui/react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { setCurrentImage, setShouldHoldGalleryOpen, diff --git a/frontend/src/features/gallery/components/ImageGallery.tsx b/frontend/src/features/gallery/components/ImageGallery.tsx index f926173850..7f16f551c8 100644 --- a/frontend/src/features/gallery/components/ImageGallery.tsx +++ b/frontend/src/features/gallery/components/ImageGallery.tsx @@ -12,7 +12,7 @@ import { useHotkeys } from 'react-hotkeys-hook'; import { MdPhotoLibrary } from 'react-icons/md'; import { BsPinAngle, BsPinAngleFill } from 'react-icons/bs'; import { requestImages } from 'app/socketio/actions'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { selectNextImage, @@ -41,7 +41,7 @@ import IAICheckbox from 'common/components/IAICheckbox'; import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice'; import _ from 'lodash'; import IAIButton from 'common/components/IAIButton'; -import { InvokeTabName } from 'features/tabs/components/InvokeTabs'; +import { InvokeTabName } from 'features/tabs/tabMap'; const GALLERY_SHOW_BUTTONS_MIN_WIDTH = 320; const GALLERY_IMAGE_WIDTH_OFFSET = 40; @@ -55,6 +55,7 @@ const GALLERY_TAB_WIDTHS: Record< unifiedCanvas: { galleryMinWidth: 200, galleryMaxWidth: 200 }, nodes: { galleryMinWidth: 200, galleryMaxWidth: 500 }, postprocess: { galleryMinWidth: 200, galleryMaxWidth: 500 }, + training: { galleryMinWidth: 200, galleryMaxWidth: 500 }, }; const LIGHTBOX_GALLERY_WIDTH = 400; diff --git a/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx b/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx index fdad8541f9..73244a9b7d 100644 --- a/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx +++ b/frontend/src/features/gallery/components/ImageMetaDataViewer/ImageMetadataViewer.tsx @@ -10,7 +10,7 @@ import { import { ExternalLinkIcon } from '@chakra-ui/icons'; import { memo } from 'react'; import { IoArrowUndoCircleOutline } from 'react-icons/io5'; -import { useAppDispatch } from 'app/store'; +import { useAppDispatch } from 'app/storeHooks'; import * as InvokeAI from 'app/invokeai'; import { setCfgScale, diff --git a/frontend/src/features/gallery/hooks/useGetImageByUuid.ts b/frontend/src/features/gallery/hooks/useGetImageByUuid.ts index ecb263ec0a..4f0141dfb1 100644 --- a/frontend/src/features/gallery/hooks/useGetImageByUuid.ts +++ b/frontend/src/features/gallery/hooks/useGetImageByUuid.ts @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { gallerySelector } from '../store/gallerySliceSelectors'; const selector = createSelector(gallerySelector, (gallery) => ({ diff --git a/frontend/src/features/gallery/store/gallerySlice.ts b/frontend/src/features/gallery/store/gallerySlice.ts index 932c45210e..3dd7a99698 100644 --- a/frontend/src/features/gallery/store/gallerySlice.ts +++ b/frontend/src/features/gallery/store/gallerySlice.ts @@ -3,7 +3,7 @@ import type { PayloadAction } from '@reduxjs/toolkit'; import _, { clamp } from 'lodash'; import * as InvokeAI from 'app/invokeai'; import { IRect } from 'konva/lib/types'; -import { InvokeTabName } from 'features/tabs/components/InvokeTabs'; +import { InvokeTabName } from 'features/tabs/tabMap'; export type GalleryCategory = 'user' | 'result'; diff --git a/frontend/src/features/lightbox/components/Lightbox.tsx b/frontend/src/features/lightbox/components/Lightbox.tsx index afcdb06db7..4459887dd0 100644 --- a/frontend/src/features/lightbox/components/Lightbox.tsx +++ b/frontend/src/features/lightbox/components/Lightbox.tsx @@ -1,5 +1,6 @@ import { IconButton } from '@chakra-ui/react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import CurrentImageButtons from 'features/gallery/components/CurrentImageButtons'; import { imagesSelector } from 'features/gallery/components/CurrentImagePreview'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.tsx b/frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.tsx index 6d35a496f8..f3185e4ed0 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Canvas/BoundingBoxSettings/BoundingBoxSettings.tsx @@ -1,6 +1,6 @@ import { Box, Flex } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISlider from 'common/components/IAISlider'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { setBoundingBoxDimensions } from 'features/canvas/store/canvasSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Canvas/InfillAndScalingOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/Canvas/InfillAndScalingOptions.tsx index fcff38ccce..8e88577b87 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Canvas/InfillAndScalingOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Canvas/InfillAndScalingOptions.tsx @@ -1,6 +1,6 @@ import { Flex } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISelect from 'common/components/IAISelect'; import IAISlider from 'common/components/IAISlider'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Canvas/InpaintReplace.tsx b/frontend/src/features/options/components/AdvancedOptions/Canvas/InpaintReplace.tsx index 8ce85a8238..306d82325d 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Canvas/InpaintReplace.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Canvas/InpaintReplace.tsx @@ -1,5 +1,5 @@ import React, { ChangeEvent } from 'react'; -import { useAppDispatch, useAppSelector } from '../../../../../app/store'; +import { useAppDispatch, useAppSelector } from '../../../../../app/storeHooks'; import _ from 'lodash'; import { createSelector } from '@reduxjs/toolkit'; import IAISwitch from '../../../../../common/components/IAISwitch'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Canvas/SeamCorrectionOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/Canvas/SeamCorrectionOptions.tsx index d234480532..93fe487d2c 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Canvas/SeamCorrectionOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Canvas/SeamCorrectionOptions.tsx @@ -1,6 +1,6 @@ import { Flex } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISlider from 'common/components/IAISlider'; import { optionsSelector } from 'features/options/store/optionsSelectors'; import { diff --git a/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreOptions.tsx index d3f04f3142..fcf35712fa 100644 --- a/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreOptions.tsx @@ -1,7 +1,7 @@ import { Flex } from '@chakra-ui/react'; import { RootState } from 'app/store'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { FacetoolType, diff --git a/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle.tsx b/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle.tsx index 0867ad0db0..1fcb1ac7ed 100644 --- a/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/FaceRestore/FaceRestoreToggle.tsx @@ -1,5 +1,6 @@ import { ChangeEvent } from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISwitch from 'common/components/IAISwitch'; import { setShouldRunFacetool } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageFit.tsx b/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageFit.tsx index 25b5618251..34827fcbd2 100644 --- a/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageFit.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageFit.tsx @@ -1,9 +1,6 @@ import React, { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISwitch from 'common/components/IAISwitch'; import { setShouldFitToWidthHeight } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx b/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx index 792bcdbcbf..be0d2615bb 100644 --- a/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/ImageToImage/ImageToImageStrength.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISlider from 'common/components/IAISlider'; import { setImg2imgStrength } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Output/HiresOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/Output/HiresOptions.tsx index d7b76c50dc..ffcea9321f 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Output/HiresOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Output/HiresOptions.tsx @@ -1,10 +1,7 @@ import { Flex } from '@chakra-ui/react'; import { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISwitch from 'common/components/IAISwitch'; import { setHiresFix } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Output/SeamlessOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/Output/SeamlessOptions.tsx index 22aab225bf..7a36a2f5f0 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Output/SeamlessOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Output/SeamlessOptions.tsx @@ -1,10 +1,7 @@ import { Flex } from '@chakra-ui/react'; import { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISwitch from 'common/components/IAISwitch'; import { setSeamless } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/Perlin.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/Perlin.tsx index 45b6b605ce..401be36815 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/Perlin.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Seed/Perlin.tsx @@ -1,9 +1,6 @@ import React from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAINumberInput from 'common/components/IAINumberInput'; import { setPerlin } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/RandomizeSeed.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/RandomizeSeed.tsx index d334c624c2..f86f90f870 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/RandomizeSeed.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Seed/RandomizeSeed.tsx @@ -1,10 +1,8 @@ -import React, { ChangeEvent } from 'react'; +import { ChangeEvent } from 'react'; +import React from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISwitch from 'common/components/IAISwitch'; import { setShouldRandomizeSeed } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx index 7f50e6c7b8..17bd2a2142 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Seed/Seed.tsx @@ -1,10 +1,7 @@ import React from 'react'; import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAINumberInput from 'common/components/IAINumberInput'; import { setSeed } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx index 59134398dc..b3ac80bcb6 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Seed/ShuffleSeed.tsx @@ -1,7 +1,8 @@ import { Button } from '@chakra-ui/react'; import React from 'react'; import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import randomInt from 'common/util/randomInt'; import { setSeed } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Seed/Threshold.tsx b/frontend/src/features/options/components/AdvancedOptions/Seed/Threshold.tsx index 2450bda506..7c5ee9070f 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Seed/Threshold.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Seed/Threshold.tsx @@ -1,9 +1,6 @@ import React from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAINumberInput from 'common/components/IAINumberInput'; import { setThreshold } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx index 8588a0ed39..c88d2cb7cf 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx @@ -1,5 +1,5 @@ import { RootState } from 'app/store'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { setUpscalingLevel, diff --git a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleToggle.tsx b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleToggle.tsx index f0a55776c2..e8e180dab7 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleToggle.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleToggle.tsx @@ -1,5 +1,6 @@ import { ChangeEvent } from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISwitch from 'common/components/IAISwitch'; import { setShouldRunESRGAN } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx b/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx index ca5afd53c4..f3887a4fa2 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Variations/GenerateVariations.tsx @@ -1,9 +1,6 @@ import React, { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISwitch from 'common/components/IAISwitch'; import { setShouldGenerateVariations } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Variations/SeedWeights.tsx b/frontend/src/features/options/components/AdvancedOptions/Variations/SeedWeights.tsx index 9db25d2d80..edd82f0ff2 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Variations/SeedWeights.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Variations/SeedWeights.tsx @@ -1,9 +1,6 @@ import React, { ChangeEvent } from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIInput from 'common/components/IAIInput'; import { validateSeedWeights } from 'common/util/seedWeightPairs'; import { setSeedWeights } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/AdvancedOptions/Variations/VariationAmount.tsx b/frontend/src/features/options/components/AdvancedOptions/Variations/VariationAmount.tsx index 78500e8f95..0d0f94b35c 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Variations/VariationAmount.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Variations/VariationAmount.tsx @@ -1,9 +1,6 @@ import React from 'react'; -import { - RootState, - useAppDispatch, - useAppSelector, -} from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAINumberInput from 'common/components/IAINumberInput'; import { setVariationAmount } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/MainOptions/MainAdvancedOptionsCheckbox.tsx b/frontend/src/features/options/components/MainOptions/MainAdvancedOptionsCheckbox.tsx index 8e1cc0f2e7..4096546d2f 100644 --- a/frontend/src/features/options/components/MainOptions/MainAdvancedOptionsCheckbox.tsx +++ b/frontend/src/features/options/components/MainOptions/MainAdvancedOptionsCheckbox.tsx @@ -1,5 +1,6 @@ import React, { ChangeEvent } from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAICheckbox from 'common/components/IAICheckbox'; import { setShowAdvancedOptions } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/MainOptions/MainCFGScale.tsx b/frontend/src/features/options/components/MainOptions/MainCFGScale.tsx index 7d8cc7db9e..b728ae1aef 100644 --- a/frontend/src/features/options/components/MainOptions/MainCFGScale.tsx +++ b/frontend/src/features/options/components/MainOptions/MainCFGScale.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAINumberInput from 'common/components/IAINumberInput'; import { setCfgScale } from 'features/options/store/optionsSlice'; -import { inputWidth } from './MainOptions'; export default function MainCFGScale() { const dispatch = useAppDispatch(); @@ -18,7 +18,7 @@ export default function MainCFGScale() { max={200} onChange={handleChangeCfgScale} value={cfgScale} - width={inputWidth} + width="auto" styleClass="main-option-block" textAlign="center" isInteger={false} diff --git a/frontend/src/features/options/components/MainOptions/MainHeight.tsx b/frontend/src/features/options/components/MainOptions/MainHeight.tsx index 3e1ccbffb4..bf66b3578f 100644 --- a/frontend/src/features/options/components/MainOptions/MainHeight.tsx +++ b/frontend/src/features/options/components/MainOptions/MainHeight.tsx @@ -1,6 +1,8 @@ -import React, { ChangeEvent } from 'react'; +import { ChangeEvent } from 'react'; +import React from 'react'; import { HEIGHTS } from 'app/constants'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISelect from 'common/components/IAISelect'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import { setHeight } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/MainOptions/MainIterations.tsx b/frontend/src/features/options/components/MainOptions/MainIterations.tsx index c4b12973a7..6bc2ad8f9d 100644 --- a/frontend/src/features/options/components/MainOptions/MainIterations.tsx +++ b/frontend/src/features/options/components/MainOptions/MainIterations.tsx @@ -1,13 +1,13 @@ import { createSelector } from '@reduxjs/toolkit'; import _ from 'lodash'; import React from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import type { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAINumberInput from 'common/components/IAINumberInput'; import { OptionsState, setIterations, } from 'features/options/store/optionsSlice'; -import { inputWidth } from './MainOptions'; const mainIterationsSelector = createSelector( [(state: RootState) => state.options], @@ -39,7 +39,7 @@ export default function MainIterations() { max={9999} onChange={handleChangeIterations} value={iterations} - width={inputWidth} + width="auto" labelFontSize={0.5} styleClass="main-option-block" textAlign="center" diff --git a/frontend/src/features/options/components/MainOptions/MainSampler.tsx b/frontend/src/features/options/components/MainOptions/MainSampler.tsx index 8f45eae430..cf1881ce28 100644 --- a/frontend/src/features/options/components/MainOptions/MainSampler.tsx +++ b/frontend/src/features/options/components/MainOptions/MainSampler.tsx @@ -1,6 +1,7 @@ import React, { ChangeEvent } from 'react'; import { SAMPLERS } from 'app/constants'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISelect from 'common/components/IAISelect'; import { setSampler } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/MainOptions/MainSteps.tsx b/frontend/src/features/options/components/MainOptions/MainSteps.tsx index ba9d99df4a..6a2b5dfff9 100644 --- a/frontend/src/features/options/components/MainOptions/MainSteps.tsx +++ b/frontend/src/features/options/components/MainOptions/MainSteps.tsx @@ -1,8 +1,8 @@ import React from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAINumberInput from 'common/components/IAINumberInput'; import { setSteps } from 'features/options/store/optionsSlice'; -import { inputWidth } from './MainOptions'; export default function MainSteps() { const dispatch = useAppDispatch(); @@ -18,7 +18,7 @@ export default function MainSteps() { step={1} onChange={handleChangeSteps} value={steps} - width={inputWidth} + width="auto" styleClass="main-option-block" textAlign="center" /> diff --git a/frontend/src/features/options/components/MainOptions/MainWidth.tsx b/frontend/src/features/options/components/MainOptions/MainWidth.tsx index eeab19a1b0..19f0559ff4 100644 --- a/frontend/src/features/options/components/MainOptions/MainWidth.tsx +++ b/frontend/src/features/options/components/MainOptions/MainWidth.tsx @@ -1,6 +1,7 @@ import React, { ChangeEvent } from 'react'; import { WIDTHS } from 'app/constants'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISelect from 'common/components/IAISelect'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import { setWidth } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/OptionsAccordion.tsx b/frontend/src/features/options/components/OptionsAccordion.tsx index 5520ae2297..7873e1b26d 100644 --- a/frontend/src/features/options/components/OptionsAccordion.tsx +++ b/frontend/src/features/options/components/OptionsAccordion.tsx @@ -1,5 +1,6 @@ import { Accordion, ExpandedIndex } from '@chakra-ui/react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { setOpenAccordions } from 'features/system/store/systemSlice'; import InvokeAccordionItem, { InvokeAccordionItemProps, diff --git a/frontend/src/features/options/components/ProcessButtons/CancelButton.tsx b/frontend/src/features/options/components/ProcessButtons/CancelButton.tsx index e7516454a5..4df7c051e3 100644 --- a/frontend/src/features/options/components/ProcessButtons/CancelButton.tsx +++ b/frontend/src/features/options/components/ProcessButtons/CancelButton.tsx @@ -1,6 +1,7 @@ import { MdCancel } from 'react-icons/md'; import { cancelProcessing } from 'app/socketio/actions'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton, { IAIIconButtonProps, } from 'common/components/IAIIconButton'; diff --git a/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx b/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx index 30aab9744c..d487d61292 100644 --- a/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx +++ b/frontend/src/features/options/components/ProcessButtons/InvokeButton.tsx @@ -2,7 +2,7 @@ import { useHotkeys } from 'react-hotkeys-hook'; import { FaPlay } from 'react-icons/fa'; import { readinessSelector } from 'app/selectors/readinessSelector'; import { generateImage } from 'app/socketio/actions'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIButton, { IAIButtonProps } from 'common/components/IAIButton'; import IAIIconButton, { IAIIconButtonProps, diff --git a/frontend/src/features/options/components/ProcessButtons/Loopback.tsx b/frontend/src/features/options/components/ProcessButtons/Loopback.tsx index c574c1ebfe..3667c81fbc 100644 --- a/frontend/src/features/options/components/ProcessButtons/Loopback.tsx +++ b/frontend/src/features/options/components/ProcessButtons/Loopback.tsx @@ -1,6 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import { FaRecycle } from 'react-icons/fa'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { OptionsState, setShouldLoopback } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/components/ProcessButtons/ProcessButtons.tsx b/frontend/src/features/options/components/ProcessButtons/ProcessButtons.tsx index 2cf11a8a60..f91f195ea6 100644 --- a/frontend/src/features/options/components/ProcessButtons/ProcessButtons.tsx +++ b/frontend/src/features/options/components/ProcessButtons/ProcessButtons.tsx @@ -1,7 +1,7 @@ import InvokeButton from './InvokeButton'; import CancelButton from './CancelButton'; import LoopbackButton from './Loopback'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; /** diff --git a/frontend/src/features/options/components/PromptInput/PromptInput.tsx b/frontend/src/features/options/components/PromptInput/PromptInput.tsx index 1364d791d9..928e842417 100644 --- a/frontend/src/features/options/components/PromptInput/PromptInput.tsx +++ b/frontend/src/features/options/components/PromptInput/PromptInput.tsx @@ -1,6 +1,7 @@ import { FormControl, Textarea } from '@chakra-ui/react'; import { ChangeEvent, KeyboardEvent, useRef } from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { generateImage } from 'app/socketio/actions'; import { OptionsState, setPrompt } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/options/store/optionsSelectors.ts b/frontend/src/features/options/store/optionsSelectors.ts index 00ec3b0c08..26a6612401 100644 --- a/frontend/src/features/options/store/optionsSelectors.ts +++ b/frontend/src/features/options/store/optionsSelectors.ts @@ -1,7 +1,7 @@ import { createSelector } from '@reduxjs/toolkit'; import _ from 'lodash'; import { RootState } from 'app/store'; -import { tabMap } from 'features/tabs/components/InvokeTabs'; +import { tabMap } from 'features/tabs/tabMap'; import { OptionsState } from './optionsSlice'; export const activeTabNameSelector = createSelector( diff --git a/frontend/src/features/options/store/optionsSlice.ts b/frontend/src/features/options/store/optionsSlice.ts index a8a61bf2a1..65b6858682 100644 --- a/frontend/src/features/options/store/optionsSlice.ts +++ b/frontend/src/features/options/store/optionsSlice.ts @@ -4,7 +4,7 @@ import * as InvokeAI from 'app/invokeai'; import promptToString from 'common/util/promptToString'; import { seedWeightsToString } from 'common/util/seedWeightPairs'; import { FACETOOL_TYPES } from 'app/constants'; -import { InvokeTabName, tabMap } from 'features/tabs/components/InvokeTabs'; +import { InvokeTabName, tabMap } from 'features/tabs/tabMap'; export type UpscalingLevel = 2 | 4; diff --git a/frontend/src/features/system/components/ClearTempFolderButtonModal.tsx b/frontend/src/features/system/components/ClearTempFolderButtonModal.tsx index b093be07e2..412177d73a 100644 --- a/frontend/src/features/system/components/ClearTempFolderButtonModal.tsx +++ b/frontend/src/features/system/components/ClearTempFolderButtonModal.tsx @@ -1,5 +1,5 @@ import { emptyTempFolder } from 'app/socketio/actions'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIAlertDialog from 'common/components/IAIAlertDialog'; import IAIButton from 'common/components/IAIButton'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; diff --git a/frontend/src/features/system/components/Console.tsx b/frontend/src/features/system/components/Console.tsx index 312ac44941..20eaa3a8b8 100644 --- a/frontend/src/features/system/components/Console.tsx +++ b/frontend/src/features/system/components/Console.tsx @@ -1,5 +1,5 @@ import { IconButton, Tooltip } from '@chakra-ui/react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { RootState } from 'app/store'; import { errorSeen, setShouldShowLogViewer, SystemState } from 'features/system/store/systemSlice'; import { useLayoutEffect, useRef, useState } from 'react'; diff --git a/frontend/src/features/system/components/ModelSelect.tsx b/frontend/src/features/system/components/ModelSelect.tsx index c1e3338513..49b7fe93fd 100644 --- a/frontend/src/features/system/components/ModelSelect.tsx +++ b/frontend/src/features/system/components/ModelSelect.tsx @@ -1,7 +1,7 @@ import { Flex } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { requestModelChange } from 'app/socketio/actions'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISelect from 'common/components/IAISelect'; import _ from 'lodash'; import { ChangeEvent } from 'react'; diff --git a/frontend/src/features/system/components/ProgressBar.tsx b/frontend/src/features/system/components/ProgressBar.tsx index 9aa15c43af..fc08212f29 100644 --- a/frontend/src/features/system/components/ProgressBar.tsx +++ b/frontend/src/features/system/components/ProgressBar.tsx @@ -1,7 +1,7 @@ import { Progress } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { isEqual } from 'lodash'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { RootState } from 'app/store'; import { SystemState } from 'features/system/store/systemSlice'; diff --git a/frontend/src/features/system/components/SettingsModal/ModelList.tsx b/frontend/src/features/system/components/SettingsModal/ModelList.tsx index 3ee5b2e0ad..0ccc7b2483 100644 --- a/frontend/src/features/system/components/SettingsModal/ModelList.tsx +++ b/frontend/src/features/system/components/SettingsModal/ModelList.tsx @@ -12,7 +12,8 @@ import { createSelector } from '@reduxjs/toolkit'; import _ from 'lodash'; import { ModelStatus } from 'app/invokeai'; import { requestModelChange } from 'app/socketio/actions'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { SystemState } from 'features/system/store/systemSlice'; type ModelListItemProps = { diff --git a/frontend/src/features/system/components/SettingsModal/SettingsModal.tsx b/frontend/src/features/system/components/SettingsModal/SettingsModal.tsx index c55231cc01..668c97af89 100644 --- a/frontend/src/features/system/components/SettingsModal/SettingsModal.tsx +++ b/frontend/src/features/system/components/SettingsModal/SettingsModal.tsx @@ -15,8 +15,9 @@ import { import { createSelector } from '@reduxjs/toolkit'; import _, { isEqual } from 'lodash'; import { ChangeEvent, cloneElement, ReactElement } from 'react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; -import { persistor } from 'main'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; +import { persistor } from 'persistor'; import { InProgressImageType, setEnableImageDebugging, diff --git a/frontend/src/features/system/components/StatusIndicator.tsx b/frontend/src/features/system/components/StatusIndicator.tsx index 1da6c2a892..bd458c2e79 100644 --- a/frontend/src/features/system/components/StatusIndicator.tsx +++ b/frontend/src/features/system/components/StatusIndicator.tsx @@ -1,7 +1,8 @@ import { Text, Tooltip } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { isEqual } from 'lodash'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { errorSeen, SystemState } from 'features/system/store/systemSlice'; const systemSelector = createSelector( diff --git a/frontend/src/features/system/components/ThemeChanger.tsx b/frontend/src/features/system/components/ThemeChanger.tsx index 6e2d9fcab4..f2b1255391 100644 --- a/frontend/src/features/system/components/ThemeChanger.tsx +++ b/frontend/src/features/system/components/ThemeChanger.tsx @@ -1,5 +1,6 @@ import { useColorMode, VStack } from '@chakra-ui/react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { setCurrentTheme } from 'features/options/store/optionsSlice'; import IAIPopover from 'common/components/IAIPopover'; import IAIIconButton from 'common/components/IAIIconButton'; diff --git a/frontend/src/features/system/hooks/useToastWatcher.ts b/frontend/src/features/system/hooks/useToastWatcher.ts index f5a36681ce..bb5dbeed97 100644 --- a/frontend/src/features/system/hooks/useToastWatcher.ts +++ b/frontend/src/features/system/hooks/useToastWatcher.ts @@ -1,5 +1,5 @@ import { useToast } from '@chakra-ui/react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { useEffect } from 'react'; import { toastQueueSelector } from 'features/system/store/systemSelectors'; import { clearToastQueue } from 'features/system/store/systemSlice'; diff --git a/frontend/src/features/tabs/components/FloatingGalleryButton.tsx b/frontend/src/features/tabs/components/FloatingGalleryButton.tsx index 1f68739783..2b1eca3fa6 100644 --- a/frontend/src/features/tabs/components/FloatingGalleryButton.tsx +++ b/frontend/src/features/tabs/components/FloatingGalleryButton.tsx @@ -1,5 +1,5 @@ import { MdPhotoLibrary } from 'react-icons/md'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { setShouldShowGallery } from 'features/gallery/store/gallerySlice'; import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice'; diff --git a/frontend/src/features/tabs/components/FloatingOptionsPanelButtons.tsx b/frontend/src/features/tabs/components/FloatingOptionsPanelButtons.tsx index 844f175280..c0b0e096b7 100644 --- a/frontend/src/features/tabs/components/FloatingOptionsPanelButtons.tsx +++ b/frontend/src/features/tabs/components/FloatingOptionsPanelButtons.tsx @@ -1,5 +1,6 @@ import { createSelector } from '@reduxjs/toolkit'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { OptionsState, diff --git a/frontend/src/features/tabs/components/ImageToImage/ImageToImageDisplay.tsx b/frontend/src/features/tabs/components/ImageToImage/ImageToImageDisplay.tsx index 90de5fe459..19678fb923 100644 --- a/frontend/src/features/tabs/components/ImageToImage/ImageToImageDisplay.tsx +++ b/frontend/src/features/tabs/components/ImageToImage/ImageToImageDisplay.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import ImageUploadButton from 'common/components/ImageUploaderButton'; import CurrentImageDisplay from 'features/gallery/components/CurrentImageDisplay'; import InitImagePreview from './InitImagePreview'; diff --git a/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx b/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx index 25cc602f7d..045f2e4477 100644 --- a/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx +++ b/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx @@ -1,5 +1,6 @@ import { Image, useToast } from '@chakra-ui/react'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import ImageUploaderIconButton from 'common/components/ImageUploaderIconButton'; import { clearInitialImage } from 'features/options/store/optionsSlice'; diff --git a/frontend/src/features/tabs/components/ImageToImage/InitialImageOverlay.tsx b/frontend/src/features/tabs/components/ImageToImage/InitialImageOverlay.tsx index 90f4f64709..dddd810e44 100644 --- a/frontend/src/features/tabs/components/ImageToImage/InitialImageOverlay.tsx +++ b/frontend/src/features/tabs/components/ImageToImage/InitialImageOverlay.tsx @@ -1,6 +1,7 @@ import { Image } from '@chakra-ui/react'; import React from 'react'; -import { RootState, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; export default function InitialImageOverlay() { const initialImage = useAppSelector( diff --git a/frontend/src/features/tabs/components/InvokeOptionsPanel.tsx b/frontend/src/features/tabs/components/InvokeOptionsPanel.tsx index 0656ae717b..8caccbae31 100644 --- a/frontend/src/features/tabs/components/InvokeOptionsPanel.tsx +++ b/frontend/src/features/tabs/components/InvokeOptionsPanel.tsx @@ -5,7 +5,8 @@ import React, { ReactNode, useCallback, useEffect, useRef } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; import { BsPinAngle, BsPinAngleFill } from 'react-icons/bs'; import { CSSTransition } from 'react-transition-group'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { OptionsState, setOptionsPanelScrollPosition, diff --git a/frontend/src/features/tabs/components/InvokeTabs.tsx b/frontend/src/features/tabs/components/InvokeTabs.tsx index 8d6204edc1..f12e9406eb 100644 --- a/frontend/src/features/tabs/components/InvokeTabs.tsx +++ b/frontend/src/features/tabs/components/InvokeTabs.tsx @@ -2,7 +2,8 @@ import { Tab, TabPanel, TabPanels, Tabs, Tooltip } from '@chakra-ui/react'; import _ from 'lodash'; import React, { ReactElement } from 'react'; import { useHotkeys } from 'react-hotkeys-hook'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import NodesWIP from 'common/components/WorkInProgress/NodesWIP'; import { PostProcessingWIP } from 'common/components/WorkInProgress/PostProcessingWIP'; import ImageToImageIcon from 'common/icons/ImageToImageIcon'; @@ -20,8 +21,15 @@ import UnifiedCanvasWorkarea from './UnifiedCanvas/UnifiedCanvasWorkarea'; import UnifiedCanvasIcon from 'common/icons/UnifiedCanvasIcon'; import TrainingWIP from 'common/components/WorkInProgress/Training'; import TrainingIcon from 'common/icons/TrainingIcon'; +import { InvokeTabName } from 'features/tabs/tabMap'; -export const tabDict = { +export interface InvokeTabInfo { + title: ReactElement; + workarea: ReactElement; + tooltip: string; +} + +export const tabDict: Record = { txt2img: { title: , workarea: , @@ -54,13 +62,6 @@ export const tabDict = { }, }; -// Array where index maps to the key of tabDict -export const tabMap = _.map(tabDict, (tab, key) => key); - -// Use tabMap to generate a union type of tab names -const tabMapTypes = [...tabMap] as const; -export type InvokeTabName = typeof tabMapTypes[number]; - export default function InvokeTabs() { const activeTab = useAppSelector( (state: RootState) => state.options.activeTab diff --git a/frontend/src/features/tabs/components/InvokeWorkarea.tsx b/frontend/src/features/tabs/components/InvokeWorkarea.tsx index aa21282669..82afd881d9 100644 --- a/frontend/src/features/tabs/components/InvokeWorkarea.tsx +++ b/frontend/src/features/tabs/components/InvokeWorkarea.tsx @@ -2,7 +2,8 @@ import { Tooltip } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; import { DragEvent, ReactNode } from 'react'; import { VscSplitHorizontal } from 'react-icons/vsc'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import ImageGallery from 'features/gallery/components/ImageGallery'; import { activeTabNameSelector } from 'features/options/store/optionsSelectors'; import { diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx index 0ccde27e56..90edf0a556 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx @@ -3,7 +3,7 @@ import { createSelector } from '@reduxjs/toolkit'; import IAICanvasResizer from 'features/canvas/components/IAICanvasResizer'; import _ from 'lodash'; import { useLayoutEffect } from 'react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice'; import IAICanvas from 'features/canvas/components/IAICanvas'; import IAICanvasOutpaintingControls from 'features/canvas/components/IAICanvasToolbar/IAICanvasToolbar'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasBrushSize.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasBrushSize.tsx index 5103d7172c..f2318cc72f 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasBrushSize.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasBrushSize.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISlider from 'common/components/IAISlider'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { setBrushSize } from 'features/canvas/store/canvasSlice'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasClearMask.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasClearMask.tsx index b6e687dea1..8189804fcf 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasClearMask.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasClearMask.tsx @@ -1,4 +1,4 @@ -import { useAppDispatch } from 'app/store'; +import { useAppDispatch } from 'app/storeHooks'; import IAIButton from 'common/components/IAIButton'; import { clearMask } from 'features/canvas/store/canvasSlice'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx index 63cf823871..1fd9b2121d 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasColorPicker.tsx @@ -1,6 +1,6 @@ import { Box, Flex } from '@chakra-ui/react'; import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIColorPicker from 'common/components/IAIColorPicker'; import IAIPopover from 'common/components/IAIPopover'; import { diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasDarkenOutsideSelection.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasDarkenOutsideSelection.tsx index f3b11b2136..47a20d13ad 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasDarkenOutsideSelection.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasDarkenOutsideSelection.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAICheckbox from 'common/components/IAICheckbox'; import { setShouldDarkenOutsideBoundingBox } from 'features/canvas/store/canvasSlice'; import React from 'react'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasEnableMask.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasEnableMask.tsx index fa8dd2dde4..046fafad41 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasEnableMask.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasEnableMask.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAICheckbox from 'common/components/IAICheckbox'; import { setIsMaskEnabled } from 'features/canvas/store/canvasSlice'; import React from 'react'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasLimitStrokesToBox.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasLimitStrokesToBox.tsx index 11242e1ff3..ccacea0abf 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasLimitStrokesToBox.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasLimitStrokesToBox.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAICheckbox from 'common/components/IAICheckbox'; import { setShouldRestrictStrokesToBox } from 'features/canvas/store/canvasSlice'; import React from 'react'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasPreserveMask.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasPreserveMask.tsx index 46b9c57c90..abd30d131c 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasPreserveMask.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasPreserveMask.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAICheckbox from 'common/components/IAICheckbox'; import { setShouldPreserveMaskedArea } from 'features/canvas/store/canvasSlice'; import React from 'react'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx index f49f2e3303..5c14d3e09e 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSettings.tsx @@ -6,7 +6,7 @@ import { setShouldShowCanvasDebugInfo, setShouldShowIntermediates, } from 'features/canvas/store/canvasSlice'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import IAIIconButton from 'common/components/IAIIconButton'; import { FaWrench } from 'react-icons/fa'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasShowGrid.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasShowGrid.tsx index 3d8fe78248..9bae5b4423 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasShowGrid.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasShowGrid.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAICheckbox from 'common/components/IAICheckbox'; import { setShouldShowGrid } from 'features/canvas/store/canvasSlice'; import React from 'react'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSnapToGrid.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSnapToGrid.tsx index bb89b67e3e..60f53031ce 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSnapToGrid.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettings/UnifiedCanvasSnapToGrid.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAICheckbox from 'common/components/IAICheckbox'; import { setShouldSnapToGrid } from 'features/canvas/store/canvasSlice'; import React, { ChangeEvent } from 'react'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx index effa4718ec..f979c418c9 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolSettingsBeta.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import React from 'react'; import _ from 'lodash'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasCopyToClipboard.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasCopyToClipboard.tsx index cca0b1af21..3e0e206087 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasCopyToClipboard.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasCopyToClipboard.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { mergeAndUploadCanvas } from 'features/canvas/store/thunks/mergeAndUploadCanvas'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasDownloadImage.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasDownloadImage.tsx index e74419e2f3..9b73999a26 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasDownloadImage.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasDownloadImage.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { mergeAndUploadCanvas } from 'features/canvas/store/thunks/mergeAndUploadCanvas'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasFileUploader.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasFileUploader.tsx index 1543ce6868..7ca55ebef2 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasFileUploader.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasFileUploader.tsx @@ -1,4 +1,4 @@ -import { useAppSelector } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import useImageUploader from 'common/hooks/useImageUploader'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx index fcf28d4669..d650b16550 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasLayerSelect.tsx @@ -1,5 +1,5 @@ import { createSelector } from '@reduxjs/toolkit'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAISelect from 'common/components/IAISelect'; import { canvasSelector, diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMergeVisible.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMergeVisible.tsx index 9a4cf6d43d..98ce701a21 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMergeVisible.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMergeVisible.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { mergeAndUploadCanvas } from 'features/canvas/store/thunks/mergeAndUploadCanvas'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMoveTool.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMoveTool.tsx index d9b81bdab4..936c391f25 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMoveTool.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasMoveTool.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { setTool } from 'features/canvas/store/canvasSlice'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasProcessingButtons.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasProcessingButtons.tsx index 31c8e6df64..3825fcd7ca 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasProcessingButtons.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasProcessingButtons.tsx @@ -1,5 +1,6 @@ import { Flex } from '@chakra-ui/layout'; -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice'; import CancelButton from 'features/options/components/ProcessButtons/CancelButton'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetCanvas.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetCanvas.tsx index f1a1e1f3ef..5a1faace6c 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetCanvas.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetCanvas.tsx @@ -1,4 +1,4 @@ -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetView.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetView.tsx index ac9f2b2cfb..eeeede1991 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetView.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasResetView.tsx @@ -1,4 +1,4 @@ -import { useAppDispatch } from 'app/store'; +import { useAppDispatch } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { resetCanvasView } from 'features/canvas/store/canvasSlice'; import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasSaveToGallery.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasSaveToGallery.tsx index 7eeb2fb5ab..68fc2e4ca7 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasSaveToGallery.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasSaveToGallery.tsx @@ -1,4 +1,5 @@ -import { RootState, useAppDispatch, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import IAIIconButton from 'common/components/IAIIconButton'; import { isStagingSelector } from 'features/canvas/store/canvasSelectors'; import { mergeAndUploadCanvas } from 'features/canvas/store/thunks/mergeAndUploadCanvas'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx index 10680e3799..bbcfa2e65f 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx @@ -6,7 +6,7 @@ import { setBrushColor, setTool, } from 'features/canvas/store/canvasSlice'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import _ from 'lodash'; import IAIIconButton from 'common/components/IAIIconButton'; import { diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbarBeta.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbarBeta.tsx index 6e95150916..7b4ecdb93f 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbarBeta.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbarBeta.tsx @@ -14,7 +14,8 @@ import UnifiedCanvasDownloadImage from './UnifiedCanvasToolbar/UnifiedCanvasDown import UnifiedCanvasFileUploader from './UnifiedCanvasToolbar/UnifiedCanvasFileUploader'; import UnifiedCanvasResetCanvas from './UnifiedCanvasToolbar/UnifiedCanvasResetCanvas'; import UnifiedCanvasProcessingButtons from './UnifiedCanvasToolbar/UnifiedCanvasProcessingButtons'; -import { RootState, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; const UnifiedCanvasToolbarBeta = () => { const shouldShowOptionsPanel = useAppSelector( diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasDisplay.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasDisplay.tsx index 8b845a4bb3..01ae2bfbb9 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasDisplay.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasDisplay.tsx @@ -3,7 +3,7 @@ import { createSelector } from '@reduxjs/toolkit'; import IAICanvasResizer from 'features/canvas/components/IAICanvasResizer'; import _ from 'lodash'; import { useLayoutEffect } from 'react'; -import { useAppDispatch, useAppSelector } from 'app/store'; +import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice'; import IAICanvas from 'features/canvas/components/IAICanvas'; import IAICanvasOutpaintingControls from 'features/canvas/components/IAICanvasToolbar/IAICanvasToolbar'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasWorkarea.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasWorkarea.tsx index f0116dc344..cec5d1f303 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasWorkarea.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasWorkarea.tsx @@ -1,7 +1,8 @@ import UnifiedCanvasPanel from './UnifiedCanvasPanel'; import UnifiedCanvasDisplay from './UnifiedCanvasDisplay'; import InvokeWorkarea from 'features/tabs/components/InvokeWorkarea'; -import { RootState, useAppSelector } from 'app/store'; +import { RootState } from 'app/store'; +import { useAppSelector } from 'app/storeHooks'; import UnifiedCanvasDisplayBeta from './UnifiedCanvasBeta/UnifiedCanvasDisplayBeta'; export default function UnifiedCanvasWorkarea() { diff --git a/frontend/src/features/tabs/tabMap.ts b/frontend/src/features/tabs/tabMap.ts new file mode 100644 index 0000000000..74d63d2df0 --- /dev/null +++ b/frontend/src/features/tabs/tabMap.ts @@ -0,0 +1,10 @@ +export const tabMap = [ + 'txt2img', + 'img2img', + 'unifiedCanvas', + 'nodes', + 'postprocess', + 'training', +] as const; + +export type InvokeTabName = typeof tabMap[number]; diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 02350c73bd..8bfa912def 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -6,9 +6,7 @@ import createCache from '@emotion/cache'; import { store } from './app/store'; import { Provider } from 'react-redux'; import { PersistGate } from 'redux-persist/integration/react'; -import { persistStore } from 'redux-persist'; - -export const persistor = persistStore(store); +import { persistor } from './persistor'; import Loading from './Loading'; import App from './app/App'; diff --git a/frontend/src/persistor.ts b/frontend/src/persistor.ts new file mode 100644 index 0000000000..e90de9ac75 --- /dev/null +++ b/frontend/src/persistor.ts @@ -0,0 +1,4 @@ +import { persistStore } from 'redux-persist'; +import { store } from 'app/store'; + +export const persistor = persistStore(store); diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 3c5cf488b1..0691ecf3d2 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -162,6 +162,11 @@ chalk "^2.0.0" js-tokens "^4.0.0" +"@babel/parser@^7.0.0": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.5.tgz#7f3c7335fe417665d929f34ae5dceae4c04015e8" + integrity sha512-r27t/cy/m9uKLXQNWWebeCUHgnAZq0CpG1OwKRxzJMP1vpSU4bSIK2hq+/cp0bQxetkXx38n09rNu8jVkcK/zA== + "@babel/parser@^7.18.10", "@babel/parser@^7.20.1", "@babel/parser@^7.20.2": version "7.20.2" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.2.tgz#9aeb9b92f64412b5f81064d46f6a1ac0881337f4" @@ -1691,6 +1696,11 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + "@types/lodash.mergewith@4.6.6": version "4.6.6" resolved "https://registry.yarnpkg.com/@types/lodash.mergewith/-/lodash.mergewith-4.6.6.tgz#c4698f5b214a433ff35cb2c75ee6ec7f99d79f10" @@ -1811,6 +1821,11 @@ debug "^4.3.4" tsutils "^3.21.0" +"@typescript-eslint/types@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-4.33.0.tgz#a1e59036a3b53ae8430ceebf2a919dc7f9af6d72" + integrity sha512-zKp7CjQzLQImXEpLt2BUw1tvOMPfNoTAfb8l51evhYbOEEzdWyQNmHWWGPR6hwKJDAi+1VXSBmnhL9kyVTTOuQ== + "@typescript-eslint/types@5.44.0": version "5.44.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.44.0.tgz#f3f0b89aaff78f097a2927fe5688c07e786a0241" @@ -1829,6 +1844,19 @@ semver "^7.3.7" tsutils "^3.21.0" +"@typescript-eslint/typescript-estree@^4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-4.33.0.tgz#0dfb51c2908f68c5c08d82aefeaf166a17c24609" + integrity sha512-rkWRY1MPFzjwnEVHsxGemDzqqddw2QbTJlICPD9p9I9LfsO8fdmfQPOX3uKfUaGRDFJbfrtm/sXhVXN4E+bzCA== + dependencies: + "@typescript-eslint/types" "4.33.0" + "@typescript-eslint/visitor-keys" "4.33.0" + debug "^4.3.1" + globby "^11.0.3" + is-glob "^4.0.1" + semver "^7.3.5" + tsutils "^3.21.0" + "@typescript-eslint/utils@5.44.0": version "5.44.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.44.0.tgz#d733da4d79d6c30f1a68b531cdda1e0c1f00d52d" @@ -1843,6 +1871,14 @@ eslint-utils "^3.0.0" semver "^7.3.7" +"@typescript-eslint/visitor-keys@4.33.0": + version "4.33.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-4.33.0.tgz#2a22f77a41604289b7a186586e9ec48ca92ef1dd" + integrity sha512-uqi/2aSz9g2ftcHWf8uLPJA70rUv6yuMW5Bohw+bwcuzaxQIHaKFZCKGoGXIrc9vkTJ3+0txM73K0Hq3d5wgIg== + dependencies: + "@typescript-eslint/types" "4.33.0" + eslint-visitor-keys "^2.0.0" + "@typescript-eslint/visitor-keys@5.44.0": version "5.44.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.44.0.tgz#10740dc28902bb903d12ee3a005cc3a70207d433" @@ -1955,6 +1991,11 @@ anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +app-module-path@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" + integrity sha512-gkco+qxENJV+8vFcDiiFhuoSvRXb2a/QPqpSoWhVz829VNJfOTnELbBmPmNKFxf3xdNnw4DWCkzkDaavcX/1YQ== + argparse@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" @@ -1972,6 +2013,16 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +ast-module-types@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/ast-module-types/-/ast-module-types-2.7.1.tgz#3f7989ef8dfa1fdb82dfe0ab02bdfc7c77a57dd3" + integrity sha512-Rnnx/4Dus6fn7fTqdeLEAn5vUll5w7/vts0RN608yFa6si/rDOUonlIIiwugHBFWjylHjxm9owoSZn71KwG4gw== + +ast-module-types@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ast-module-types/-/ast-module-types-3.0.0.tgz#9a6d8a80f438b6b8fe4995699d700297f398bf81" + integrity sha512-CMxMCOCS+4D+DkOQfuZf+vLrSEmY/7xtORwdxs4wtcC1wVgvk2MqFFTwQCFhvWsI4KPU9lcWXPI8DgRiz+xetQ== + attr-accept@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" @@ -1991,6 +2042,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + base64id@2.0.0, base64id@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/base64id/-/base64id-2.0.0.tgz#2770ac6bc47d312af97a8bf9a634342e0cd25cb6" @@ -2001,6 +2057,15 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== +bl@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -2031,6 +2096,14 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== +buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -2050,7 +2123,7 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.2: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2078,6 +2151,23 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +cli-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" + integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== + dependencies: + restore-cursor "^3.1.0" + +cli-spinners@^2.5.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" + integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== + +clone@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" + integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== + color-convert@^1.9.0: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" @@ -2097,12 +2187,12 @@ color-name@1.1.3: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== -color-name@~1.1.4: +color-name@^1.1.4, color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -commander@^2.20.0: +commander@^2.16.0, commander@^2.20.0, commander@^2.20.3, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== @@ -2112,6 +2202,16 @@ commander@^4.0.0: resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" + integrity sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw== + +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg== + compute-scroll-into-view@1.0.14: version "1.0.14" resolved "https://registry.yarnpkg.com/compute-scroll-into-view/-/compute-scroll-into-view-1.0.14.tgz#80e3ebb25d6aa89f42e533956cb4b16a04cfe759" @@ -2200,23 +2300,130 @@ dateformat@^5.0.3: resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-5.0.3.tgz#fe2223eff3cc70ce716931cb3038b59a9280696e" integrity sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA== -debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: +debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1, debug@~4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" -deep-is@^0.1.3: +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@^0.1.3, deep-is@~0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== +defaults@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.4.tgz#b0b02062c1e2aa62ff5d9528f0f98baa90978d7a" + integrity sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A== + dependencies: + clone "^1.0.2" + +dependency-tree@^8.1.1: + version "8.1.2" + resolved "https://registry.yarnpkg.com/dependency-tree/-/dependency-tree-8.1.2.tgz#c9e652984f53bd0239bc8a3e50cbd52f05b2e770" + integrity sha512-c4CL1IKxkKng0oT5xrg4uNiiMVFqTGOXqHSFx7XEFdgSsp6nw3AGGruICppzJUrfad/r7GLqt26rmWU4h4j39A== + dependencies: + commander "^2.20.3" + debug "^4.3.1" + filing-cabinet "^3.0.1" + precinct "^8.0.0" + typescript "^3.9.7" + detect-node-es@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== +detective-amd@^3.1.0: + version "3.1.2" + resolved "https://registry.yarnpkg.com/detective-amd/-/detective-amd-3.1.2.tgz#bf55eb5291c218b76d6224a3d07932ef13a9a357" + integrity sha512-jffU26dyqJ37JHR/o44La6CxtrDf3Rt9tvd2IbImJYxWKTMdBjctp37qoZ6ZcY80RHg+kzWz4bXn39e4P7cctQ== + dependencies: + ast-module-types "^3.0.0" + escodegen "^2.0.0" + get-amd-module-type "^3.0.0" + node-source-walk "^4.2.0" + +detective-cjs@^3.1.1: + version "3.1.3" + resolved "https://registry.yarnpkg.com/detective-cjs/-/detective-cjs-3.1.3.tgz#50e107d67b37f459b0ec02966ceb7e20a73f268b" + integrity sha512-ljs7P0Yj9MK64B7G0eNl0ThWSYjhAaSYy+fQcpzaKalYl/UoQBOzOeLCSFEY1qEBhziZ3w7l46KG/nH+s+L7BQ== + dependencies: + ast-module-types "^3.0.0" + node-source-walk "^4.0.0" + +detective-es6@^2.2.0, detective-es6@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/detective-es6/-/detective-es6-2.2.2.tgz#ee5f880981d9fecae9a694007029a2f6f26d8d28" + integrity sha512-eZUKCUsbHm8xoeoCM0z6JFwvDfJ5Ww5HANo+jPR7AzkFpW9Mun3t/TqIF2jjeWa2TFbAiGaWESykf2OQp3oeMw== + dependencies: + node-source-walk "^4.0.0" + +detective-less@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/detective-less/-/detective-less-1.0.2.tgz#a68af9ca5f69d74b7d0aa190218b211d83b4f7e3" + integrity sha512-Rps1xDkEEBSq3kLdsdnHZL1x2S4NGDcbrjmd4q+PykK5aJwDdP5MBgrJw1Xo+kyUHuv3JEzPqxr+Dj9ryeDRTA== + dependencies: + debug "^4.0.0" + gonzales-pe "^4.2.3" + node-source-walk "^4.0.0" + +detective-postcss@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detective-postcss/-/detective-postcss-4.0.0.tgz#24e69b465e5fefe7a6afd05f7e894e34595dbf51" + integrity sha512-Fwc/g9VcrowODIAeKRWZfVA/EufxYL7XfuqJQFroBKGikKX83d2G7NFw6kDlSYGG3LNQIyVa+eWv1mqre+v4+A== + dependencies: + debug "^4.1.1" + is-url "^1.2.4" + postcss "^8.1.7" + postcss-values-parser "^2.0.1" + +detective-postcss@^5.0.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/detective-postcss/-/detective-postcss-5.1.3.tgz#773314cd017621b7d382be81331eb0c7abbe8cc3" + integrity sha512-Wo7PUpF6wqeT1aRgajdyIdDRjFFJVxlXPRAlT1aankH/RVOgrJuEZFZ4ABxYXdzaRPO5Lkg8rHxsxpLnxdJIYA== + dependencies: + is-url "^1.2.4" + postcss "^8.4.6" + postcss-values-parser "^5.0.0" + +detective-sass@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/detective-sass/-/detective-sass-3.0.2.tgz#e0f35aac79a4d2f6409c284d95b8f7ecd5973afd" + integrity sha512-DNVYbaSlmti/eztFGSfBw4nZvwsTaVXEQ4NsT/uFckxhJrNRFUh24d76KzoCC3aarvpZP9m8sC2L1XbLej4F7g== + dependencies: + gonzales-pe "^4.3.0" + node-source-walk "^4.0.0" + +detective-scss@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/detective-scss/-/detective-scss-2.0.2.tgz#7d2a642616d44bf677963484fa8754d9558b8235" + integrity sha512-hDWnWh/l0tht/7JQltumpVea/inmkBaanJUcXRB9kEEXVwVUMuZd6z7eusQ6GcBFrfifu3pX/XPyD7StjbAiBg== + dependencies: + gonzales-pe "^4.3.0" + node-source-walk "^4.0.0" + +detective-stylus@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detective-stylus/-/detective-stylus-1.0.3.tgz#20a702936c9fd7d4203fd7a903314b5dd43ac713" + integrity sha512-4/bfIU5kqjwugymoxLXXLltzQNeQfxGoLm2eIaqtnkWxqbhap9puDVpJPVDx96hnptdERzS5Cy6p9N8/08A69Q== + +detective-typescript@^7.0.0: + version "7.0.2" + resolved "https://registry.yarnpkg.com/detective-typescript/-/detective-typescript-7.0.2.tgz#c6e00b4c28764741ef719662250e6b014a5f3c8e" + integrity sha512-unqovnhxzvkCz3m1/W4QW4qGsvXCU06aU2BAm8tkza+xLnp9SOFnob2QsTxUv5PdnQKfDvWcv9YeOeFckWejwA== + dependencies: + "@typescript-eslint/typescript-estree" "^4.33.0" + ast-module-types "^2.7.1" + node-source-walk "^4.2.0" + typescript "^3.9.10" + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -2281,6 +2488,14 @@ engine.io@~6.2.1: engine.io-parser "~5.0.3" ws "~8.2.3" +enhanced-resolve@^5.8.3: + version "5.12.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634" + integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -2431,6 +2646,18 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escodegen@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" + integrity sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw== + dependencies: + esprima "^4.0.1" + estraverse "^5.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + eslint-plugin-prettier@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz#651cbb88b1dab98bfd42f017a12fa6b2d993f94b" @@ -2530,6 +2757,11 @@ espree@^9.4.0: acorn-jsx "^5.3.2" eslint-visitor-keys "^3.3.0" +esprima@^4.0.0, esprima@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + esquery@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" @@ -2603,7 +2835,7 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== -fast-levenshtein@^2.0.6: +fast-levenshtein@^2.0.6, fast-levenshtein@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== @@ -2629,6 +2861,25 @@ file-selector@^0.6.0: dependencies: tslib "^2.4.0" +filing-cabinet@^3.0.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/filing-cabinet/-/filing-cabinet-3.3.0.tgz#365294d2d3d6ab01b4273e62fb6d23388a70cc0f" + integrity sha512-Tnbpbme1ONaHXV5DGcw0OFpcfP3p2itRf5VXO1bguBXdIewDbK6ZFBK//DGKM0BuCzaQLQNY4f5gljzxY1VCUw== + dependencies: + app-module-path "^2.2.0" + commander "^2.20.3" + debug "^4.3.3" + enhanced-resolve "^5.8.3" + is-relative-path "^1.0.2" + module-definition "^3.3.1" + module-lookup-amd "^7.0.1" + resolve "^1.21.0" + resolve-dependency-path "^2.0.0" + sass-lookup "^3.0.0" + stylus-lookup "^3.0.1" + tsconfig-paths "^3.10.1" + typescript "^3.9.7" + fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -2669,6 +2920,11 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +flatten@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.3.tgz#c1283ac9f27b368abc1e36d1ff7b04501a30356b" + integrity sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg== + focus-lock@^0.11.2: version "0.11.3" resolved "https://registry.yarnpkg.com/focus-lock/-/focus-lock-0.11.3.tgz#c094e8f109d780f56038abdeec79328fd56b627f" @@ -2738,11 +2994,24 @@ gensync@^1.0.0-beta.2: resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== +get-amd-module-type@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/get-amd-module-type/-/get-amd-module-type-3.0.2.tgz#46550cee2b8e1fa4c3f2c8a5753c36990aa49ab0" + integrity sha512-PcuKwB8ouJnKuAPn6Hk3UtdfKoUV3zXRqVEvj8XGIXqjWfgd1j7QGdXy5Z9OdQfzVt1Sk29HVe/P+X74ccOuqw== + dependencies: + ast-module-types "^3.0.0" + node-source-walk "^4.2.2" + get-nonce@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3" integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q== +get-own-enumerable-property-symbols@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" + integrity sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g== + glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -2774,7 +3043,7 @@ glob@7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.1.3: +glob@^7.1.3, glob@^7.1.6: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -2798,7 +3067,7 @@ globals@^13.15.0: dependencies: type-fest "^0.20.2" -globby@^11.1.0: +globby@^11.0.3, globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -2815,7 +3084,14 @@ globrex@^0.1.2: resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098" integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg== -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: +gonzales-pe@^4.2.3, gonzales-pe@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/gonzales-pe/-/gonzales-pe-4.3.0.tgz#fe9dec5f3c557eead09ff868c65826be54d067b3" + integrity sha512-otgSPpUmdWJ43VXyiNgEYE4luzHCL2pz4wQ0OnDluC6Eg4Ko3Vexy/SrSynglw/eR+OhkzmqFCZa/OFa/RgAOQ== + dependencies: + minimist "^1.2.5" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.4: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== @@ -2825,6 +3101,13 @@ grapheme-splitter@^1.0.4: resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== +graphviz@0.0.9: + version "0.0.9" + resolved "https://registry.yarnpkg.com/graphviz/-/graphviz-0.0.9.tgz#0bbf1df588c6a92259282da35323622528c4bbc4" + integrity sha512-SmoY2pOtcikmMCqCSy2NO1YsRfu9OO0wpTlOYW++giGjfX1a6gax/m1Fo8IdUd0/3H15cTOfR1SMKwohj4LKsg== + dependencies: + temp "~0.4.0" + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -2854,6 +3137,11 @@ hoist-non-react-statics@^3.3.0, hoist-non-react-statics@^3.3.1, hoist-non-react- dependencies: react-is "^16.7.0" +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ignore@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" @@ -2882,6 +3170,11 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== +indexes-of@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" + integrity sha512-bup+4tap3Hympa+JBJUG7XuOsdNQ6fxt0MHyXMKuLBKn0OqsTfvUxkUrroEX1+B2VsSHvCjiIcZVxRtYa4nllA== + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -2890,11 +3183,16 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2: +inherits@2, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +ini@~1.3.0: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" @@ -2945,16 +3243,51 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-number@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-obj@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" + integrity sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg== + is-path-inside@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== +is-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" + integrity sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA== + +is-relative-path@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-relative-path/-/is-relative-path-1.0.2.tgz#091b46a0d67c1ed0fe85f1f8cfdde006bb251d46" + integrity sha512-i1h+y50g+0hRbBD+dbnInl3JlJ702aar58snAeX+MxBAPvzXGej7sYoPMhlnykabt0ZzCJNBEyzMlekuQZN7fA== + +is-unicode-supported@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== + +is-url-superb@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-url-superb/-/is-url-superb-4.0.0.tgz#b54d1d2499bb16792748ac967aa3ecb41a33a8c2" + integrity sha512-GI+WjezhPPcbM+tqE9LnmsY5qqjwHzTvjJ36wxYX5ujNXefSUJ/T17r5bqDV8yLhcgB59KTPNOc9O9cmHTPWsA== + +is-url@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52" + integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww== + is-wsl@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" @@ -3011,6 +3344,13 @@ json-stable-stringify-without-jsonify@^1.0.1: resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" @@ -3043,6 +3383,14 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA== + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" @@ -3070,6 +3418,14 @@ lodash@4.17.21, lodash@^4.17.21: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +log-symbols@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -3084,6 +3440,34 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" +madge@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/madge/-/madge-5.0.1.tgz#2096d9006558ea0669b3ade89c2cda708a24e22b" + integrity sha512-krmSWL9Hkgub74bOjnjWRoFPAJvPwSG6Dbta06qhWOq6X/n/FPzO3ESZvbFYVIvG2g4UHXvCJN1b+RZLaSs9nA== + dependencies: + chalk "^4.1.1" + commander "^7.2.0" + commondir "^1.0.1" + debug "^4.3.1" + dependency-tree "^8.1.1" + detective-amd "^3.1.0" + detective-cjs "^3.1.1" + detective-es6 "^2.2.0" + detective-less "^1.0.2" + detective-postcss "^5.0.0" + detective-sass "^3.0.1" + detective-scss "^2.0.1" + detective-stylus "^1.0.0" + detective-typescript "^7.0.0" + graphviz "0.0.9" + ora "^5.4.1" + pluralize "^8.0.0" + precinct "^8.1.0" + pretty-ms "^7.0.1" + rc "^1.2.7" + typescript "^3.9.5" + walkdir "^0.4.1" + magic-string@^0.26.7: version "0.26.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.7.tgz#caf7daf61b34e9982f8228c4527474dac8981d6f" @@ -3128,6 +3512,11 @@ mime-types@~2.1.34: dependencies: mime-db "1.52.0" +mimic-fn@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -3135,11 +3524,30 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.6: +minimist@^1.2.0, minimist@^1.2.5, minimist@^1.2.6: version "1.2.7" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== +module-definition@^3.3.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/module-definition/-/module-definition-3.4.0.tgz#953a3861f65df5e43e80487df98bb35b70614c2b" + integrity sha512-XxJ88R1v458pifaSkPNLUTdSPNVGMP2SXVncVmApGO+gAfrLANiYe6JofymCzVceGOMwQE2xogxBSc8uB7XegA== + dependencies: + ast-module-types "^3.0.0" + node-source-walk "^4.0.0" + +module-lookup-amd@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/module-lookup-amd/-/module-lookup-amd-7.0.1.tgz#d67c1a93f2ff8e38b8774b99a638e9a4395774b2" + integrity sha512-w9mCNlj0S8qviuHzpakaLVc+/7q50jl9a/kmJ/n8bmXQZgDPkQHnPBb8MUOYh3WpAYkXuNc2c+khsozhIp/amQ== + dependencies: + commander "^2.8.1" + debug "^4.1.0" + glob "^7.1.6" + requirejs "^2.3.5" + requirejs-config-file "^4.0.0" + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -3189,6 +3597,13 @@ node-releases@^2.0.6: resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== +node-source-walk@^4.0.0, node-source-walk@^4.2.0, node-source-walk@^4.2.2: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-source-walk/-/node-source-walk-4.3.0.tgz#8336b56cfed23ac5180fe98f1e3bb6b11fd5317c" + integrity sha512-8Q1hXew6ETzqKRAs3jjLioSxNfT1cx74ooiF8RlAONwVMcfq+UdzLC2eB5qcPldUxaE5w3ytLkrmV1TGddhZTA== + dependencies: + "@babel/parser" "^7.0.0" + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" @@ -3206,6 +3621,13 @@ once@^1.3.0: dependencies: wrappy "1" +onetime@^5.1.0: + version "5.1.2" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" + integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== + dependencies: + mimic-fn "^2.1.0" + open@^7.4.2: version "7.4.2" resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" @@ -3214,6 +3636,18 @@ open@^7.4.2: is-docker "^2.0.0" is-wsl "^2.1.1" +optionator@^0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" + integrity sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA== + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.6" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + word-wrap "~1.2.3" + optionator@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" @@ -3226,6 +3660,21 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +ora@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3262,6 +3711,11 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse-ms@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/parse-ms/-/parse-ms-2.1.0.tgz#348565a753d4391fa524029956b172cb7753097d" + integrity sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA== + patch-package@^6.5.0: version "6.5.0" resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.5.0.tgz#feb058db56f0005da59cfa316488321de585e88a" @@ -3334,6 +3788,11 @@ pirates@^4.0.1: resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== +pluralize@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" + integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== + popmotion@11.0.5: version "11.0.5" resolved "https://registry.yarnpkg.com/popmotion/-/popmotion-11.0.5.tgz#8e3e014421a0ffa30ecd722564fd2558954e1f7d" @@ -3344,6 +3803,33 @@ popmotion@11.0.5: style-value-types "5.1.2" tslib "2.4.0" +postcss-values-parser@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-2.0.1.tgz#da8b472d901da1e205b47bdc98637b9e9e550e5f" + integrity sha512-2tLuBsA6P4rYTNKCXYG/71C7j1pU6pK503suYOmn4xYrQIzW+opD+7FAFNuGSdZC/3Qfy334QbeMu7MEb8gOxg== + dependencies: + flatten "^1.0.2" + indexes-of "^1.0.1" + uniq "^1.0.1" + +postcss-values-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/postcss-values-parser/-/postcss-values-parser-5.0.0.tgz#10c61ac3f488e4de25746b829ea8d8894e9ac3d2" + integrity sha512-2viDDjMMrt21W2izbeiJxl3kFuD/+asgB0CBwPEgSyhCmBnDIa/y+pLaoyX+q3I3DHH0oPPL3cgjVTQvlS1Maw== + dependencies: + color-name "^1.1.4" + is-url-superb "^4.0.0" + quote-unquote "^1.0.0" + +postcss@^8.1.7, postcss@^8.4.6: + version "8.4.20" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.20.tgz#64c52f509644cecad8567e949f4081d98349dc56" + integrity sha512-6Q04AXR1212bXr5fh03u8aAwbLxAQNGQ/Q1LNa0VfOI06ZAlhPHtQvE4OIdpj4kLThXilalPnmDSOD65DcHt+g== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + postcss@^8.4.18: version "8.4.19" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.19.tgz#61178e2add236b17351897c8bcc0b4c8ecab56fc" @@ -3358,11 +3844,35 @@ postinstall-postinstall@^2.1.0: resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3" integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ== +precinct@^8.0.0, precinct@^8.1.0: + version "8.3.1" + resolved "https://registry.yarnpkg.com/precinct/-/precinct-8.3.1.tgz#94b99b623df144eed1ce40e0801c86078466f0dc" + integrity sha512-pVppfMWLp2wF68rwHqBIpPBYY8Kd12lDhk8LVQzOwqllifVR15qNFyod43YLyFpurKRZQKnE7E4pofAagDOm2Q== + dependencies: + commander "^2.20.3" + debug "^4.3.3" + detective-amd "^3.1.0" + detective-cjs "^3.1.1" + detective-es6 "^2.2.1" + detective-less "^1.0.2" + detective-postcss "^4.0.0" + detective-sass "^3.0.1" + detective-scss "^2.0.1" + detective-stylus "^1.0.0" + detective-typescript "^7.0.0" + module-definition "^3.3.1" + node-source-walk "^4.2.0" + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== + prettier-linter-helpers@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b" @@ -3370,6 +3880,13 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" +pretty-ms@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" + integrity sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q== + dependencies: + parse-ms "^2.1.0" + prop-types@^15.6.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -3396,6 +3913,21 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== +quote-unquote@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/quote-unquote/-/quote-unquote-1.0.0.tgz#67a9a77148effeaf81a4d428404a710baaac8a0b" + integrity sha512-twwRO/ilhlG/FIgYeKGFqyHhoEhqgnKVkcmqMKi2r524gz3ZbDTcyFt38E9xjJI2vT+KbRNHVbnJ/e0I25Azwg== + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + re-resizable@^6.9.9: version "6.9.9" resolved "https://registry.yarnpkg.com/re-resizable/-/re-resizable-6.9.9.tgz#99e8b31c67a62115dc9c5394b7e55892265be216" @@ -3561,6 +4093,15 @@ react@^18.2.0: dependencies: loose-envify "^1.1.0" +readable-stream@^3.4.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + readdirp@~3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" @@ -3611,17 +4152,35 @@ regexpp@^3.2.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== +requirejs-config-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/requirejs-config-file/-/requirejs-config-file-4.0.0.tgz#4244da5dd1f59874038cc1091d078d620abb6ebc" + integrity sha512-jnIre8cbWOyvr8a5F2KuqBnY+SDA4NXr/hzEZJG79Mxm2WiFQz2dzhC8ibtPJS7zkmBEl1mxSwp5HhC1W4qpxw== + dependencies: + esprima "^4.0.0" + stringify-object "^3.2.1" + +requirejs@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.6.tgz#e5093d9601c2829251258c0b9445d4d19fa9e7c9" + integrity sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg== + reselect@^4.1.7: version "4.1.7" resolved "https://registry.yarnpkg.com/reselect/-/reselect-4.1.7.tgz#56480d9ff3d3188970ee2b76527bd94a95567a42" integrity sha512-Zu1xbUt3/OPwsXL46hvOOoQrap2azE7ZQbokq61BQfiXvhewsKDwhMeZjTX9sX0nvw1t/U5Audyn1I9P/m9z0A== +resolve-dependency-path@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-dependency-path/-/resolve-dependency-path-2.0.0.tgz#11700e340717b865d216c66cabeb4a2a3c696736" + integrity sha512-DIgu+0Dv+6v2XwRaNWnumKu7GPufBBOr5I1gRPJHkvghrfCGOooJODFvgFimX/KRxk9j0whD2MnKHzM1jYvk9w== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve@^1.19.0, resolve@^1.22.1: +resolve@^1.19.0, resolve@^1.21.0, resolve@^1.22.1: version "1.22.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== @@ -3630,6 +4189,14 @@ resolve@^1.19.0, resolve@^1.22.1: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +restore-cursor@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" + integrity sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA== + dependencies: + onetime "^5.1.0" + signal-exit "^3.0.2" + reusify@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" @@ -3663,6 +4230,18 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" +safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +sass-lookup@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/sass-lookup/-/sass-lookup-3.0.0.tgz#3b395fa40569738ce857bc258e04df2617c48cac" + integrity sha512-TTsus8CfFRn1N44bvdEai1no6PqdmDiQUiqW5DlpmtT+tYnIt1tXtDIph5KA1efC+LmioJXSnCtUVpcK9gaKIg== + dependencies: + commander "^2.16.0" + sass@^1.55.0: version "1.56.1" resolved "https://registry.yarnpkg.com/sass/-/sass-1.56.1.tgz#94d3910cd468fd075fa87f5bb17437a0b617d8a7" @@ -3689,7 +4268,7 @@ semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.3.7: +semver@^7.3.5, semver@^7.3.7: version "7.3.8" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== @@ -3720,6 +4299,11 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +signal-exit@^3.0.2: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + slash@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" @@ -3783,7 +4367,7 @@ source-map@^0.5.7: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== -source-map@^0.6.0: +source-map@^0.6.0, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -3812,6 +4396,22 @@ string-argv@^0.1.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.1.2.tgz#c5b7bc03fb2b11983ba3a72333dd0559e77e4738" integrity sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA== +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== + dependencies: + safe-buffer "~5.2.0" + +stringify-object@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" + integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw== + dependencies: + get-own-enumerable-property-symbols "^3.0.0" + is-obj "^1.0.1" + is-regexp "^1.0.0" + strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -3829,6 +4429,11 @@ strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== + style-value-types@5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-5.1.2.tgz#6be66b237bd546048a764883528072ed95713b62" @@ -3842,6 +4447,14 @@ stylis@4.1.3: resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7" integrity sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA== +stylus-lookup@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/stylus-lookup/-/stylus-lookup-3.0.2.tgz#c9eca3ff799691020f30b382260a67355fefdddd" + integrity sha512-oEQGHSjg/AMaWlKe7gqsnYzan8DLcGIHe0dUaFkucZZ14z4zjENRlQMCHT4FNsiWnJf17YN9OvrCfCoi7VvOyg== + dependencies: + commander "^2.8.1" + debug "^4.1.0" + sucrase@^3.20.3: version "3.29.0" resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.29.0.tgz#3207c5bc1b980fdae1e539df3f8a8a518236da7d" @@ -3878,6 +4491,16 @@ systemjs@^6.13.0: resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-6.13.0.tgz#7b28e74b44352e1650e8652499f42de724c3fc7f" integrity sha512-P3cgh2bpaPvAO2NE3uRp/n6hmk4xPX4DQf+UzTlCAycssKdqhp6hjw+ENWe+aUS7TogKRFtptMosTSFeC6R55g== +tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + +temp@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60" + integrity sha512-IsFisGgDKk7qzK9erMIkQe/XwiSUdac7z3wYOsjcLkhPBy3k1SlvLoIh2dAHIlEpgA971CgguMrx9z8fFg7tSA== + terser@^5.16.1: version "5.16.1" resolved "https://registry.yarnpkg.com/terser/-/terser-5.16.1.tgz#5af3bc3d0f24241c7fb2024199d5c461a1075880" @@ -3957,6 +4580,16 @@ tsc-watch@^5.0.3: string-argv "^0.1.1" strip-ansi "^6.0.0" +tsconfig-paths@^3.10.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" + integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.6" + strip-bom "^3.0.0" + tsconfig-paths@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz#f8ef7d467f08ae3a695335bf1ece088c5538d2c1" @@ -3995,16 +4628,33 @@ type-check@^0.4.0, type-check@~0.4.0: dependencies: prelude-ls "^1.2.1" +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg== + dependencies: + prelude-ls "~1.1.2" + type-fest@^0.20.2: version "0.20.2" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== +typescript@^3.9.10, typescript@^3.9.5, typescript@^3.9.7: + version "3.9.10" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.10.tgz#70f3910ac7a51ed6bef79da7800690b19bf778b8" + integrity sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q== + typescript@^4.6.4: version "4.9.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db" integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA== +uniq@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/uniq/-/uniq-1.0.1.tgz#b31c5ae8254844a3a8281541ce2b04b865a734ff" + integrity sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA== + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -4055,6 +4705,11 @@ use-sync-external-store@^1.0.0: resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== +util-deprecate@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== + uuid@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.0.tgz#592f550650024a38ceb0c562f2f6aa435761efb5" @@ -4096,6 +4751,18 @@ vite@^3.0.7: optionalDependencies: fsevents "~2.3.2" +walkdir@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.4.1.tgz#dc119f83f4421df52e3061e514228a2db20afa39" + integrity sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ== + +wcwidth@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" + integrity sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg== + dependencies: + defaults "^1.0.3" + which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -4110,7 +4777,7 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -word-wrap@^1.2.3: +word-wrap@^1.2.3, word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== From 9b9e27649101c1abd85e7cea37fba770a02c2507 Mon Sep 17 00:00:00 2001 From: Kaspar Emanuel Date: Wed, 14 Dec 2022 22:35:32 +0000 Subject: [PATCH 12/26] Add lint-frontend github actions workflow --- .github/workflows/lint-frontend.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/lint-frontend.yml diff --git a/.github/workflows/lint-frontend.yml b/.github/workflows/lint-frontend.yml new file mode 100644 index 0000000000..41c4e7a374 --- /dev/null +++ b/.github/workflows/lint-frontend.yml @@ -0,0 +1,24 @@ +name: Lint frontend + +on: + push: + paths: + - 'frontend/**' + +defaults: + run: + working-directory: frontend + +jobs: + lint-frontend: + runs-on: ubuntu-22.04 + steps: + - name: Setup Node 18 + uses: actions/setup-node@v2 + with: + node-version: '18' + - uses: actions/checkout@v2 + - run: 'yarn install' + - run: 'yarn tsc' + - run: 'yarn run madge' + - run: 'yarn run lint --max-warnings=22' From 6e0f3475b44fa22ccbdd69e32e9a73a17e2b4a21 Mon Sep 17 00:00:00 2001 From: Kaspar Emanuel Date: Thu, 15 Dec 2022 01:32:59 +0000 Subject: [PATCH 13/26] Reduce frontend eslint warnings to 0 --- .github/workflows/lint-frontend.yml | 2 +- frontend/.eslintrc.cjs | 9 ++- frontend/src/app/socketio/emitters.ts | 4 +- frontend/src/app/socketio/listeners.ts | 10 ++- frontend/src/common/components/IAISlider.tsx | 4 +- .../common/components/radix-ui/IAISlider.tsx | 1 - .../common/components/radix-ui/IAITooltip.tsx | 2 +- .../common/hooks/useClickOutsideWatcher.ts | 3 +- .../src/common/util/parameterTranslation.ts | 74 +++++++++++++++++-- .../lightbox/components/ReactPanZoom.tsx | 2 +- .../UnifiedCanvasDisplayBeta.tsx | 1 - .../UnifiedCanvasToolSelect.tsx | 1 - frontend/src/global.d.ts | 6 +- 13 files changed, 95 insertions(+), 24 deletions(-) diff --git a/.github/workflows/lint-frontend.yml b/.github/workflows/lint-frontend.yml index 41c4e7a374..c2eeeb9a08 100644 --- a/.github/workflows/lint-frontend.yml +++ b/.github/workflows/lint-frontend.yml @@ -21,4 +21,4 @@ jobs: - run: 'yarn install' - run: 'yarn tsc' - run: 'yarn run madge' - - run: 'yarn run lint --max-warnings=22' + - run: 'yarn run lint --max-warnings=0' diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs index ba77c4481e..11da47aa86 100644 --- a/frontend/.eslintrc.cjs +++ b/frontend/.eslintrc.cjs @@ -1,6 +1,13 @@ module.exports = { - extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:react-hooks/recommended'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + ], parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint', 'eslint-plugin-react-hooks'], root: true, + rules: { + '@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '_+' }], + }, }; diff --git a/frontend/src/app/socketio/emitters.ts b/frontend/src/app/socketio/emitters.ts index 8a82b01a00..36fcb0284b 100644 --- a/frontend/src/app/socketio/emitters.ts +++ b/frontend/src/app/socketio/emitters.ts @@ -26,7 +26,7 @@ import type { RootState } from 'app/store'; * i.e. those which make server requests. */ const makeSocketIOEmitters = ( - store: MiddlewareAPI, any>, + store: MiddlewareAPI, RootState>, socketio: Socket ) => { // We need to dispatch actions to redux and get pieces of state from the store. @@ -114,7 +114,7 @@ const makeSocketIOEmitters = ( const options: OptionsState = getState().options; const { facetoolType, facetoolStrength, codeformerFidelity } = options; - const facetoolParameters: Record = { + const facetoolParameters: Record = { facetool_strength: facetoolStrength, }; diff --git a/frontend/src/app/socketio/listeners.ts b/frontend/src/app/socketio/listeners.ts index 2868bcbbb1..dff2a6f929 100644 --- a/frontend/src/app/socketio/listeners.ts +++ b/frontend/src/app/socketio/listeners.ts @@ -40,13 +40,14 @@ import { } from './actions'; import { addImageToStagingArea } from 'features/canvas/store/canvasSlice'; import { tabMap } from 'features/tabs/tabMap'; +import type { RootState } from 'app/store'; /** * Returns an object containing listener callbacks for socketio events. * TODO: This file is large, but simple. Should it be split up further? */ const makeSocketIOListeners = ( - store: MiddlewareAPI, any> + store: MiddlewareAPI, RootState> ) => { const { dispatch, getState } = store; @@ -100,7 +101,7 @@ const makeSocketIOListeners = ( */ onGenerationResult: (data: InvokeAI.ImageResultResponse) => { try { - const state = getState(); + const state: RootState = getState(); const { shouldLoopback, activeTab } = state.options; const { boundingBox: _, generationMode, ...rest } = data; @@ -325,7 +326,10 @@ const makeSocketIOListeners = ( // remove references to image in options const { initialImage, maskPath } = getState().options; - if (initialImage?.url === url || initialImage === url) { + if ( + initialImage === url || + (initialImage as InvokeAI.Image)?.url === url + ) { dispatch(clearInitialImage()); } diff --git a/frontend/src/common/components/IAISlider.tsx b/frontend/src/common/components/IAISlider.tsx index f4fe08708c..e0c5085f25 100644 --- a/frontend/src/common/components/IAISlider.tsx +++ b/frontend/src/common/components/IAISlider.tsx @@ -124,8 +124,8 @@ export default function IAISlider(props: IAIFullSliderProps) { onChange(clamped); }; - const handleInputChange = (v: any) => { - setLocalInputValue(v); + const handleInputChange = (v: number | string) => { + setLocalInputValue(String(v)); onChange(Number(v)); }; diff --git a/frontend/src/common/components/radix-ui/IAISlider.tsx b/frontend/src/common/components/radix-ui/IAISlider.tsx index 7ad1a21df5..01332fe8f9 100644 --- a/frontend/src/common/components/radix-ui/IAISlider.tsx +++ b/frontend/src/common/components/radix-ui/IAISlider.tsx @@ -1,7 +1,6 @@ import { Tooltip } from '@chakra-ui/react'; import * as Slider from '@radix-ui/react-slider'; import React from 'react'; -import IAITooltip from './IAITooltip'; type IAISliderProps = Slider.SliderProps & { value: number[]; diff --git a/frontend/src/common/components/radix-ui/IAITooltip.tsx b/frontend/src/common/components/radix-ui/IAITooltip.tsx index 18fd908a93..438ab17ae2 100644 --- a/frontend/src/common/components/radix-ui/IAITooltip.tsx +++ b/frontend/src/common/components/radix-ui/IAITooltip.tsx @@ -20,7 +20,7 @@ const IAITooltip = (props: IAITooltipProps) => { {e.preventDefault()}} + onPointerDownOutside={(e) => {e.preventDefault()}} className="invokeai__tooltip-content" > diff --git a/frontend/src/common/hooks/useClickOutsideWatcher.ts b/frontend/src/common/hooks/useClickOutsideWatcher.ts index 14252927fe..6e216a2d06 100644 --- a/frontend/src/common/hooks/useClickOutsideWatcher.ts +++ b/frontend/src/common/hooks/useClickOutsideWatcher.ts @@ -1,5 +1,4 @@ -import { RefObject, useEffect, useRef } from 'react'; -import { Rect } from 'react-konva'; +import { RefObject, useEffect} from 'react'; const watchers: { ref: RefObject; diff --git a/frontend/src/common/util/parameterTranslation.ts b/frontend/src/common/util/parameterTranslation.ts index eed9db2e07..cf9bb225ef 100644 --- a/frontend/src/common/util/parameterTranslation.ts +++ b/frontend/src/common/util/parameterTranslation.ts @@ -1,14 +1,23 @@ import { NUMPY_RAND_MAX, NUMPY_RAND_MIN } from 'app/constants'; import { OptionsState } from 'features/options/store/optionsSlice'; import { SystemState } from 'features/system/store/systemSlice'; +import { Vector2d } from 'konva/lib/types'; +import { Dimensions } from 'features/canvas/store/canvasTypes'; import { stringToSeedWeightsArray } from './seedWeightPairs'; import randomInt from './randomInt'; import { InvokeTabName } from 'features/tabs/tabMap'; -import { CanvasState, isCanvasMaskLine } from 'features/canvas/store/canvasTypes'; +import { + CanvasState, + isCanvasMaskLine, +} from 'features/canvas/store/canvasTypes'; import generateMask from 'features/canvas/util/generateMask'; import openBase64ImageInTab from './openBase64ImageInTab'; import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider'; +import type { + UpscalingLevel, + FacetoolType, +} from 'features/options/store/optionsSlice'; export type FrontendToBackendParametersConfig = { generationMode: InvokeTabName; @@ -18,13 +27,68 @@ export type FrontendToBackendParametersConfig = { imageToProcessUrl?: string; }; +export type BackendGenerationParameters = { + prompt: string; + iterations: number; + steps: number; + cfg_scale: number; + threshold: number; + perlin: number; + height: number; + width: number; + sampler_name: string; + seed: number; + progress_images: boolean; + progress_latents: boolean; + save_intermediates: number; + generation_mode: InvokeTabName; + init_mask: string; + init_img?: string; + fit?: boolean; + seam_size?: number; + seam_blur?: number; + seam_strength?: number; + seam_steps?: number; + tile_size?: number; + infill_method?: string; + force_outpaint?: boolean; + seamless?: boolean; + hires_fix?: boolean; + strength?: number; + invert_mask?: boolean; + inpaint_replace?: number; + bounding_box?: Vector2d & Dimensions; + inpaint_width?: number; + inpaint_height?: number; + with_variations?: Array>; + variation_amount?: number; + enable_image_debugging?: boolean; +}; + +export type BackendEsrGanParameters = { + level: UpscalingLevel; + strength: number; +}; + +export type BackendFacetoolParameters = { + type: FacetoolType; + strength: number; + codeformer_fidelity?: number; +}; + +export type BackendParameters = { + generationParameters: BackendGenerationParameters; + esrganParameters: false | BackendEsrGanParameters; + facetoolParameters: false | BackendFacetoolParameters; +}; + /** * Translates/formats frontend state into parameters suitable * for consumption by the API. */ export const frontendToBackendParameters = ( config: FrontendToBackendParametersConfig -): { [key: string]: any } => { +): BackendParameters => { const canvasBaseLayer = getCanvasBaseLayer(); const { generationMode, optionsState, canvasState, systemState } = config; @@ -70,7 +134,7 @@ export const frontendToBackendParameters = ( enableImageDebugging, } = systemState; - const generationParameters: { [k: string]: any } = { + const generationParameters: BackendGenerationParameters = { prompt, iterations, steps, @@ -88,8 +152,8 @@ export const frontendToBackendParameters = ( init_mask: '', }; - let esrganParameters: false | { [k: string]: any } = false; - let facetoolParameters: false | { [k: string]: any } = false; + let esrganParameters: false | BackendEsrGanParameters = false; + let facetoolParameters: false | BackendFacetoolParameters = false; generationParameters.seed = shouldRandomizeSeed ? randomInt(NUMPY_RAND_MIN, NUMPY_RAND_MAX) diff --git a/frontend/src/features/lightbox/components/ReactPanZoom.tsx b/frontend/src/features/lightbox/components/ReactPanZoom.tsx index 608cfc8545..543fb7dd9c 100644 --- a/frontend/src/features/lightbox/components/ReactPanZoom.tsx +++ b/frontend/src/features/lightbox/components/ReactPanZoom.tsx @@ -14,7 +14,7 @@ type ReactPanZoomProps = { image: string; styleClass?: string; alt?: string; - ref?: any; + ref?: React.Ref; }; export default function ReactPanZoom({ diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx index 90edf0a556..b0c640b762 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasDisplayBeta.tsx @@ -6,7 +6,6 @@ import { useLayoutEffect } from 'react'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { setDoesCanvasNeedScaling } from 'features/canvas/store/canvasSlice'; import IAICanvas from 'features/canvas/components/IAICanvas'; -import IAICanvasOutpaintingControls from 'features/canvas/components/IAICanvasToolbar/IAICanvasToolbar'; import { canvasSelector } from 'features/canvas/store/canvasSelectors'; import { Flex } from '@chakra-ui/react'; import UnifiedCanvasToolbarBeta from './UnifiedCanvasToolbarBeta'; diff --git a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx index bbcfa2e65f..494693d064 100644 --- a/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx +++ b/frontend/src/features/tabs/components/UnifiedCanvas/UnifiedCanvasBeta/UnifiedCanvasToolbar/UnifiedCanvasToolSelect.tsx @@ -3,7 +3,6 @@ import { createSelector } from '@reduxjs/toolkit'; import { addEraseRect, addFillRect, - setBrushColor, setTool, } from 'features/canvas/store/canvasSlice'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; diff --git a/frontend/src/global.d.ts b/frontend/src/global.d.ts index a0b48d49bb..fd4d8fd28c 100644 --- a/frontend/src/global.d.ts +++ b/frontend/src/global.d.ts @@ -15,11 +15,11 @@ declare global { */ findLast( predicate: (this: void, value: T, index: number, obj: T[]) => value is S, - thisArg?: any + thisArg?: unknown ): S | undefined; findLast( predicate: (value: T, index: number, obj: T[]) => unknown, - thisArg?: any + thisArg?: unknown ): T | undefined; /** @@ -33,7 +33,7 @@ declare global { */ findLastIndex( predicate: (value: T, index: number, obj: T[]) => unknown, - thisArg?: any + thisArg?: unknown ): number; } } From 0b1083526935346f50017c7a34ccad7c702f555f Mon Sep 17 00:00:00 2001 From: Kaspar Emanuel Date: Thu, 15 Dec 2022 18:41:10 +0000 Subject: [PATCH 14/26] Fix initial theme setting --- .../src/features/system/components/ThemeChanger.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/features/system/components/ThemeChanger.tsx b/frontend/src/features/system/components/ThemeChanger.tsx index f2b1255391..33f52b2d97 100644 --- a/frontend/src/features/system/components/ThemeChanger.tsx +++ b/frontend/src/features/system/components/ThemeChanger.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import { useColorMode, VStack } from '@chakra-ui/react'; import { RootState } from 'app/store'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; @@ -10,14 +11,21 @@ import IAIButton from 'common/components/IAIButton'; const THEMES = ['dark', 'light', 'green']; export default function ThemeChanger() { - const { setColorMode } = useColorMode(); + const { setColorMode, colorMode } = useColorMode(); const dispatch = useAppDispatch(); const currentTheme = useAppSelector( (state: RootState) => state.options.currentTheme ); + useEffect(() => { + // syncs the redux store theme to the chakra's theme on startup and when + // setCurrentTheme is dispatched + if (colorMode !== currentTheme) { + setColorMode(currentTheme); + } + }, [colorMode, currentTheme]); + const handleChangeTheme = (theme: string) => { - setColorMode(theme); dispatch(setCurrentTheme(theme)); }; From 0932b4affafabc5d11099ba407f98da233564e69 Mon Sep 17 00:00:00 2001 From: zeptofine <54873330+zeptofine@users.noreply.github.com> Date: Thu, 15 Dec 2022 09:54:37 -0500 Subject: [PATCH 15/26] Replace latest link The link still points to 2.2.3 . --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6ce709e49..c07ade79b1 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ requests. Be sure to use the provided templates. They will help us diagnose issu For full installation and upgrade instructions, please see: [InvokeAI Installation Overview](https://invoke-ai.github.io/InvokeAI/installation/) -1. Go to the bottom of the [Latest Release Page](https://github.com/invoke-ai/InvokeAI/releases/tag/v2.2.3) +1. Go to the bottom of the [Latest Release Page](https://github.com/invoke-ai/InvokeAI/releases/latest) 2. Download the .zip file for your OS (Windows/macOS/Linux). 3. Unzip the file. 4. If you are on Windows, double-click on the `install.bat` script. On macOS, open a Terminal window, drag the file `install.sh` from Finder into the Terminal, and press return. On Linux, run `install.sh`. From 2923dfaed1a9805046851c6562d8c36a873d623e Mon Sep 17 00:00:00 2001 From: mauwii Date: Thu, 15 Dec 2022 12:52:55 +0100 Subject: [PATCH 16/26] update index and changelog --- docs/CHANGELOG.md | 401 ++++++++++++++++++++++++++++------------------ docs/index.md | 206 ++++++++++++------------ 2 files changed, 349 insertions(+), 258 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f9aa033d30..a14c123008 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,180 +4,275 @@ title: Changelog # :octicons-log-16: **Changelog** +## v2.2.4 (11 December 2022) + +**the `invokeai` directory** + +Previously there were two directories to worry about, the directory that +contained the InvokeAI source code and the launcher scripts, and the `invokeai` +directory that contained the models files, embeddings, configuration and +outputs. With the 2.2.4 release, this dual system is done away with, and +everything, including the `invoke.bat` and `invoke.sh` launcher scripts, now +live in a directory named `invokeai`. By default this directory is located in +your home directory (e.g. `\Users\yourname` on Windows), but you can select +where it goes at install time. + +After installation, you can delete the install directory (the one that the zip +file creates when it unpacks). Do **not** delete or move the `invokeai` +directory! + +**Initialization file `invokeai/invokeai.init`** + +You can place frequently-used startup options in this file, such as the default +number of steps or your preferred sampler. To keep everything in one place, this +file has now been moved into the `invokeai` directory and is named +`invokeai.init`. + +**To update from Version 2.2.3** + +The easiest route is to download and unpack one of the 2.2.4 installer files. +When it asks you for the location of the `invokeai` runtime directory, respond +with the path to the directory that contains your 2.2.3 `invokeai`. That is, if +`invokeai` lives at `C:\Users\fred\invokeai`, then answer with `C:\Users\fred` +and answer "Y" when asked if you want to reuse the directory. + +The `update.sh` (`update.bat`) script that came with the 2.2.3 source installer +does not know about the new directory layout and won't be fully functional. + +**To update to 2.2.5 (and beyond) there's now an update path** + +As they become available, you can update to more recent versions of InvokeAI +using an `update.sh` (`update.bat`) script located in the `invokeai` directory. +Running it without any arguments will install the most recent version of +InvokeAI. Alternatively, you can get set releases by running the `update.sh` +script with an argument in the command shell. This syntax accepts the path to +the desired release's zip file, which you can find by clicking on the green +"Code" button on this repository's home page. + +**Other 2.2.4 Improvements** + +- Fix InvokeAI GUI initialization by @addianto in #1687 +- fix link in documentation by @lstein in #1728 +- Fix broken link by @ShawnZhong in #1736 +- Remove reference to binary installer by @lstein in #1731 +- documentation fixes for 2.2.3 by @lstein in #1740 +- Modify installer links to point closer to the source installer by @ebr in + #1745 +- add documentation warning about 1650/60 cards by @lstein in #1753 +- Fix Linux source URL in installation docs by @andybearman in #1756 +- Make install instructions discoverable in readme by @damian0815 in #1752 +- typo fix by @ofirkris in #1755 +- Non-interactive model download (support HUGGINGFACE_TOKEN) by @ebr in #1578 +- fix(srcinstall): shell installer - cp scripts instead of linking by @tildebyte + in #1765 +- stability and usage improvements to binary & source installers by @lstein in + #1760 +- fix off-by-one bug in cross-attention-control by @damian0815 in #1774 +- Eventually update APP_VERSION to 2.2.3 by @spezialspezial in #1768 +- invoke script cds to its location before running by @lstein in #1805 +- Make PaperCut and VoxelArt models load again by @lstein in #1730 +- Fix --embedding_directory / --embedding_path not working by @blessedcoolant in + #1817 +- Clean up readme by @hipsterusername in #1820 +- Optimized Docker build with support for external working directory by @ebr in + #1544 +- disable pushing the cloud container by @mauwii in #1831 +- Fix docker push github action and expand with additional metadata by @ebr in + #1837 +- Fix Broken Link To Notebook by @VedantMadane in #1821 +- Account for flat models by @spezialspezial in #1766 +- Update invoke.bat.in isolate environment variables by @lynnewu in #1833 +- Arch Linux Specific PatchMatch Instructions & fixing conda install on linux by + @SammCheese in #1848 +- Make force free GPU memory work in img2img by @addianto in #1844 +- New installer by @lstein + +## v2.2.3 (2 December 2022) + +!!! Note + + This point release removes references to the binary installer from the + installation guide. The binary installer is not stable at the current + time. First time users are encouraged to use the "source" installer as + described in [Installing InvokeAI with the Source Installer](installation/INSTALL_SOURCE.md) + +With InvokeAI 2.2, this project now provides enthusiasts and professionals a +robust workflow solution for creating AI-generated and human facilitated +compositions. Additional enhancements have been made as well, improving safety, +ease of use, and installation. + +Optimized for efficiency, InvokeAI needs only ~3.5GB of VRAM to generate a +512x768 image (and less for smaller images), and is compatible with +Windows/Linux/Mac (M1 & M2). + +You can see the [release video](https://youtu.be/hIYBfDtKaus) here, which +introduces the main WebUI enhancement for version 2.2 - +[The Unified Canvas](features/UNIFIED_CANVAS.md). This new workflow is the +biggest enhancement added to the WebUI to date, and unlocks a stunning amount of +potential for users to create and iterate on their creations. The following +sections describe what's new for InvokeAI. + +## v2.2.2 (30 November 2022) + +!!! note + + The binary installer is not ready for prime time. First time users are recommended to install via the "source" installer accessible through the links at the bottom of this page.**** + +With InvokeAI 2.2, this project now provides enthusiasts and professionals a +robust workflow solution for creating AI-generated and human facilitated +compositions. Additional enhancements have been made as well, improving safety, +ease of use, and installation. + +Optimized for efficiency, InvokeAI needs only ~3.5GB of VRAM to generate a +512x768 image (and less for smaller images), and is compatible with +Windows/Linux/Mac (M1 & M2). + +You can see the [release video](https://youtu.be/hIYBfDtKaus) here, which +introduces the main WebUI enhancement for version 2.2 - +[The Unified Canvas](https://invoke-ai.github.io/InvokeAI/features/UNIFIED_CANVAS/). +This new workflow is the biggest enhancement added to the WebUI to date, and +unlocks a stunning amount of potential for users to create and iterate on their +creations. The following sections describe what's new for InvokeAI. + +## v2.2.0 (2 December 2022) + +With InvokeAI 2.2, this project now provides enthusiasts and professionals a +robust workflow solution for creating AI-generated and human facilitated +compositions. Additional enhancements have been made as well, improving safety, +ease of use, and installation. + +Optimized for efficiency, InvokeAI needs only ~3.5GB of VRAM to generate a +512x768 image (and less for smaller images), and is compatible with +Windows/Linux/Mac (M1 & M2). + +You can see the [release video](https://youtu.be/hIYBfDtKaus) here, which +introduces the main WebUI enhancement for version 2.2 - +[The Unified Canvas](features/UNIFIED_CANVAS.md). This new workflow is the +biggest enhancement added to the WebUI to date, and unlocks a stunning amount of +potential for users to create and iterate on their creations. The following +sections describe what's new for InvokeAI. + +## v2.1.3 (13 November 2022) + +- A choice of installer scripts that automate installation and configuration. + See + [Installation](installation/index.md). +- A streamlined manual installation process that works for both Conda and + PIP-only installs. See + [Manual Installation](installation/INSTALL_MANUAL.md). +- The ability to save frequently-used startup options (model to load, steps, + sampler, etc) in a `.invokeai` file. See + [Client](features/CLI.md) +- Support for AMD GPU cards (non-CUDA) on Linux machines. +- Multiple bugs and edge cases squashed. + ## v2.1.0 (2 November 2022) -- update mac instructions to use invokeai for env name by @willwillems in - https://github.com/invoke-ai/InvokeAI/pull/1030 -- Update .gitignore by @blessedcoolant in - https://github.com/invoke-ai/InvokeAI/pull/1040 -- reintroduce fix for m1 from https://github.com/invoke-ai/InvokeAI/pull/579 - missing after merge by @skurovec in - https://github.com/invoke-ai/InvokeAI/pull/1056 -- Update Stable_Diffusion_AI_Notebook.ipynb (Take 2) by @ChloeL19 in - https://github.com/invoke-ai/InvokeAI/pull/1060 -- Print out the device type which is used by @manzke in - https://github.com/invoke-ai/InvokeAI/pull/1073 -- Hires Addition by @hipsterusername in - https://github.com/invoke-ai/InvokeAI/pull/1063 +- update mac instructions to use invokeai for env name by @willwillems in #1030 +- Update .gitignore by @blessedcoolant in #1040 +- reintroduce fix for m1 from #579 missing after merge by @skurovec in #1056 +- Update Stable_Diffusion_AI_Notebook.ipynb (Take 2) by @ChloeL19 in #1060 +- Print out the device type which is used by @manzke in #1073 +- Hires Addition by @hipsterusername in #1063 - fix for "1 leaked semaphore objects to clean up at shutdown" on M1 by - @skurovec in https://github.com/invoke-ai/InvokeAI/pull/1081 + @skurovec in #1081 - Forward dream.py to invoke.py using the same interpreter, add deprecation - warning by @db3000 in https://github.com/invoke-ai/InvokeAI/pull/1077 -- fix noisy images at high step counts by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1086 -- Generalize facetool strength argument by @db3000 in - https://github.com/invoke-ai/InvokeAI/pull/1078 + warning by @db3000 in #1077 +- fix noisy images at high step counts by @lstein in #1086 +- Generalize facetool strength argument by @db3000 in #1078 - Enable fast switching among models at the invoke> command line by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1066 -- Fix Typo, committed changing ldm environment to invokeai by @jdries3 in - https://github.com/invoke-ai/InvokeAI/pull/1095 -- Update generate.py by @unreleased in - https://github.com/invoke-ai/InvokeAI/pull/1109 -- Update 'ldm' env to 'invokeai' in troubleshooting steps by @19wolf in - https://github.com/invoke-ai/InvokeAI/pull/1125 -- Fixed documentation typos and resolved merge conflicts by @rupeshs in - https://github.com/invoke-ai/InvokeAI/pull/1123 -- Fix broken doc links, fix malaprop in the project subtitle by @majick in - https://github.com/invoke-ai/InvokeAI/pull/1131 -- Only output facetool parameters if enhancing faces by @db3000 in - https://github.com/invoke-ai/InvokeAI/pull/1119 + #1066 +- Fix Typo, committed changing ldm environment to invokeai by @jdries3 in #1095 +- Update generate.py by @unreleased in #1109 +- Update 'ldm' env to 'invokeai' in troubleshooting steps by @19wolf in #1125 +- Fixed documentation typos and resolved merge conflicts by @rupeshs in #1123 +- Fix broken doc links, fix malaprop in the project subtitle by @majick in #1131 +- Only output facetool parameters if enhancing faces by @db3000 in #1119 - Update gitignore to ignore codeformer weights at new location by - @spezialspezial in https://github.com/invoke-ai/InvokeAI/pull/1136 -- fix links to point to invoke-ai.github.io #1117 by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1143 -- Rework-mkdocs by @mauwii in https://github.com/invoke-ai/InvokeAI/pull/1144 + @spezialspezial in #1136 +- fix links to point to invoke-ai.github.io #1117 by @mauwii in #1143 +- Rework-mkdocs by @mauwii in #1144 - add option to CLI and pngwriter that allows user to set PNG compression level - by @lstein in https://github.com/invoke-ai/InvokeAI/pull/1127 -- Fix img2img DDIM index out of bound by @wfng92 in - https://github.com/invoke-ai/InvokeAI/pull/1137 -- Fix gh actions by @mauwii in https://github.com/invoke-ai/InvokeAI/pull/1128 -- update mac instructions to use invokeai for env name by @willwillems in - https://github.com/invoke-ai/InvokeAI/pull/1030 -- Update .gitignore by @blessedcoolant in - https://github.com/invoke-ai/InvokeAI/pull/1040 -- reintroduce fix for m1 from https://github.com/invoke-ai/InvokeAI/pull/579 - missing after merge by @skurovec in - https://github.com/invoke-ai/InvokeAI/pull/1056 -- Update Stable_Diffusion_AI_Notebook.ipynb (Take 2) by @ChloeL19 in - https://github.com/invoke-ai/InvokeAI/pull/1060 -- Print out the device type which is used by @manzke in - https://github.com/invoke-ai/InvokeAI/pull/1073 -- Hires Addition by @hipsterusername in - https://github.com/invoke-ai/InvokeAI/pull/1063 + by @lstein in #1127 +- Fix img2img DDIM index out of bound by @wfng92 in #1137 +- Fix gh actions by @mauwii in #1128 +- update mac instructions to use invokeai for env name by @willwillems in #1030 +- Update .gitignore by @blessedcoolant in #1040 +- reintroduce fix for m1 from #579 missing after merge by @skurovec in #1056 +- Update Stable_Diffusion_AI_Notebook.ipynb (Take 2) by @ChloeL19 in #1060 +- Print out the device type which is used by @manzke in #1073 +- Hires Addition by @hipsterusername in #1063 - fix for "1 leaked semaphore objects to clean up at shutdown" on M1 by - @skurovec in https://github.com/invoke-ai/InvokeAI/pull/1081 + @skurovec in #1081 - Forward dream.py to invoke.py using the same interpreter, add deprecation - warning by @db3000 in https://github.com/invoke-ai/InvokeAI/pull/1077 -- fix noisy images at high step counts by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1086 -- Generalize facetool strength argument by @db3000 in - https://github.com/invoke-ai/InvokeAI/pull/1078 + warning by @db3000 in #1077 +- fix noisy images at high step counts by @lstein in #1086 +- Generalize facetool strength argument by @db3000 in #1078 - Enable fast switching among models at the invoke> command line by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1066 -- Fix Typo, committed changing ldm environment to invokeai by @jdries3 in - https://github.com/invoke-ai/InvokeAI/pull/1095 -- Fixed documentation typos and resolved merge conflicts by @rupeshs in - https://github.com/invoke-ai/InvokeAI/pull/1123 -- Only output facetool parameters if enhancing faces by @db3000 in - https://github.com/invoke-ai/InvokeAI/pull/1119 + #1066 +- Fix Typo, committed changing ldm environment to invokeai by @jdries3 in #1095 +- Fixed documentation typos and resolved merge conflicts by @rupeshs in #1123 +- Only output facetool parameters if enhancing faces by @db3000 in #1119 - add option to CLI and pngwriter that allows user to set PNG compression level - by @lstein in https://github.com/invoke-ai/InvokeAI/pull/1127 -- Fix img2img DDIM index out of bound by @wfng92 in - https://github.com/invoke-ai/InvokeAI/pull/1137 -- Add text prompt to inpaint mask support by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1133 + by @lstein in #1127 +- Fix img2img DDIM index out of bound by @wfng92 in #1137 +- Add text prompt to inpaint mask support by @lstein in #1133 - Respect http[s] protocol when making socket.io middleware by @damian0815 in - https://github.com/invoke-ai/InvokeAI/pull/976 -- WebUI: Adds Codeformer support by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1151 -- Skips normalizing prompts for web UI metadata by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1165 -- Add Asymmetric Tiling by @carson-katri in - https://github.com/invoke-ai/InvokeAI/pull/1132 -- Web UI: Increases max CFG Scale to 200 by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1172 + #976 +- WebUI: Adds Codeformer support by @psychedelicious in #1151 +- Skips normalizing prompts for web UI metadata by @psychedelicious in #1165 +- Add Asymmetric Tiling by @carson-katri in #1132 +- Web UI: Increases max CFG Scale to 200 by @psychedelicious in #1172 - Corrects color channels in face restoration; Fixes #1167 by @psychedelicious - in https://github.com/invoke-ai/InvokeAI/pull/1175 + in #1175 - Flips channels using array slicing instead of using OpenCV by @psychedelicious - in https://github.com/invoke-ai/InvokeAI/pull/1178 -- Fix typo in docs: s/Formally/Formerly by @noodlebox in - https://github.com/invoke-ai/InvokeAI/pull/1176 -- fix clipseg loading problems by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1177 -- Correct color channels in upscale using array slicing by @wfng92 in - https://github.com/invoke-ai/InvokeAI/pull/1181 + in #1178 +- Fix typo in docs: s/Formally/Formerly by @noodlebox in #1176 +- fix clipseg loading problems by @lstein in #1177 +- Correct color channels in upscale using array slicing by @wfng92 in #1181 - Web UI: Filters existing images when adding new images; Fixes #1085 by - @psychedelicious in https://github.com/invoke-ai/InvokeAI/pull/1171 -- fix a number of bugs in textual inversion by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1190 -- Improve !fetch, add !replay command by @ArDiouscuros in - https://github.com/invoke-ai/InvokeAI/pull/882 -- Fix generation of image with s>1000 by @holstvoogd in - https://github.com/invoke-ai/InvokeAI/pull/951 -- Web UI: Gallery improvements by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1198 -- Update CLI.md by @krummrey in https://github.com/invoke-ai/InvokeAI/pull/1211 -- outcropping improvements by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1207 -- add support for loading VAE autoencoders by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1216 -- remove duplicate fix_func for MPS by @wfng92 in - https://github.com/invoke-ai/InvokeAI/pull/1210 -- Metadata storage and retrieval fixes by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1204 -- nix: add shell.nix file by @Cloudef in - https://github.com/invoke-ai/InvokeAI/pull/1170 -- Web UI: Changes vite dist asset paths to relative by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1185 -- Web UI: Removes isDisabled from PromptInput by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1187 + @psychedelicious in #1171 +- fix a number of bugs in textual inversion by @lstein in #1190 +- Improve !fetch, add !replay command by @ArDiouscuros in #882 +- Fix generation of image with s>1000 by @holstvoogd in #951 +- Web UI: Gallery improvements by @psychedelicious in #1198 +- Update CLI.md by @krummrey in #1211 +- outcropping improvements by @lstein in #1207 +- add support for loading VAE autoencoders by @lstein in #1216 +- remove duplicate fix_func for MPS by @wfng92 in #1210 +- Metadata storage and retrieval fixes by @lstein in #1204 +- nix: add shell.nix file by @Cloudef in #1170 +- Web UI: Changes vite dist asset paths to relative by @psychedelicious in #1185 +- Web UI: Removes isDisabled from PromptInput by @psychedelicious in #1187 - Allow user to generate images with initial noise as on M1 / mps system by - @ArDiouscuros in https://github.com/invoke-ai/InvokeAI/pull/981 -- feat: adding filename format template by @plucked in - https://github.com/invoke-ai/InvokeAI/pull/968 -- Web UI: Fixes broken bundle by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1242 -- Support runwayML custom inpainting model by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1243 -- Update IMG2IMG.md by @talitore in - https://github.com/invoke-ai/InvokeAI/pull/1262 + @ArDiouscuros in #981 +- feat: adding filename format template by @plucked in #968 +- Web UI: Fixes broken bundle by @psychedelicious in #1242 +- Support runwayML custom inpainting model by @lstein in #1243 +- Update IMG2IMG.md by @talitore in #1262 - New dockerfile - including a build- and a run- script as well as a GH-Action - by @mauwii in https://github.com/invoke-ai/InvokeAI/pull/1233 + by @mauwii in #1233 - cut over from karras to model noise schedule for higher steps by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1222 -- Prompt tweaks by @lstein in https://github.com/invoke-ai/InvokeAI/pull/1268 -- Outpainting implementation by @Kyle0654 in - https://github.com/invoke-ai/InvokeAI/pull/1251 -- fixing aspect ratio on hires by @tjennings in - https://github.com/invoke-ai/InvokeAI/pull/1249 -- Fix-build-container-action by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1274 -- handle all unicode characters by @damian0815 in - https://github.com/invoke-ai/InvokeAI/pull/1276 -- adds models.user.yml to .gitignore by @JakeHL in - https://github.com/invoke-ai/InvokeAI/pull/1281 -- remove debug branch, set fail-fast to false by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1284 -- Protect-secrets-on-pr by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1285 -- Web UI: Adds initial inpainting implementation by @psychedelicious in - https://github.com/invoke-ai/InvokeAI/pull/1225 -- fix environment-mac.yml - tested on x64 and arm64 by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1289 -- Use proper authentication to download model by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1287 -- Prevent indexing error for mode RGB by @spezialspezial in - https://github.com/invoke-ai/InvokeAI/pull/1294 + #1222 +- Prompt tweaks by @lstein in #1268 +- Outpainting implementation by @Kyle0654 in #1251 +- fixing aspect ratio on hires by @tjennings in #1249 +- Fix-build-container-action by @mauwii in #1274 +- handle all unicode characters by @damian0815 in #1276 +- adds models.user.yml to .gitignore by @JakeHL in #1281 +- remove debug branch, set fail-fast to false by @mauwii in #1284 +- Protect-secrets-on-pr by @mauwii in #1285 +- Web UI: Adds initial inpainting implementation by @psychedelicious in #1225 +- fix environment-mac.yml - tested on x64 and arm64 by @mauwii in #1289 +- Use proper authentication to download model by @mauwii in #1287 +- Prevent indexing error for mode RGB by @spezialspezial in #1294 - Integrate sd-v1-5 model into test matrix (easily expandable), remove - unecesarry caches by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1293 -- add --no-interactive to configure_invokeai step by @mauwii in - https://github.com/invoke-ai/InvokeAI/pull/1302 + unecesarry caches by @mauwii in #1293 +- add --no-interactive to configure_invokeai step by @mauwii in #1302 - 1-click installer and updater. Uses micromamba to install git and conda into a contained environment (if necessary) before running the normal installation - script by @cmdr2 in https://github.com/invoke-ai/InvokeAI/pull/1253 -- configure_invokeai.py script downloads the weight files by @lstein in - https://github.com/invoke-ai/InvokeAI/pull/1290 + script by @cmdr2 in #1253 +- configure_invokeai.py script downloads the weight files by @lstein in #1290 ## v2.0.1 (13 October 2022) diff --git a/docs/index.md b/docs/index.md index a5a217ac26..1ad2d2b66d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -6,15 +6,14 @@ title: Home The Docs you find here (/docs/*) are built and deployed via mkdocs. If you want to run a local version to verify your changes, it's as simple as:: ```bash - pip install -r requirements-mkdocs.txt + pip install -r docs/requirements-mkdocs.txt mkdocs serve ``` --> +
-# ^^**InvokeAI: A Stable Diffusion Toolkit**^^ :tools:
Formerly known as lstein/stable-diffusion - -[![project logo](assets/logo.png)](https://github.com/invoke-ai/InvokeAI) +[![project logo](assets/invoke_ai_banner.png)](https://github.com/invoke-ai/InvokeAI) [![discord badge]][discord link] @@ -70,7 +69,11 @@ image-to-image generator. It provides a streamlined process with various new features and options to aid the image generation process. It runs on Windows, Mac and Linux machines, and runs on GPU cards with as little as 4 GB or RAM. -**Quick links**: [Discord Server] [Code and Downloads] [Bug Reports] [Discussion, Ideas & Q&A] +**Quick links**: [Discord Server] +[Code and Downloads] [Bug Reports] [Discussion, Ideas & +Q&A]
@@ -80,20 +83,19 @@ Mac and Linux machines, and runs on GPU cards with as little as 4 GB or RAM. ## :octicons-package-dependencies-24: Installation -This fork is supported across Linux, Windows and Macintosh. Linux -users can use either an Nvidia-based card (with CUDA support) or an -AMD card (using the ROCm driver). +This fork is supported across Linux, Windows and Macintosh. Linux users can use +either an Nvidia-based card (with CUDA support) or an AMD card (using the ROCm +driver). -First time users, please see [Automated -Installer](installation/INSTALL_AUTOMATED.md) for a walkthrough of -getting InvokeAI up and running on your system. For alternative -installation and upgrade instructions, please see: [InvokeAI -Installation Overview](installation/) +First time users, please see +[Automated Installer](installation/INSTALL_AUTOMATED.md) for a walkthrough of +getting InvokeAI up and running on your system. For alternative installation and +upgrade instructions, please see: +[InvokeAI Installation Overview](installation/) -Linux users who wish to make use of the PyPatchMatch inpainting -functions will need to perform a bit of extra work to enable this -module. Instructions can be found at [Installing -PyPatchMatch](installation/INSTALL_PATCHMATCH.md). +Linux users who wish to make use of the PyPatchMatch inpainting functions will +need to perform a bit of extra work to enable this module. Instructions can be +found at [Installing PyPatchMatch](installation/INSTALL_PATCHMATCH.md). ## :fontawesome-solid-computer: Hardware Requirements @@ -102,12 +104,13 @@ PyPatchMatch](installation/INSTALL_PATCHMATCH.md). You wil need one of the following: - :simple-nvidia: An NVIDIA-based graphics card with 4 GB or more VRAM memory. -- :simple-amd: An AMD-based graphics card with 4 GB or more VRAM memory (Linux only) +- :simple-amd: An AMD-based graphics card with 4 GB or more VRAM memory (Linux + only) - :fontawesome-brands-apple: An Apple computer with an M1 chip. -We do **not recommend** the following video cards due to issues with -their running in half-precision mode and having insufficient VRAM to -render 512x512 images in full-precision mode: +We do **not recommend** the following video cards due to issues with their +running in half-precision mode and having insufficient VRAM to render 512x512 +images in full-precision mode: - NVIDIA 10xx series cards such as the 1080ti - GTX 1650 series cards @@ -131,6 +134,7 @@ render 512x512 images in full-precision mode: ```bash (invokeai) ~/InvokeAI$ python scripts/invoke.py --full_precision ``` + ## :octicons-gift-24: InvokeAI Features - [The InvokeAI Web Interface](features/WEB.md) @@ -155,99 +159,91 @@ render 512x512 images in full-precision mode: ## :octicons-log-16: Latest Changes -### v2.1.3 (13 November 2022) +### v2.2.4 (11 December 2022) -- A choice of installer scripts that automate installation and configuration. See [Installation](https://github.com/invoke-ai/InvokeAI/blob/2.1.3-rc6/docs/installation/INSTALL.md). -- A streamlined manual installation process that works for both Conda and PIP-only installs. See [Manual Installation](https://github.com/invoke-ai/InvokeAI/blob/2.1.3-rc6/docs/installation/INSTALL_MANUAL.md). -- The ability to save frequently-used startup options (model to load, steps, sampler, etc) in a `.invokeai` file. See [Client](https://github.com/invoke-ai/InvokeAI/blob/2.1.3-rc6/docs/features/CLI.md) -- Support for AMD GPU cards (non-CUDA) on Linux machines. -- Multiple bugs and edge cases squashed. +#### the `invokeai` directory -### v2.1.0 (2 November 2022) +Previously there were two directories to worry about, the directory that +contained the InvokeAI source code and the launcher scripts, and the `invokeai` +directory that contained the models files, embeddings, configuration and +outputs. With the 2.2.4 release, this dual system is done away with, and +everything, including the `invoke.bat` and `invoke.sh` launcher scripts, now +live in a directory named `invokeai`. By default this directory is located in +your home directory (e.g. `\Users\yourname` on Windows), but you can select +where it goes at install time. -- [Inpainting](https://invoke-ai.github.io/InvokeAI/features/INPAINTING/) - support in the WebGUI -- Greatly improved navigation and user experience in the - [WebGUI](https://invoke-ai.github.io/InvokeAI/features/WEB/) -- The prompt syntax has been enhanced with - [prompt weighting, cross-attention and prompt merging](https://invoke-ai.github.io/InvokeAI/features/PROMPTS/). -- You can now load - [multiple models and switch among them quickly](https://docs.google.com/presentation/d/1WywGA1rny7bpFh7CLSdTr4nNpVKdlUeT0Bj0jCsILyU/edit?usp=sharing) - without leaving the CLI. -- The installation process (via `scripts/configure_invokeai.py`) now lets you select - among several popular - [Stable Diffusion models](https://invoke-ai.github.io/InvokeAI/installation/INSTALLING_MODELS/) - and downloads and installs them on your behalf. Among other models, this - script will install the current Stable Diffusion 1.5 model as well as a - StabilityAI variable autoencoder (VAE) which improves face generation. -- Tired of struggling with photoeditors to get the masked region of for - inpainting just right? Let the AI make the mask for you using - [text masking](https://docs.google.com/presentation/d/1pWoY510hCVjz0M6X9CBbTznZgW2W5BYNKrmZm7B45q8/edit#slide=id.p). - This feature allows you to specify the part of the image to paint over using - just English-language phrases. -- Tired of seeing the head of your subjects cropped off? Uncrop them in the CLI - with the - [outcrop feature](https://invoke-ai.github.io/InvokeAI/features/OUTPAINTING/#outcrop). -- Tired of seeing your subject's bodies duplicated or mangled when generating - larger-dimension images? Check out the `--hires` option in the CLI, or select - the corresponding toggle in the WebGUI. -- We now support textual inversion and fine-tune .bin styles and subjects from - the Hugging Face archive of - [SD Concepts](https://huggingface.co/sd-concepts-library). Load the .bin file - using the `--embedding_path` option. (The next version will support merging - and loading of multiple simultaneous models). -- ... +After installation, you can delete the install directory (the one that the zip +file creates when it unpacks). Do **not** delete or move the `invokeai` +directory! -### v2.0.1 (13 October 2022) +##### Initialization file `invokeai/invokeai.init` -- fix noisy images at high step count when using k\* samplers -- dream.py script now calls invoke.py module directly rather than via a new - python process (which could break the environment) +You can place frequently-used startup options in this file, such as the default +number of steps or your preferred sampler. To keep everything in one place, this +file has now been moved into the `invokeai` directory and is named +`invokeai.init`. -### v2.0.0 (9 October 2022) +#### To update from Version 2.2.3 -- `dream.py` script renamed `invoke.py`. A `dream.py` script wrapper remains for - backward compatibility. -- Completely new WebGUI - launch with `python3 scripts/invoke.py --web` -- Support for - inpainting - and - outpainting -- img2img runs on all k\* samplers -- Support for - negative - prompts -- Support for CodeFormer face reconstruction -- Support for Textual Inversion on Macintoshes -- Support in both WebGUI and CLI for - post-processing - of previously-generated images using facial reconstruction, ESRGAN - upscaling, outcropping (similar to DALL-E infinite canvas), and "embiggen" - upscaling. See the `!fix` command. -- New `--hires` option on `invoke>` line allows - larger - images to be created without duplicating elements, at the cost of some - performance. -- New `--perlin` and `--threshold` options allow you to add and control - variation during image generation (see - Thresholding - and Perlin Noise Initialization -- Extensive metadata now written into PNG files, allowing reliable regeneration - of images and tweaking of previous settings. -- Command-line completion in `invoke.py` now works on Windows, Linux and Mac - platforms. -- Improved - command-line - completion behavior. New commands added: - - List command-line history with `!history` - - Search command-line history with `!search` - - Clear history with `!clear` -- Deprecated `--full_precision` / `-F`. Simply omit it and `invoke.py` will auto - configure. To switch away from auto use the new flag like - `--precision=float32`. +The easiest route is to download and unpack one of the 2.2.4 installer files. +When it asks you for the location of the `invokeai` runtime directory, respond +with the path to the directory that contains your 2.2.3 `invokeai`. That is, if +`invokeai` lives at `C:\Users\fred\invokeai`, then answer with `C:\Users\fred` +and answer "Y" when asked if you want to reuse the directory. + +The `update.sh` (`update.bat`) script that came with the 2.2.3 source installer +does not know about the new directory layout and won't be fully functional. + +#### To update to 2.2.5 (and beyond) there's now an update path. + +As they become available, you can update to more recent versions of InvokeAI +using an `update.sh` (`update.bat`) script located in the `invokeai` directory. +Running it without any arguments will install the most recent version of +InvokeAI. Alternatively, you can get set releases by running the `update.sh` +script with an argument in the command shell. This syntax accepts the path to +the desired release's zip file, which you can find by clicking on the green +"Code" button on this repository's home page. + +#### Other 2.2.4 Improvements + +- Fix InvokeAI GUI initialization by @addianto in #1687 +- fix link in documentation by @lstein in #1728 +- Fix broken link by @ShawnZhong in #1736 +- Remove reference to binary installer by @lstein in #1731 +- documentation fixes for 2.2.3 by @lstein in #1740 +- Modify installer links to point closer to the source installer by @ebr in + #1745 +- add documentation warning about 1650/60 cards by @lstein in #1753 +- Fix Linux source URL in installation docs by @andybearman in #1756 +- Make install instructions discoverable in readme by @damian0815 in #1752 +- typo fix by @ofirkris in #1755 +- Non-interactive model download (support HUGGINGFACE_TOKEN) by @ebr in #1578 +- fix(srcinstall): shell installer - cp scripts instead of linking by @tildebyte + in #1765 +- stability and usage improvements to binary & source installers by @lstein in + #1760 +- fix off-by-one bug in cross-attention-control by @damian0815 in #1774 +- Eventually update APP_VERSION to 2.2.3 by @spezialspezial in #1768 +- invoke script cds to its location before running by @lstein in #1805 +- Make PaperCut and VoxelArt models load again by @lstein in #1730 +- Fix --embedding_directory / --embedding_path not working by @blessedcoolant in + #1817 +- Clean up readme by @hipsterusername in #1820 +- Optimized Docker build with support for external working directory by @ebr in + #1544 +- disable pushing the cloud container by @mauwii in #1831 +- Fix docker push github action and expand with additional metadata by @ebr in + #1837 +- Fix Broken Link To Notebook by @VedantMadane in #1821 +- Account for flat models by @spezialspezial in #1766 +- Update invoke.bat.in isolate environment variables by @lynnewu in #1833 +- Arch Linux Specific PatchMatch Instructions & fixing conda install on linux by + @SammCheese in #1848 +- Make force free GPU memory work in img2img by @addianto in #1844 +- New installer by @lstein For older changelogs, please visit the -**[CHANGELOG](CHANGELOG/#v114-11-september-2022)**. +**[CHANGELOG](CHANGELOG/#v223-2-december-2022)**. ## :material-target: Troubleshooting From bfa8fed568dbb3cfb22079338d9ecbf2812095b9 Mon Sep 17 00:00:00 2001 From: mauwii Date: Thu, 15 Dec 2022 21:11:51 +0100 Subject: [PATCH 17/26] update site_name --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 3779b0523e..964e991ee9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,7 +1,7 @@ # yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json # General -site_name: Stable Diffusion Toolkit Docs +site_name: InvokeAI Stable Diffusion Toolkit Docs site_url: https://invoke-ai.github.io/InvokeAI site_author: mauwii dev_addr: '127.0.0.1:8080' From f7170e4156a4713dec5723d9572ad7dbbbbf0cd7 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Thu, 15 Dec 2022 20:08:07 +0000 Subject: [PATCH 18/26] improve installation documentation 1. Added a big fat warning to the Windows installer to tell user to install Visual C++ redistributable. 2. Added a bit fat warning to the automated installer doc to tell user the same thing. 3. Reordered entries on the table-of-contents sidebar for installation to prioritize the most important docs. 4. Moved older installation documentation into deprecated folder. 5. Moved developer-specific installation documentation into the developers folder. --- docs/installation/010_INSTALL_AUTOMATED.md | 308 ++++++++++ docs/installation/020_INSTALL_MANUAL.md | 579 +++++++++++++++++ ...NSTALL_DOCKER.md => 040_INSTALL_DOCKER.md} | 2 +- ...ING_MODELS.md => 050_INSTALLING_MODELS.md} | 0 ...ATCHMATCH.md => 060_INSTALL_PATCHMATCH.md} | 0 .../BUILDING_BINARY_INSTALLERS.md | 0 docs/installation/INSTALL_AUTOMATED.md | 316 +--------- docs/installation/INSTALL_MANUAL.md | 580 +----------------- .../INSTALL_BINARY.md} | 0 .../INSTALL_JUPYTER.md | 0 .../INSTALL_LINUX.md | 0 .../INSTALL_MAC.md | 0 .../INSTALL_PCP.md | 0 .../INSTALL_SOURCE.md | 0 .../INSTALL_WINDOWS.md | 0 docs/installation/index.md | 6 +- installer/install.bat.in | 11 +- 17 files changed, 898 insertions(+), 904 deletions(-) create mode 100644 docs/installation/010_INSTALL_AUTOMATED.md create mode 100644 docs/installation/020_INSTALL_MANUAL.md rename docs/installation/{INSTALL_DOCKER.md => 040_INSTALL_DOCKER.md} (99%) rename docs/installation/{INSTALLING_MODELS.md => 050_INSTALLING_MODELS.md} (100%) rename docs/installation/{INSTALL_PATCHMATCH.md => 060_INSTALL_PATCHMATCH.md} (100%) rename docs/installation/{ => Developers_documentation}/BUILDING_BINARY_INSTALLERS.md (100%) mode change 100644 => 120000 docs/installation/INSTALL_AUTOMATED.md mode change 100644 => 120000 docs/installation/INSTALL_MANUAL.md rename docs/installation/{INSTALL_INVOKE.md => deprecated_documentation/INSTALL_BINARY.md} (100%) rename docs/installation/{ => deprecated_documentation}/INSTALL_JUPYTER.md (100%) rename docs/installation/{older_docs_to_be_removed => deprecated_documentation}/INSTALL_LINUX.md (100%) rename docs/installation/{older_docs_to_be_removed => deprecated_documentation}/INSTALL_MAC.md (100%) rename docs/installation/{ => deprecated_documentation}/INSTALL_PCP.md (100%) rename docs/installation/{ => deprecated_documentation}/INSTALL_SOURCE.md (100%) rename docs/installation/{older_docs_to_be_removed => deprecated_documentation}/INSTALL_WINDOWS.md (100%) diff --git a/docs/installation/010_INSTALL_AUTOMATED.md b/docs/installation/010_INSTALL_AUTOMATED.md new file mode 100644 index 0000000000..503cf6a2b0 --- /dev/null +++ b/docs/installation/010_INSTALL_AUTOMATED.md @@ -0,0 +1,308 @@ +--- +title: Installing with the Automated Installer +--- + +# InvokeAI Automated Installation + +## Introduction + +The automated installer is a shell script that attempts to automate every step +needed to install and run InvokeAI on a stock computer running recent versions +of Linux, MacOS or Windows. It will leave you with a version that runs a stable +version of InvokeAI with the option to upgrade to experimental versions later. + +## Walk through + +1. Make sure that your system meets the + [hardware requirements](../index.md#hardware-requirements) and has the + appropriate GPU drivers installed. In particular, if you are a Linux user + with an AMD GPU installed, you may need to install the + [ROCm driver](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html). + + !!! info "Required Space" + + Installation requires roughly 18G of free disk space to load the libraries and + recommended model weights files. + +2. Check that your system has an up-to-date Python installed. To do this, open + up a command-line window ("Terminal" on Linux and Macintosh, "Command" or + "Powershell" on Windows) and type `python --version`. If Python is + installed, it will print out the version number. If it is version `3.9.1` or + higher, you meet requirements. + + + + !!! warning "If you see an older version, or get a command not found error" + + Go to [Python Downloads](https://www.python.org/downloads/) and + download the appropriate installer package for your platform. We recommend + [Version 3.10.9](https://www.python.org/downloads/release/python-3109/), + which has been extensively tested with InvokeAI. + + !!! warning "At this time we do not recommend Python 3.11" + + _Please select your platform in the section below for platform-specific + setup requirements._ + + === "Windows users" + + - During the Python configuration process, + look out for a checkbox to add Python to your PATH + and select it. If the install script complains that it can't + find python, then open the Python installer again and choose + "Modify" existing installation. + + - Installation requires an up to date version of the Microsoft Visual C libraries. Please install the 2015-2022 libraries available here: https://learn.microsoft.com/en-us/cpp/windows/deploying-native-desktop-applications-visual-cpp?view=msvc-170 + + === "Mac users" + + - After installing Python, you may need to run the + following command from the Terminal in order to install the Web + certificates needed to download model data from https sites. If + you see lots of CERTIFICATE ERRORS during the last part of the + install, this is the problem, and you can fix it with this command: + + `/Applications/Python\ 3.10/Install\ Certificates.command` + + - You may need to install the Xcode command line tools. These + are a set of tools that are needed to run certain applications in a + Terminal, including InvokeAI. This package is provided directly by Apple. + + - To install, open a terminal window and run `xcode-select + --install`. You will get a macOS system popup guiding you through the + install. If you already have them installed, you will instead see some + output in the Terminal advising you that the tools are already installed. + + - More information can be found here: + https://www.freecodecamp.org/news/install-xcode-command-line-tools/ + + === "Linux users" + + For reasons that are not entirely clear, installing the correct version of Python can be a bit of a challenge on Ubuntu, Linux Mint, and otherUbuntu-derived distributions. + + In particular, Ubuntu version 20.04 LTS comes with an old version of Python, does not come with the PIP package manager installed, and to make matters worse, the `python` command points to Python2, not Python3. + + Here is the quick recipe for bringing your system up to date: + + ``` + sudo apt update + sudo apt install python3.9 + sudo apt install python3-pip + cd /usr/bin + sudo ln -sf python3.9 python3 + sudo ln -sf python3 python + ``` + + You can still access older versions of Python by calling `python2`, `python3.8`, + etc. + +3. The source installer is distributed in ZIP files. Go to the + [latest release](https://github.com/invoke-ai/InvokeAI/releases/latest), and + look for a series of files named: + + - [InvokeAI-installer-2.2.4-mac.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-mac.zip) + - [InvokeAI-installer-2.2.4-windows.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-windows.zip) + - [InvokeAI-installer-2.2.4-linux.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-linux.zip) + + Download the one that is appropriate for your operating system. + +4. Unpack the zip file into a convenient directory. This will create a new + directory named "InvokeAI-Installer". This example shows how this would look + using the `unzip` command-line tool, but you may use any graphical or + command-line Zip extractor: + + ```cmd + C:\Documents\Linco> unzip InvokeAI-installer-2.2.4-windows.zip + Archive: C: \Linco\Downloads\InvokeAI-installer-2.2.4-windows.zip + creating: InvokeAI-Installer\ + inflating: InvokeAI-Installer\install.bat + inflating: InvokeAI-Installer\readme.txt + ... + ``` + + After successful installation, you can delete the `InvokeAI-Installer` + directory. + +5. **Windows only** Please double-click on the file WinLongPathsEnabled.reg and + accept the dialog box that asks you if you wish to modify your registry. + This activates long filename support on your system and will prevent + mysterious errors during installation. + +6. If you are using a desktop GUI, double-click the installer file. It will be + named `install.bat` on Windows systems and `install.sh` on Linux and + Macintosh systems. + + On Windows systems you will probably get an "Untrusted Publisher" warning. + Click on "More Info" and select "Run Anyway." You trust us, right? + +7. Alternatively, from the command line, run the shell script or .bat file: + + ```cmd + C:\Documents\Linco> cd InvokeAI-Installer + C:\Documents\Linco\invokeAI> install.bat + ``` + +8. The script will ask you to choose where to install InvokeAI. Select a + directory with at least 18G of free space for a full install. InvokeAI and + all its support files will be installed into a new directory named + `invokeai` located at the location you specify. + + - The default is to install the `invokeai` directory in your home directory, + usually `C:\Users\YourName\invokeai` on Windows systems, + `/home/YourName/invokeai` on Linux systems, and `/Users/YourName/invokeai` + on Macintoshes, where "YourName" is your login name. + + - The script uses tab autocompletion to suggest directory path completions. + Type part of the path (e.g. "C:\Users") and press ++tab++ repeatedly + to suggest completions. + +9. Sit back and let the install script work. It will install the third-party + libraries needed by InvokeAI, then download the current InvokeAI release and + install it. + + Be aware that some of the library download and install steps take a long + time. In particular, the `pytorch` package is quite large and often appears + to get "stuck" at 99.9%. Have patience and the installation step will + eventually resume. However, there are occasions when the library install + does legitimately get stuck. If you have been waiting for more than ten + minutes and nothing is happening, you can interrupt the script with ^C. You + may restart it and it will pick up where it left off. + +10. After installation completes, the installer will launch a script called + `configure_invokeai.py`, which will guide you through the first-time process + of selecting one or more Stable Diffusion model weights files, downloading + and configuring them. We provide a list of popular models that InvokeAI + performs well with. However, you can add more weight files later on using + the command-line client or the Web UI. See + [Installing Models](INSTALLING_MODELS.md) for details. + + Note that the main Stable Diffusion weights file is protected by a license + agreement that you must agree to in order to use. The script will list the + steps you need to take to create an account on the official site that hosts + the weights files, accept the agreement, and provide an access token that + allows InvokeAI to legally download and install the weights files. + + If you have already downloaded the weights file(s) for another Stable + Diffusion distribution, you may skip this step (by selecting "skip" when + prompted) and configure InvokeAI to use the previously-downloaded files. The + process for this is described in [Installing Models](INSTALLING_MODELS.md). + +11. The script will now exit and you'll be ready to generate some images. Look + for the directory `invokeai` installed in the location you chose at the + beginning of the install session. Look for a shell script named `invoke.sh` + (Linux/Mac) or `invoke.bat` (Windows). Launch the script by double-clicking + it or typing its name at the command-line: + + ```cmd + C:\Documents\Linco> cd invokeai + C:\Documents\Linco\invokeAI> invoke.bat + ``` + + - The `invoke.bat` (`invoke.sh`) script will give you the choice of starting + (1) the command-line interface, or (2) the web GUI. If you start the + latter, you can load the user interface by pointing your browser at + http://localhost:9090. + + - The script also offers you a third option labeled "open the developer + console". If you choose this option, you will be dropped into a + command-line interface in which you can run python commands directly, + access developer tools, and launch InvokeAI with customized options. + +12. You can launch InvokeAI with several different command-line arguments that + customize its behavior. For example, you can change the location of the + image output directory, or select your favorite sampler. See the + [Command-Line Interface](../features/CLI.md) for a full list of the options. + + - To set defaults that will take effect every time you launch InvokeAI, + use a text editor (e.g. Notepad) to exit the file + `invokeai\invokeai.init`. It contains a variety of examples that you can + follow to add and modify launch options. + +!!! warning "The `invokeai` directory contains the `invoke` application, its +configuration files, the model weight files, and outputs of image generation. +Once InvokeAI is installed, do not move or remove this directory." + +## Troubleshooting + +### _Package dependency conflicts_ + +If you have previously installed InvokeAI or another Stable Diffusion package, +the installer may occasionally pick up outdated libraries and either the +installer or `invoke` will fail with complaints about library conflicts. You can +address this by entering the `invokeai` directory and running `update.sh`, which +will bring InvokeAI up to date with the latest libraries. + +### ldm from pypi + +!!! warning + + Some users have tried to correct dependency problems by installing + the `ldm` package from PyPi.org. Unfortunately this is an unrelated package that + has nothing to do with the 'latent diffusion model' used by InvokeAI. Installing + ldm will make matters worse. If you've installed ldm, uninstall it with + `pip uninstall ldm`. + +### Corrupted configuration file + +Everything seems to install ok, but `invoke` complains of a corrupted +configuration file and goes back into the configuration process (asking you to +download models, etc), but this doesn't fix the problem. + +This issue is often caused by a misconfigured configuration directive in the +`invokeai\invokeai.init` initialization file that contains startup settings. The +easiest way to fix the problem is to move the file out of the way and re-run +`configure_invokeai.py`. Enter the developer's console (option 3 of the launcher +script) and run this command: + +```cmd +configure_invokeai.py --root=. +``` + +Note the dot (.) after `--root`. It is part of the command. + +_If none of these maneuvers fixes the problem_ then please report the problem to +the [InvokeAI Issues](https://github.com/invoke-ai/InvokeAI/issues) section, or +visit our [Discord Server](https://discord.gg/ZmtBAhwWhy) for interactive +assistance. + +### other problems + +If you run into problems during or after installation, the InvokeAI team is +available to help you. Either create an +[Issue](https://github.com/invoke-ai/InvokeAI/issues) at our GitHub site, or +make a request for help on the "bugs-and-support" channel of our +[Discord server](https://discord.gg/ZmtBAhwWhy). We are a 100% volunteer +organization, but typically somebody will be available to help you within 24 +hours, and often much sooner. + +## Updating to newer versions + +This distribution is changing rapidly, and we add new features on a daily basis. +To update to the latest released version (recommended), run the `update.sh` +(Linux/Mac) or `update.bat` (Windows) scripts. This will fetch the latest +release and re-run the `configure_invokeai` script to download any updated +models files that may be needed. You can also use this to add additional models +that you did not select at installation time. + +You can now close the developer console and run `invoke` as before. If you get +complaints about missing models, then you may need to do the additional step of +running `configure_invokeai.py`. This happens relatively infrequently. To do +this, simply open up the developer's console again and type +`python scripts/configure_invokeai.py`. + +You may also use the `update` script to install any selected version of +InvokeAI. From https://github.com/invoke-ai/InvokeAI, navigate to the zip file +link of the version you wish to install. You can find the zip links by going to +the one of the release pages and looking for the **Assets** section at the +bottom. Alternatively, you can browse "branches" and "tags" at the top of the +big code directory on the InvokeAI welcome page. When you find the version you +want to install, go to the green "<> Code" button at the top, and copy the +"Download ZIP" link. + +Now run `update.sh` (or `update.bat`) with the URL of the desired InvokeAI +version as its argument. For example, this will install the old 2.2.0 release. + +```cmd +update.sh https://github.com/invoke-ai/InvokeAI/archive/refs/tags/v2.2.0.zip +``` + diff --git a/docs/installation/020_INSTALL_MANUAL.md b/docs/installation/020_INSTALL_MANUAL.md new file mode 100644 index 0000000000..2f22738303 --- /dev/null +++ b/docs/installation/020_INSTALL_MANUAL.md @@ -0,0 +1,579 @@ +--- +title: Installing Manually +--- + +
+# :fontawesome-brands-linux: Linux | :fontawesome-brands-apple: macOS | :fontawesome-brands-windows: Windows +
+ +!!! warning "This is for advanced Users" + + who are already experienced with using conda or pip + +## Introduction + +You have two choices for manual installation, the [first +one](#PIP_method) uses basic Python virtual environment (`venv`) +commands and the PIP package manager. The [second one](#Conda_method) +based on the Anaconda3 package manager (`conda`). Both methods require +you to enter commands on the terminal, also known as the "console". + +Note that the conda install method is currently deprecated and will not +be supported at some point in the future. + +On Windows systems you are encouraged to install and use the +[Powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3), +which provides compatibility with Linux and Mac shells and nice +features such as command-line completion. + +## pip Install + +To install InvokeAI with virtual environments and the PIP package +manager, please follow these steps: + +1. Make sure you are using Python 3.9 or 3.10. The rest of the install + procedure depends on this: + + ```bash + python -V + ``` + +2. From within the InvokeAI top-level directory, create and activate a virtual + environment named `invokeai`: + + ```bash + python -mvenv invokeai + source invokeai/bin/activate + ``` + +3. Make sure that pip is installed in your virtual environment an up to date: + + ```bash + python -mensurepip --upgrade + python -mpip install --upgrade pip + ``` + +4. Pick the correct `requirements*.txt` file for your hardware and operating + system. + + We have created a series of environment files suited for different operating + systems and GPU hardware. They are located in the + `environments-and-requirements` directory: + +
+ + | filename | OS | + | :---------------------------------: | :-------------------------------------------------------------: | + | requirements-lin-amd.txt | Linux with an AMD (ROCm) GPU | + | requirements-lin-arm64.txt | Linux running on arm64 systems | + | requirements-lin-cuda.txt | Linux with an NVIDIA (CUDA) GPU | + | requirements-mac-mps-cpu.txt | Macintoshes with MPS acceleration | + | requirements-lin-win-colab-cuda.txt | Windows with an NVIDA (CUDA) GPU
(supports Google Colab too) | + +
+ + Select the appropriate requirements file, and make a link to it from + `requirements.txt` in the top-level InvokeAI directory. The command to do + this from the top-level directory is: + + !!! example "" + + === "Macintosh and Linux" + + !!! info "Replace `xxx` and `yyy` with the appropriate OS and GPU codes." + + ```bash + ln -sf environments-and-requirements/requirements-xxx-yyy.txt requirements.txt + ``` + + === "Windows" + + !!! info "on Windows, admin privileges are required to make links, so we use the copy command instead" + + ```cmd + copy environments-and-requirements\requirements-lin-win-colab-cuda.txt requirements.txt + ``` + + !!! warning + + Please do not link or copy `environments-and-requirements/requirements-base.txt`. + This is a base requirements file that does not have the platform-specific + libraries. Also, be sure to link or copy the platform-specific file to + a top-level file named `requirements.txt` as shown here. Running pip on + a requirements file in a subdirectory will not work as expected. + + When this is done, confirm that a file named `requirements.txt` has been + created in the InvokeAI root directory and that it points to the correct + file in `environments-and-requirements`. + +5. Run PIP + + Be sure that the `invokeai` environment is active before doing this: + + ```bash + pip install --prefer-binary -r requirements.txt + ``` + +6. Set up the runtime directory + + In this step you will initialize a runtime directory that will + contain the models, model config files, directory for textual + inversion embeddings, and your outputs. This keeps the runtime + directory separate from the source code and aids in updating. + + You may pick any location for this directory using the `--root_dir` + option (abbreviated --root). If you don't pass this option, it will + default to `invokeai` in your home directory. + + ```bash + configure_invokeai.py --root_dir ~/Programs/invokeai + ``` + + The script `configure_invokeai.py` will interactively guide you through the + process of downloading and installing the weights files needed for InvokeAI. + Note that the main Stable Diffusion weights file is protected by a license + agreement that you have to agree to. The script will list the steps you need + to take to create an account on the site that hosts the weights files, + accept the agreement, and provide an access token that allows InvokeAI to + legally download and install the weights files. + + If you get an error message about a module not being installed, check that + the `invokeai` environment is active and if not, repeat step 5. + + Note that `configure_invokeai.py` and `invoke.py` should be installed + under your virtual environment directory and the system should find them + on the PATH. If this isn't working on your system, you can call the + scripts directory using `python scripts/configure_invoke.py` and + `python scripts/invoke.py`. + + !!! tip + + If you have already downloaded the weights file(s) for another Stable + Diffusion distribution, you may skip this step (by selecting "skip" when + prompted) and configure InvokeAI to use the previously-downloaded files. The + process for this is described in [here](INSTALLING_MODELS.md). + +7. Run the command-line- or the web- interface: + + Activate the environment (with `source invokeai/bin/activate`), and then + run the script `invoke.py`. If you selected a non-default location + for the runtime directory, please specify the path with the `--root_dir` + option (abbreviated below as `--root`): + + !!! example "" + + !!! warning "Make sure that the virtual environment is activated, which should create `(invokeai)` in front of your prompt!" + + === "CLI" + + ```bash + invoke.py --root ~/Programs/invokeai + ``` + + === "local Webserver" + + ```bash + invoke.py --web --root ~/Programs/invokeai + ``` + + === "Public Webserver" + + ```bash + invoke.py --web --host 0.0.0.0 --root ~/Programs/invokeai + ``` + + If you choose the run the web interface, point your browser at + http://localhost:9090 in order to load the GUI. + + !!! tip + + You can permanently set the location of the runtime directory by setting the environment variable INVOKEAI_ROOT to the path of the directory. + +8. Render away! + + Browse the [features](../features/CLI.md) section to learn about all the things you + can do with InvokeAI. + + Note that some GPUs are slow to warm up. In particular, when using an AMD + card with the ROCm driver, you may have to wait for over a minute the first + time you try to generate an image. Fortunately, after the warm up period + rendering will be fast. + +9. Subsequently, to relaunch the script, be sure to run "conda activate + invokeai", enter the `InvokeAI` directory, and then launch the invoke + script. If you forget to activate the 'invokeai' environment, the script + will fail with multiple `ModuleNotFound` errors. + + !!! tip + + Do not move the source code repository after installation. The virtual environment directory has absolute paths in it that get confused if the directory is moved. + +--- + +### Conda method + +1. Check that your system meets the + [hardware requirements](index.md#Hardware_Requirements) and has the + appropriate GPU drivers installed. In particular, if you are a Linux user + with an AMD GPU installed, you may need to install the + [ROCm driver](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html). + + InvokeAI does not yet support Windows machines with AMD GPUs due to the lack + of ROCm driver support on this platform. + + To confirm that the appropriate drivers are installed, run `nvidia-smi` on + NVIDIA/CUDA systems, and `rocm-smi` on AMD systems. These should return + information about the installed video card. + + Macintosh users with MPS acceleration, or anybody with a CPU-only system, + can skip this step. + +2. You will need to install Anaconda3 and Git if they are not already + available. Use your operating system's preferred package manager, or + download the installers manually. You can find them here: + + - [Anaconda3](https://www.anaconda.com/) + - [git](https://git-scm.com/downloads) + +3. Clone the [InvokeAI](https://github.com/invoke-ai/InvokeAI) source code from + GitHub: + + ```bash + git clone https://github.com/invoke-ai/InvokeAI.git + ``` + + This will create InvokeAI folder where you will follow the rest of the + steps. + +4. Enter the newly-created InvokeAI folder: + + ```bash + cd InvokeAI + ``` + + From this step forward make sure that you are working in the InvokeAI + directory! + +5. Select the appropriate environment file: + + We have created a series of environment files suited for different operating + systems and GPU hardware. They are located in the + `environments-and-requirements` directory: + +
+ + | filename | OS | + | :----------------------: | :----------------------------: | + | environment-lin-amd.yml | Linux with an AMD (ROCm) GPU | + | environment-lin-cuda.yml | Linux with an NVIDIA CUDA GPU | + | environment-mac.yml | Macintosh | + | environment-win-cuda.yml | Windows with an NVIDA CUDA GPU | + +
+ + Choose the appropriate environment file for your system and link or copy it + to `environment.yml` in InvokeAI's top-level directory. To do so, run + following command from the repository-root: + + !!! Example "" + + === "Macintosh and Linux" + + !!! todo "Replace `xxx` and `yyy` with the appropriate OS and GPU codes as seen in the table above" + + ```bash + ln -sf environments-and-requirements/environment-xxx-yyy.yml environment.yml + ``` + + When this is done, confirm that a file `environment.yml` has been linked in + the InvokeAI root directory and that it points to the correct file in the + `environments-and-requirements`. + + ```bash + ls -la + ``` + + === "Windows" + + !!! todo " Since it requires admin privileges to create links, we will use the copy command to create your `environment.yml`" + + ```cmd + copy environments-and-requirements\environment-win-cuda.yml environment.yml + ``` + + Afterwards verify that the file `environment.yml` has been created, either via the + explorer or by using the command `dir` from the terminal + + ```cmd + dir + ``` + + !!! warning "Do not try to run conda on directly on the subdirectory environments file. This won't work. Instead, copy or link it to the top-level directory as shown." + +6. Create the conda environment: + + ```bash + conda env update + ``` + + This will create a new environment named `invokeai` and install all InvokeAI + dependencies into it. If something goes wrong you should take a look at + [troubleshooting](#troubleshooting). + +7. Activate the `invokeai` environment: + + In order to use the newly created environment you will first need to + activate it + + ```bash + conda activate invokeai + ``` + + Your command-line prompt should change to indicate that `invokeai` is active + by prepending `(invokeai)`. + +8. Set up the runtime directory + + In this step you will initialize a runtime directory that will + contain the models, model config files, directory for textual + inversion embeddings, and your outputs. This keeps the runtime + directory separate from the source code and aids in updating. + + You may pick any location for this directory using the `--root_dir` + option (abbreviated --root). If you don't pass this option, it will + default to `invokeai` in your home directory. + + ```bash + python scripts/configure_invokeai.py --root_dir ~/Programs/invokeai + ``` + + The script `configure_invokeai.py` will interactively guide you through the + process of downloading and installing the weights files needed for InvokeAI. + Note that the main Stable Diffusion weights file is protected by a license + agreement that you have to agree to. The script will list the steps you need + to take to create an account on the site that hosts the weights files, + accept the agreement, and provide an access token that allows InvokeAI to + legally download and install the weights files. + + If you get an error message about a module not being installed, check that + the `invokeai` environment is active and if not, repeat step 5. + + Note that `configure_invokeai.py` and `invoke.py` should be + installed under your conda directory and the system should find + them automatically on the PATH. If this isn't working on your + system, you can call the scripts directory using `python + scripts/configure_invoke.py` and `python scripts/invoke.py`. + + !!! tip + + If you have already downloaded the weights file(s) for another Stable + Diffusion distribution, you may skip this step (by selecting "skip" when + prompted) and configure InvokeAI to use the previously-downloaded files. The + process for this is described in [here](INSTALLING_MODELS.md). + +9. Run the command-line- or the web- interface: + + Activate the environment (with `source invokeai/bin/activate`), and then + run the script `invoke.py`. If you selected a non-default location + for the runtime directory, please specify the path with the `--root_dir` + option (abbreviated below as `--root`): + + !!! example "" + + !!! warning "Make sure that the conda environment is activated, which should create `(invokeai)` in front of your prompt!" + + === "CLI" + + ```bash + invoke.py --root ~/Programs/invokeai + ``` + + === "local Webserver" + + ```bash + invoke.py --web --root ~/Programs/invokeai + ``` + + === "Public Webserver" + + ```bash + invoke.py --web --host 0.0.0.0 --root ~/Programs/invokeai + ``` + + If you choose the run the web interface, point your browser at + http://localhost:9090 in order to load the GUI. + + !!! tip + + You can permanently set the location of the runtime directory by setting the environment variable INVOKEAI_ROOT to the path of your choice. + +10. Render away! + + Browse the [features](../features/CLI.md) section to learn about all the things you + can do with InvokeAI. + + Note that some GPUs are slow to warm up. In particular, when using an AMD + card with the ROCm driver, you may have to wait for over a minute the first + time you try to generate an image. Fortunately, after the warm up period + rendering will be fast. + +11. Subsequently, to relaunch the script, be sure to run "conda activate + invokeai", enter the `InvokeAI` directory, and then launch the invoke + script. If you forget to activate the 'invokeai' environment, the script + will fail with multiple `ModuleNotFound` errors. + +## Creating an "install" version of InvokeAI + +If you wish you can install InvokeAI and all its dependencies in the +runtime directory. This allows you to delete the source code +repository and eliminates the need to provide `--root_dir` at startup +time. Note that this method only works with the PIP method. + +1. Follow the instructions for the PIP install, but in step #2 put the + virtual environment into the runtime directory. For example, assuming the + runtime directory lives in `~/Programs/invokeai`, you'd run: + + ```bash + python -menv ~/Programs/invokeai + ``` + +2. Now follow steps 3 to 5 in the PIP recipe, ending with the `pip install` + step. + +3. Run one additional step while you are in the source code repository + directory `pip install .` (note the dot at the end). + +4. That's all! Now, whenever you activate the virtual environment, + `invoke.py` will know where to look for the runtime directory without + needing a `--root_dir` argument. In addition, you can now move or + delete the source code repository entirely. + + (Don't move the runtime directory!) + +## Updating to newer versions of the script + +This distribution is changing rapidly. If you used the `git clone` method +(step 5) to download the InvokeAI directory, then to update to the latest and +greatest version, launch the Anaconda window, enter `InvokeAI` and type: + +```bash +git pull +conda env update +python scripts/configure_invokeai.py --no-interactive #optional +``` + +This will bring your local copy into sync with the remote one. The last step may +be needed to take advantage of new features or released models. The +`--no-interactive` flag will prevent the script from prompting you to download +the big Stable Diffusion weights files. + +## Troubleshooting + +Here are some common issues and their suggested solutions. + +### Conda + +#### Conda fails before completing `conda update` + +The usual source of these errors is a package incompatibility. While we have +tried to minimize these, over time packages get updated and sometimes introduce +incompatibilities. + +We suggest that you search +[Issues](https://github.com/invoke-ai/InvokeAI/issues) or the "bugs-and-support" +channel of the [InvokeAI Discord](https://discord.gg/ZmtBAhwWhy). + +You may also try to install the broken packages manually using PIP. To do this, +activate the `invokeai` environment, and run `pip install` with the name and +version of the package that is causing the incompatibility. For example: + +```bash +pip install test-tube==0.7.5 +``` + +You can keep doing this until all requirements are satisfied and the `invoke.py` +script runs without errors. Please report to +[Issues](https://github.com/invoke-ai/InvokeAI/issues) what you were able to do +to work around the problem so that others can benefit from your investigation. + +### Create Conda Environment fails on MacOS + +If conda create environment fails with lmdb error, this is most likely caused by Clang. +Run brew config to see which Clang is installed on your Mac. If Clang isn't installed, that's causing the error. +Start by installing additional XCode command line tools, followed by brew install llvm. + +```bash +xcode-select --install +brew install llvm +``` + +If brew config has Clang installed, update to the latest llvm and try creating the environment again. + +#### `configure_invokeai.py` or `invoke.py` crashes at an early stage + +This is usually due to an incomplete or corrupted Conda install. Make sure you +have linked to the correct environment file and run `conda update` again. + +If the problem persists, a more extreme measure is to clear Conda's caches and +remove the `invokeai` environment: + +```bash +conda deactivate +conda env remove -n invokeai +conda clean -a +conda update +``` + +This removes all cached library files, including ones that may have been +corrupted somehow. (This is not supposed to happen, but does anyway). + +#### `invoke.py` crashes at a later stage + +If the CLI or web site had been working ok, but something unexpected happens +later on during the session, you've encountered a code bug that is probably +unrelated to an install issue. Please search +[Issues](https://github.com/invoke-ai/InvokeAI/issues), file a bug report, or +ask for help on [Discord](https://discord.gg/ZmtBAhwWhy) + +#### My renders are running very slowly + +You may have installed the wrong torch (machine learning) package, and the +system is running on CPU rather than the GPU. To check, look at the log messages +that appear when `invoke.py` is first starting up. One of the earlier lines +should say `Using device type cuda`. On AMD systems, it will also say "cuda", +and on Macintoshes, it should say "mps". If instead the message says it is +running on "cpu", then you may need to install the correct torch library. + +You may be able to fix this by installing a different torch library. Here are +the magic incantations for Conda and PIP. + +!!! todo "For CUDA systems" + + - conda + + ```bash + conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia + ``` + + - pip + + ```bash + pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116 + ``` + +!!! todo "For AMD systems" + + - conda + + ```bash + conda activate invokeai + pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.2/ + ``` + + - pip + + ```bash + pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.2/ + ``` + +More information and troubleshooting tips can be found at https://pytorch.org. diff --git a/docs/installation/INSTALL_DOCKER.md b/docs/installation/040_INSTALL_DOCKER.md similarity index 99% rename from docs/installation/INSTALL_DOCKER.md rename to docs/installation/040_INSTALL_DOCKER.md index 9f0b203930..9b9ccaadf0 100644 --- a/docs/installation/INSTALL_DOCKER.md +++ b/docs/installation/040_INSTALL_DOCKER.md @@ -1,5 +1,5 @@ --- -title: Docker +title: Installing with Docker --- # :fontawesome-brands-docker: Docker diff --git a/docs/installation/INSTALLING_MODELS.md b/docs/installation/050_INSTALLING_MODELS.md similarity index 100% rename from docs/installation/INSTALLING_MODELS.md rename to docs/installation/050_INSTALLING_MODELS.md diff --git a/docs/installation/INSTALL_PATCHMATCH.md b/docs/installation/060_INSTALL_PATCHMATCH.md similarity index 100% rename from docs/installation/INSTALL_PATCHMATCH.md rename to docs/installation/060_INSTALL_PATCHMATCH.md diff --git a/docs/installation/BUILDING_BINARY_INSTALLERS.md b/docs/installation/Developers_documentation/BUILDING_BINARY_INSTALLERS.md similarity index 100% rename from docs/installation/BUILDING_BINARY_INSTALLERS.md rename to docs/installation/Developers_documentation/BUILDING_BINARY_INSTALLERS.md diff --git a/docs/installation/INSTALL_AUTOMATED.md b/docs/installation/INSTALL_AUTOMATED.md deleted file mode 100644 index 9b33e1e5fd..0000000000 --- a/docs/installation/INSTALL_AUTOMATED.md +++ /dev/null @@ -1,315 +0,0 @@ ---- -title: InvokeAI Automated Installation ---- - -# InvokeAI Automated Installation - -## Introduction - -The automated installer is a shell script that attempts to automate every step -needed to install and run InvokeAI on a stock computer running recent versions -of Linux, MacOS or Windows. It will leave you with a version that runs a stable -version of InvokeAI with the option to upgrade to experimental versions later. - -## Walk through - -1. Make sure that your system meets the - [hardware requirements](../index.md#hardware-requirements) and has the - appropriate GPU drivers installed. In particular, if you are a Linux user - with an AMD GPU installed, you may need to install the - [ROCm driver](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html). - - !!! info "Required Space" - - Installation requires roughly 18G of free disk space to load the libraries and - recommended model weights files. - -2. Check that your system has an up-to-date Python installed. To do this, open - up a command-line window ("Terminal" on Linux and Macintosh, "Command" or - "Powershell" on Windows) and type `python --version`. If Python is - installed, it will print out the version number. If it is version `3.9.1` or - higher, you meet requirements. - - !!! warning "If you see an older version, or get a command not found error" - - Go to [Python Downloads](https://www.python.org/downloads/) and - download the appropriate installer package for your platform. We recommend - [Version 3.10.9](https://www.python.org/downloads/release/python-3109/), - which has been extensively tested with InvokeAI. - - !!! warning "At this time we do not recommend Python 3.11" - - === "Windows users" - - - During the Python configuration process, - Please look out for a checkbox to add Python to your PATH - and select it. If the install script complains that it can't - find python, then open the Python installer again and choose - "Modify" existing installation. - - - There is a slight possibility that you will encountered - DLL load errors at the very end of the installation process. This is caused - by not having up to date Visual C++ redistributable libraries. If this - happens to you, you can install the C++ libraries from this site: - https://learn.microsoft.com/en-us/cpp/windows/deploying-native-desktop-applications-visual-cpp?view=msvc-170 - - === "Mac users" - - - After installing Python, you may need to run the - following command from the Terminal in order to install the Web - certificates needed to download model data from https sites. If - you see lots of CERTIFICATE ERRORS during the last part of the - install, this is the problem, and you can fix it with this command: - - `/Applications/Python\ 3.10/Install\ Certificates.command` - - - You may need to install the Xcode command line tools. These - are a set of tools that are needed to run certain applications in a - Terminal, including InvokeAI. This package is provided directly by Apple. - - - To install, open a terminal window and run `xcode-select - --install`. You will get a macOS system popup guiding you through the - install. If you already have them installed, you will instead see some - output in the Terminal advising you that the tools are already installed. - - - More information can be found here: - https://www.freecodecamp.org/news/install-xcode-command-line-tools/ - - === "Linux users" - - - See [Installing Python in Ubuntu](#installing-python-in-ubuntu) for some - platform-specific tips. - -3. The source installer is distributed in ZIP files. Go to the - [latest release](https://github.com/invoke-ai/InvokeAI/releases/latest), and - look for a series of files named: - - - [InvokeAI-installer-2.2.4-mac.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-mac.zip) - - [InvokeAI-installer-2.2.4-windows.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-windows.zip) - - [InvokeAI-installer-2.2.4-linux.zip](https://github.com/invoke-ai/InvokeAI/releases/latest/download/InvokeAI-installer-2.2.4-linux.zip) - - Download the one that is appropriate for your operating system. - -4. Unpack the zip file into a convenient directory. This will create a new - directory named "InvokeAI-Installer". This example shows how this would look - using the `unzip` command-line tool, but you may use any graphical or - command-line Zip extractor: - - ```cmd - C:\Documents\Linco> unzip InvokeAI-installer-2.2.4-windows.zip - Archive: C: \Linco\Downloads\InvokeAI-installer-2.2.4-windows.zip - creating: InvokeAI-Installer\ - inflating: InvokeAI-Installer\install.bat - inflating: InvokeAI-Installer\readme.txt - ... - ``` - - After successful installation, you can delete the `InvokeAI-Installer` - directory. - -5. **Windows only** Please double-click on the file WinLongPathsEnabled.reg and - accept the dialog box that asks you if you wish to modify your registry. - This activates long filename support on your system and will prevent - mysterious errors during installation. - -6. If you are using a desktop GUI, double-click the installer file. It will be - named `install.bat` on Windows systems and `install.sh` on Linux and - Macintosh systems. - - On Windows systems you will probably get an "Untrusted Publisher" warning. - Click on "More Info" and select "Run Anyway." You trust us, right? - -7. Alternatively, from the command line, run the shell script or .bat file: - - ```cmd - C:\Documents\Linco> cd InvokeAI-Installer - C:\Documents\Linco\invokeAI> install.bat - ``` - -8. The script will ask you to choose where to install InvokeAI. Select a - directory with at least 18G of free space for a full install. InvokeAI and - all its support files will be installed into a new directory named - `invokeai` located at the location you specify. - - - The default is to install the `invokeai` directory in your home directory, - usually `C:\Users\YourName\invokeai` on Windows systems, - `/home/YourName/invokeai` on Linux systems, and `/Users/YourName/invokeai` - on Macintoshes, where "YourName" is your login name. - - - The script uses tab autocompletion to suggest directory path completions. - Type part of the path (e.g. "C:\Users") and press ++tab++ repeatedly - to suggest completions. - -9. Sit back and let the install script work. It will install the third-party - libraries needed by InvokeAI, then download the current InvokeAI release and - install it. - - Be aware that some of the library download and install steps take a long - time. In particular, the `pytorch` package is quite large and often appears - to get "stuck" at 99.9%. Have patience and the installation step will - eventually resume. However, there are occasions when the library install - does legitimately get stuck. If you have been waiting for more than ten - minutes and nothing is happening, you can interrupt the script with ^C. You - may restart it and it will pick up where it left off. - -10. After installation completes, the installer will launch a script called - `configure_invokeai.py`, which will guide you through the first-time process - of selecting one or more Stable Diffusion model weights files, downloading - and configuring them. We provide a list of popular models that InvokeAI - performs well with. However, you can add more weight files later on using - the command-line client or the Web UI. See - [Installing Models](INSTALLING_MODELS.md) for details. - - Note that the main Stable Diffusion weights file is protected by a license - agreement that you must agree to in order to use. The script will list the - steps you need to take to create an account on the official site that hosts - the weights files, accept the agreement, and provide an access token that - allows InvokeAI to legally download and install the weights files. - - If you have already downloaded the weights file(s) for another Stable - Diffusion distribution, you may skip this step (by selecting "skip" when - prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [Installing Models](INSTALLING_MODELS.md). - -11. The script will now exit and you'll be ready to generate some images. Look - for the directory `invokeai` installed in the location you chose at the - beginning of the install session. Look for a shell script named `invoke.sh` - (Linux/Mac) or `invoke.bat` (Windows). Launch the script by double-clicking - it or typing its name at the command-line: - - ```cmd - C:\Documents\Linco> cd invokeai - C:\Documents\Linco\invokeAI> invoke.bat - ``` - - - The `invoke.bat` (`invoke.sh`) script will give you the choice of starting - (1) the command-line interface, or (2) the web GUI. If you start the - latter, you can load the user interface by pointing your browser at - http://localhost:9090. - - - The script also offers you a third option labeled "open the developer - console". If you choose this option, you will be dropped into a - command-line interface in which you can run python commands directly, - access developer tools, and launch InvokeAI with customized options. - -12. You can launch InvokeAI with several different command-line arguments that - customize its behavior. For example, you can change the location of the - image output directory, or select your favorite sampler. See the - [Command-Line Interface](../features/CLI.md) for a full list of the options. - - - To set defaults that will take effect every time you launch InvokeAI, - use a text editor (e.g. Notepad) to exit the file - `invokeai\invokeai.init`. It contains a variety of examples that you can - follow to add and modify launch options. - -!!! warning "The `invokeai` directory contains the `invoke` application, its -configuration files, the model weight files, and outputs of image generation. -Once InvokeAI is installed, do not move or remove this directory." - -## Troubleshooting - -### _Package dependency conflicts_ - -If you have previously installed InvokeAI or another Stable Diffusion package, -the installer may occasionally pick up outdated libraries and either the -installer or `invoke` will fail with complaints about library conflicts. You can -address this by entering the `invokeai` directory and running `update.sh`, which -will bring InvokeAI up to date with the latest libraries. - -### ldm from pypi - -!!! warning - - Some users have tried to correct dependency problems by installing - the `ldm` package from PyPi.org. Unfortunately this is an unrelated package that - has nothing to do with the 'latent diffusion model' used by InvokeAI. Installing - ldm will make matters worse. If you've installed ldm, uninstall it with - `pip uninstall ldm`. - -### Corrupted configuration file - -Everything seems to install ok, but `invoke` complains of a corrupted -configuration file and goes back into the configuration process (asking you to -download models, etc), but this doesn't fix the problem. - -This issue is often caused by a misconfigured configuration directive in the -`invokeai\invokeai.init` initialization file that contains startup settings. The -easiest way to fix the problem is to move the file out of the way and re-run -`configure_invokeai.py`. Enter the developer's console (option 3 of the launcher -script) and run this command: - -```cmd -configure_invokeai.py --root=. -``` - -Note the dot (.) after `--root`. It is part of the command. - -_If none of these maneuvers fixes the problem_ then please report the problem to -the [InvokeAI Issues](https://github.com/invoke-ai/InvokeAI/issues) section, or -visit our [Discord Server](https://discord.gg/ZmtBAhwWhy) for interactive -assistance. - -### other problems - -If you run into problems during or after installation, the InvokeAI team is -available to help you. Either create an -[Issue](https://github.com/invoke-ai/InvokeAI/issues) at our GitHub site, or -make a request for help on the "bugs-and-support" channel of our -[Discord server](https://discord.gg/ZmtBAhwWhy). We are a 100% volunteer -organization, but typically somebody will be available to help you within 24 -hours, and often much sooner. - -## Updating to newer versions - -This distribution is changing rapidly, and we add new features on a daily basis. -To update to the latest released version (recommended), run the `update.sh` -(Linux/Mac) or `update.bat` (Windows) scripts. This will fetch the latest -release and re-run the `configure_invokeai` script to download any updated -models files that may be needed. You can also use this to add additional models -that you did not select at installation time. - -You can now close the developer console and run `invoke` as before. If you get -complaints about missing models, then you may need to do the additional step of -running `configure_invokeai.py`. This happens relatively infrequently. To do -this, simply open up the developer's console again and type -`python scripts/configure_invokeai.py`. - -You may also use the `update` script to install any selected version of -InvokeAI. From https://github.com/invoke-ai/InvokeAI, navigate to the zip file -link of the version you wish to install. You can find the zip links by going to -the one of the release pages and looking for the **Assets** section at the -bottom. Alternatively, you can browse "branches" and "tags" at the top of the -big code directory on the InvokeAI welcome page. When you find the version you -want to install, go to the green "<> Code" button at the top, and copy the -"Download ZIP" link. - -Now run `update.sh` (or `update.bat`) with the URL of the desired InvokeAI -version as its argument. For example, this will install the old 2.2.0 release. - -```cmd -update.sh https://github.com/invoke-ai/InvokeAI/archive/refs/tags/v2.2.0.zip -``` - -## Installing Python in Ubuntu - -For reasons that are not entirely clear, installing the correct version of -Python can be a bit of a challenge on Ubuntu, Linux Mint, and other -Ubuntu-derived distributions. - -In particular, Ubuntu version 20.04 LTS comes with an old version of Python, -does not come with the PIP package manager installed, and to make matters worse, -the `python` command points to Python2, not Python3. - -Here is the quick recipe for bringing your system up to date: - -``` -sudo apt update -sudo apt install python3.9 -sudo apt install python3-pip -cd /usr/bin -sudo ln -sf python3.9 python3 -sudo ln -sf python3 python -``` - -You can still access older versions of Python by calling `python2`, `python3.8`, -etc. diff --git a/docs/installation/INSTALL_AUTOMATED.md b/docs/installation/INSTALL_AUTOMATED.md new file mode 120000 index 0000000000..1818736494 --- /dev/null +++ b/docs/installation/INSTALL_AUTOMATED.md @@ -0,0 +1 @@ +010_INSTALL_AUTOMATED.md \ No newline at end of file diff --git a/docs/installation/INSTALL_MANUAL.md b/docs/installation/INSTALL_MANUAL.md deleted file mode 100644 index 6f15cd8906..0000000000 --- a/docs/installation/INSTALL_MANUAL.md +++ /dev/null @@ -1,579 +0,0 @@ ---- -title: Manual Installation ---- - -
-# :fontawesome-brands-linux: Linux | :fontawesome-brands-apple: macOS | :fontawesome-brands-windows: Windows -
- -!!! warning "This is for advanced Users" - - who are already experienced with using conda or pip - -## Introduction - -You have two choices for manual installation, the [first -one](#PIP_method) uses basic Python virtual environment (`venv`) -commands and the PIP package manager. The [second one](#Conda_method) -based on the Anaconda3 package manager (`conda`). Both methods require -you to enter commands on the terminal, also known as the "console". - -Note that the conda install method is currently deprecated and will not -be supported at some point in the future. - -On Windows systems you are encouraged to install and use the -[Powershell](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3), -which provides compatibility with Linux and Mac shells and nice -features such as command-line completion. - -## pip Install - -To install InvokeAI with virtual environments and the PIP package -manager, please follow these steps: - -1. Make sure you are using Python 3.9 or 3.10. The rest of the install - procedure depends on this: - - ```bash - python -V - ``` - -2. From within the InvokeAI top-level directory, create and activate a virtual - environment named `invokeai`: - - ```bash - python -mvenv invokeai - source invokeai/bin/activate - ``` - -3. Make sure that pip is installed in your virtual environment an up to date: - - ```bash - python -mensurepip --upgrade - python -mpip install --upgrade pip - ``` - -4. Pick the correct `requirements*.txt` file for your hardware and operating - system. - - We have created a series of environment files suited for different operating - systems and GPU hardware. They are located in the - `environments-and-requirements` directory: - -
- - | filename | OS | - | :---------------------------------: | :-------------------------------------------------------------: | - | requirements-lin-amd.txt | Linux with an AMD (ROCm) GPU | - | requirements-lin-arm64.txt | Linux running on arm64 systems | - | requirements-lin-cuda.txt | Linux with an NVIDIA (CUDA) GPU | - | requirements-mac-mps-cpu.txt | Macintoshes with MPS acceleration | - | requirements-lin-win-colab-cuda.txt | Windows with an NVIDA (CUDA) GPU
(supports Google Colab too) | - -
- - Select the appropriate requirements file, and make a link to it from - `requirements.txt` in the top-level InvokeAI directory. The command to do - this from the top-level directory is: - - !!! example "" - - === "Macintosh and Linux" - - !!! info "Replace `xxx` and `yyy` with the appropriate OS and GPU codes." - - ```bash - ln -sf environments-and-requirements/requirements-xxx-yyy.txt requirements.txt - ``` - - === "Windows" - - !!! info "on Windows, admin privileges are required to make links, so we use the copy command instead" - - ```cmd - copy environments-and-requirements\requirements-lin-win-colab-cuda.txt requirements.txt - ``` - - !!! warning - - Please do not link or copy `environments-and-requirements/requirements-base.txt`. - This is a base requirements file that does not have the platform-specific - libraries. Also, be sure to link or copy the platform-specific file to - a top-level file named `requirements.txt` as shown here. Running pip on - a requirements file in a subdirectory will not work as expected. - - When this is done, confirm that a file named `requirements.txt` has been - created in the InvokeAI root directory and that it points to the correct - file in `environments-and-requirements`. - -5. Run PIP - - Be sure that the `invokeai` environment is active before doing this: - - ```bash - pip install --prefer-binary -r requirements.txt - ``` - -6. Set up the runtime directory - - In this step you will initialize a runtime directory that will - contain the models, model config files, directory for textual - inversion embeddings, and your outputs. This keeps the runtime - directory separate from the source code and aids in updating. - - You may pick any location for this directory using the `--root_dir` - option (abbreviated --root). If you don't pass this option, it will - default to `invokeai` in your home directory. - - ```bash - configure_invokeai.py --root_dir ~/Programs/invokeai - ``` - - The script `configure_invokeai.py` will interactively guide you through the - process of downloading and installing the weights files needed for InvokeAI. - Note that the main Stable Diffusion weights file is protected by a license - agreement that you have to agree to. The script will list the steps you need - to take to create an account on the site that hosts the weights files, - accept the agreement, and provide an access token that allows InvokeAI to - legally download and install the weights files. - - If you get an error message about a module not being installed, check that - the `invokeai` environment is active and if not, repeat step 5. - - Note that `configure_invokeai.py` and `invoke.py` should be installed - under your virtual environment directory and the system should find them - on the PATH. If this isn't working on your system, you can call the - scripts directory using `python scripts/configure_invoke.py` and - `python scripts/invoke.py`. - - !!! tip - - If you have already downloaded the weights file(s) for another Stable - Diffusion distribution, you may skip this step (by selecting "skip" when - prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [here](INSTALLING_MODELS.md). - -7. Run the command-line- or the web- interface: - - Activate the environment (with `source invokeai/bin/activate`), and then - run the script `invoke.py`. If you selected a non-default location - for the runtime directory, please specify the path with the `--root_dir` - option (abbreviated below as `--root`): - - !!! example "" - - !!! warning "Make sure that the virtual environment is activated, which should create `(invokeai)` in front of your prompt!" - - === "CLI" - - ```bash - invoke.py --root ~/Programs/invokeai - ``` - - === "local Webserver" - - ```bash - invoke.py --web --root ~/Programs/invokeai - ``` - - === "Public Webserver" - - ```bash - invoke.py --web --host 0.0.0.0 --root ~/Programs/invokeai - ``` - - If you choose the run the web interface, point your browser at - http://localhost:9090 in order to load the GUI. - - !!! tip - - You can permanently set the location of the runtime directory by setting the environment variable INVOKEAI_ROOT to the path of the directory. - -8. Render away! - - Browse the [features](../features/CLI.md) section to learn about all the things you - can do with InvokeAI. - - Note that some GPUs are slow to warm up. In particular, when using an AMD - card with the ROCm driver, you may have to wait for over a minute the first - time you try to generate an image. Fortunately, after the warm up period - rendering will be fast. - -9. Subsequently, to relaunch the script, be sure to run "conda activate - invokeai", enter the `InvokeAI` directory, and then launch the invoke - script. If you forget to activate the 'invokeai' environment, the script - will fail with multiple `ModuleNotFound` errors. - - !!! tip - - Do not move the source code repository after installation. The virtual environment directory has absolute paths in it that get confused if the directory is moved. - ---- - -### Conda method - -1. Check that your system meets the - [hardware requirements](index.md#Hardware_Requirements) and has the - appropriate GPU drivers installed. In particular, if you are a Linux user - with an AMD GPU installed, you may need to install the - [ROCm driver](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html). - - InvokeAI does not yet support Windows machines with AMD GPUs due to the lack - of ROCm driver support on this platform. - - To confirm that the appropriate drivers are installed, run `nvidia-smi` on - NVIDIA/CUDA systems, and `rocm-smi` on AMD systems. These should return - information about the installed video card. - - Macintosh users with MPS acceleration, or anybody with a CPU-only system, - can skip this step. - -2. You will need to install Anaconda3 and Git if they are not already - available. Use your operating system's preferred package manager, or - download the installers manually. You can find them here: - - - [Anaconda3](https://www.anaconda.com/) - - [git](https://git-scm.com/downloads) - -3. Clone the [InvokeAI](https://github.com/invoke-ai/InvokeAI) source code from - GitHub: - - ```bash - git clone https://github.com/invoke-ai/InvokeAI.git - ``` - - This will create InvokeAI folder where you will follow the rest of the - steps. - -4. Enter the newly-created InvokeAI folder: - - ```bash - cd InvokeAI - ``` - - From this step forward make sure that you are working in the InvokeAI - directory! - -5. Select the appropriate environment file: - - We have created a series of environment files suited for different operating - systems and GPU hardware. They are located in the - `environments-and-requirements` directory: - -
- - | filename | OS | - | :----------------------: | :----------------------------: | - | environment-lin-amd.yml | Linux with an AMD (ROCm) GPU | - | environment-lin-cuda.yml | Linux with an NVIDIA CUDA GPU | - | environment-mac.yml | Macintosh | - | environment-win-cuda.yml | Windows with an NVIDA CUDA GPU | - -
- - Choose the appropriate environment file for your system and link or copy it - to `environment.yml` in InvokeAI's top-level directory. To do so, run - following command from the repository-root: - - !!! Example "" - - === "Macintosh and Linux" - - !!! todo "Replace `xxx` and `yyy` with the appropriate OS and GPU codes as seen in the table above" - - ```bash - ln -sf environments-and-requirements/environment-xxx-yyy.yml environment.yml - ``` - - When this is done, confirm that a file `environment.yml` has been linked in - the InvokeAI root directory and that it points to the correct file in the - `environments-and-requirements`. - - ```bash - ls -la - ``` - - === "Windows" - - !!! todo " Since it requires admin privileges to create links, we will use the copy command to create your `environment.yml`" - - ```cmd - copy environments-and-requirements\environment-win-cuda.yml environment.yml - ``` - - Afterwards verify that the file `environment.yml` has been created, either via the - explorer or by using the command `dir` from the terminal - - ```cmd - dir - ``` - - !!! warning "Do not try to run conda on directly on the subdirectory environments file. This won't work. Instead, copy or link it to the top-level directory as shown." - -6. Create the conda environment: - - ```bash - conda env update - ``` - - This will create a new environment named `invokeai` and install all InvokeAI - dependencies into it. If something goes wrong you should take a look at - [troubleshooting](#troubleshooting). - -7. Activate the `invokeai` environment: - - In order to use the newly created environment you will first need to - activate it - - ```bash - conda activate invokeai - ``` - - Your command-line prompt should change to indicate that `invokeai` is active - by prepending `(invokeai)`. - -8. Set up the runtime directory - - In this step you will initialize a runtime directory that will - contain the models, model config files, directory for textual - inversion embeddings, and your outputs. This keeps the runtime - directory separate from the source code and aids in updating. - - You may pick any location for this directory using the `--root_dir` - option (abbreviated --root). If you don't pass this option, it will - default to `invokeai` in your home directory. - - ```bash - python scripts/configure_invokeai.py --root_dir ~/Programs/invokeai - ``` - - The script `configure_invokeai.py` will interactively guide you through the - process of downloading and installing the weights files needed for InvokeAI. - Note that the main Stable Diffusion weights file is protected by a license - agreement that you have to agree to. The script will list the steps you need - to take to create an account on the site that hosts the weights files, - accept the agreement, and provide an access token that allows InvokeAI to - legally download and install the weights files. - - If you get an error message about a module not being installed, check that - the `invokeai` environment is active and if not, repeat step 5. - - Note that `configure_invokeai.py` and `invoke.py` should be - installed under your conda directory and the system should find - them automatically on the PATH. If this isn't working on your - system, you can call the scripts directory using `python - scripts/configure_invoke.py` and `python scripts/invoke.py`. - - !!! tip - - If you have already downloaded the weights file(s) for another Stable - Diffusion distribution, you may skip this step (by selecting "skip" when - prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [here](INSTALLING_MODELS.md). - -9. Run the command-line- or the web- interface: - - Activate the environment (with `source invokeai/bin/activate`), and then - run the script `invoke.py`. If you selected a non-default location - for the runtime directory, please specify the path with the `--root_dir` - option (abbreviated below as `--root`): - - !!! example "" - - !!! warning "Make sure that the conda environment is activated, which should create `(invokeai)` in front of your prompt!" - - === "CLI" - - ```bash - invoke.py --root ~/Programs/invokeai - ``` - - === "local Webserver" - - ```bash - invoke.py --web --root ~/Programs/invokeai - ``` - - === "Public Webserver" - - ```bash - invoke.py --web --host 0.0.0.0 --root ~/Programs/invokeai - ``` - - If you choose the run the web interface, point your browser at - http://localhost:9090 in order to load the GUI. - - !!! tip - - You can permanently set the location of the runtime directory by setting the environment variable INVOKEAI_ROOT to the path of your choice. - -10. Render away! - - Browse the [features](../features/CLI.md) section to learn about all the things you - can do with InvokeAI. - - Note that some GPUs are slow to warm up. In particular, when using an AMD - card with the ROCm driver, you may have to wait for over a minute the first - time you try to generate an image. Fortunately, after the warm up period - rendering will be fast. - -11. Subsequently, to relaunch the script, be sure to run "conda activate - invokeai", enter the `InvokeAI` directory, and then launch the invoke - script. If you forget to activate the 'invokeai' environment, the script - will fail with multiple `ModuleNotFound` errors. - -## Creating an "install" version of InvokeAI - -If you wish you can install InvokeAI and all its dependencies in the -runtime directory. This allows you to delete the source code -repository and eliminates the need to provide `--root_dir` at startup -time. Note that this method only works with the PIP method. - -1. Follow the instructions for the PIP install, but in step #2 put the - virtual environment into the runtime directory. For example, assuming the - runtime directory lives in `~/Programs/invokeai`, you'd run: - - ```bash - python -menv ~/Programs/invokeai - ``` - -2. Now follow steps 3 to 5 in the PIP recipe, ending with the `pip install` - step. - -3. Run one additional step while you are in the source code repository - directory `pip install .` (note the dot at the end). - -4. That's all! Now, whenever you activate the virtual environment, - `invoke.py` will know where to look for the runtime directory without - needing a `--root_dir` argument. In addition, you can now move or - delete the source code repository entirely. - - (Don't move the runtime directory!) - -## Updating to newer versions of the script - -This distribution is changing rapidly. If you used the `git clone` method -(step 5) to download the InvokeAI directory, then to update to the latest and -greatest version, launch the Anaconda window, enter `InvokeAI` and type: - -```bash -git pull -conda env update -python scripts/configure_invokeai.py --no-interactive #optional -``` - -This will bring your local copy into sync with the remote one. The last step may -be needed to take advantage of new features or released models. The -`--no-interactive` flag will prevent the script from prompting you to download -the big Stable Diffusion weights files. - -## Troubleshooting - -Here are some common issues and their suggested solutions. - -### Conda - -#### Conda fails before completing `conda update` - -The usual source of these errors is a package incompatibility. While we have -tried to minimize these, over time packages get updated and sometimes introduce -incompatibilities. - -We suggest that you search -[Issues](https://github.com/invoke-ai/InvokeAI/issues) or the "bugs-and-support" -channel of the [InvokeAI Discord](https://discord.gg/ZmtBAhwWhy). - -You may also try to install the broken packages manually using PIP. To do this, -activate the `invokeai` environment, and run `pip install` with the name and -version of the package that is causing the incompatibility. For example: - -```bash -pip install test-tube==0.7.5 -``` - -You can keep doing this until all requirements are satisfied and the `invoke.py` -script runs without errors. Please report to -[Issues](https://github.com/invoke-ai/InvokeAI/issues) what you were able to do -to work around the problem so that others can benefit from your investigation. - -### Create Conda Environment fails on MacOS - -If conda create environment fails with lmdb error, this is most likely caused by Clang. -Run brew config to see which Clang is installed on your Mac. If Clang isn't installed, that's causing the error. -Start by installing additional XCode command line tools, followed by brew install llvm. - -```bash -xcode-select --install -brew install llvm -``` - -If brew config has Clang installed, update to the latest llvm and try creating the environment again. - -#### `configure_invokeai.py` or `invoke.py` crashes at an early stage - -This is usually due to an incomplete or corrupted Conda install. Make sure you -have linked to the correct environment file and run `conda update` again. - -If the problem persists, a more extreme measure is to clear Conda's caches and -remove the `invokeai` environment: - -```bash -conda deactivate -conda env remove -n invokeai -conda clean -a -conda update -``` - -This removes all cached library files, including ones that may have been -corrupted somehow. (This is not supposed to happen, but does anyway). - -#### `invoke.py` crashes at a later stage - -If the CLI or web site had been working ok, but something unexpected happens -later on during the session, you've encountered a code bug that is probably -unrelated to an install issue. Please search -[Issues](https://github.com/invoke-ai/InvokeAI/issues), file a bug report, or -ask for help on [Discord](https://discord.gg/ZmtBAhwWhy) - -#### My renders are running very slowly - -You may have installed the wrong torch (machine learning) package, and the -system is running on CPU rather than the GPU. To check, look at the log messages -that appear when `invoke.py` is first starting up. One of the earlier lines -should say `Using device type cuda`. On AMD systems, it will also say "cuda", -and on Macintoshes, it should say "mps". If instead the message says it is -running on "cpu", then you may need to install the correct torch library. - -You may be able to fix this by installing a different torch library. Here are -the magic incantations for Conda and PIP. - -!!! todo "For CUDA systems" - - - conda - - ```bash - conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia - ``` - - - pip - - ```bash - pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116 - ``` - -!!! todo "For AMD systems" - - - conda - - ```bash - conda activate invokeai - pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.2/ - ``` - - - pip - - ```bash - pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/rocm5.2/ - ``` - -More information and troubleshooting tips can be found at https://pytorch.org. diff --git a/docs/installation/INSTALL_MANUAL.md b/docs/installation/INSTALL_MANUAL.md new file mode 120000 index 0000000000..8f033ebba2 --- /dev/null +++ b/docs/installation/INSTALL_MANUAL.md @@ -0,0 +1 @@ +020_INSTALL_MANUAL.md \ No newline at end of file diff --git a/docs/installation/INSTALL_INVOKE.md b/docs/installation/deprecated_documentation/INSTALL_BINARY.md similarity index 100% rename from docs/installation/INSTALL_INVOKE.md rename to docs/installation/deprecated_documentation/INSTALL_BINARY.md diff --git a/docs/installation/INSTALL_JUPYTER.md b/docs/installation/deprecated_documentation/INSTALL_JUPYTER.md similarity index 100% rename from docs/installation/INSTALL_JUPYTER.md rename to docs/installation/deprecated_documentation/INSTALL_JUPYTER.md diff --git a/docs/installation/older_docs_to_be_removed/INSTALL_LINUX.md b/docs/installation/deprecated_documentation/INSTALL_LINUX.md similarity index 100% rename from docs/installation/older_docs_to_be_removed/INSTALL_LINUX.md rename to docs/installation/deprecated_documentation/INSTALL_LINUX.md diff --git a/docs/installation/older_docs_to_be_removed/INSTALL_MAC.md b/docs/installation/deprecated_documentation/INSTALL_MAC.md similarity index 100% rename from docs/installation/older_docs_to_be_removed/INSTALL_MAC.md rename to docs/installation/deprecated_documentation/INSTALL_MAC.md diff --git a/docs/installation/INSTALL_PCP.md b/docs/installation/deprecated_documentation/INSTALL_PCP.md similarity index 100% rename from docs/installation/INSTALL_PCP.md rename to docs/installation/deprecated_documentation/INSTALL_PCP.md diff --git a/docs/installation/INSTALL_SOURCE.md b/docs/installation/deprecated_documentation/INSTALL_SOURCE.md similarity index 100% rename from docs/installation/INSTALL_SOURCE.md rename to docs/installation/deprecated_documentation/INSTALL_SOURCE.md diff --git a/docs/installation/older_docs_to_be_removed/INSTALL_WINDOWS.md b/docs/installation/deprecated_documentation/INSTALL_WINDOWS.md similarity index 100% rename from docs/installation/older_docs_to_be_removed/INSTALL_WINDOWS.md rename to docs/installation/deprecated_documentation/INSTALL_WINDOWS.md diff --git a/docs/installation/index.md b/docs/installation/index.md index 85690f29da..b523a1efad 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -5,14 +5,14 @@ title: Overview We offer several ways to install InvokeAI, each one suited to your experience and preferences. -1. [Automated Installer](INSTALL_AUTOMATED.md) +1. [Automated Installer](010_INSTALL_AUTOMATED.md) This is a script that will install all of InvokeAI's essential third party libraries and InvokeAI itself. It includes access to a "developer console" which will help us debug problems with you and give you to access experimental features. -2. [Manual Installation](INSTALL_MANUAL.md) +2. [Manual Installation](020_INSTALL_MANUAL.md) In this method you will manually run the commands needed to install InvokeAI and its dependencies. We offer two recipes: one suited to @@ -25,7 +25,7 @@ experience and preferences. the cutting edge of future InvokeAI development and is willing to put up with occasional glitches and breakage. -3. [Docker Installation](INSTALL_DOCKER.md) +3. [Docker Installation](040_INSTALL_DOCKER.md) We also offer a method for creating Docker containers containing InvokeAI and its dependencies. This method is recommended for diff --git a/installer/install.bat.in b/installer/install.bat.in index e34d059251..715ed656e7 100644 --- a/installer/install.bat.in +++ b/installer/install.bat.in @@ -25,15 +25,14 @@ set PYTHON_URL=https://www.python.org/downloads/release/python-3109/ set err_msg=An error has occurred and the script could not continue. @rem --------------------------- Intro ------------------------------- -echo This script will install InvokeAI and its dependencies. Before you start, -echo please make sure to do the following: +echo This script will install InvokeAI and its dependencies. +echo. +echo BEFORE YOU START PLEASE MAKE SURE TO DO THE FOLLOWING echo 1. Install python 3.9 or higher. echo 2. Double-click on the file WinLongPathsEnabled.reg in order to echo enable long path support on your system. -echo 3. Some users have found they need to install the Visual C++ core -echo libraries or else they experience DLL loading problems at the end of the install. -echo Visual C++ is very likely already installed on your system, but if you get DLL -echo issues, please download and install the libraries by going to: +echo 3. Install the Visual C++ core libraries. +echo Pleaase download and install the libraries from: echo https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170 echo. echo See %INSTRUCTIONS% for more details. From 1050f2726ae091d37e2eac2e499e319e8ce7bdf7 Mon Sep 17 00:00:00 2001 From: mauwii Date: Thu, 15 Dec 2022 21:42:49 +0100 Subject: [PATCH 19/26] update links with new filenames --- docs/features/INPAINTING.md | 2 +- docs/index.md | 25 +++++++++---------- docs/installation/010_INSTALL_AUTOMATED.md | 10 +++----- docs/installation/020_INSTALL_MANUAL.md | 8 +++--- .../INSTALL_BINARY.md | 2 +- .../INSTALL_SOURCE.md | 16 ++++++------ docs/installation/index.md | 3 +-- scripts/configure_invokeai.py | 4 +-- 8 files changed, 33 insertions(+), 37 deletions(-) diff --git a/docs/features/INPAINTING.md b/docs/features/INPAINTING.md index e22fbd08e7..f3a879b190 100644 --- a/docs/features/INPAINTING.md +++ b/docs/features/INPAINTING.md @@ -158,7 +158,7 @@ when filling in missing regions. It has an almost uncanny ability to blend the new regions with existing ones in a semantically coherent way. To install the inpainting model, follow the -[instructions](../installation/INSTALLING_MODELS.md) for installing a new model. +[instructions](../installation/050_INSTALLING_MODELS.md) for installing a new model. You may use either the CLI (`invoke.py` script) or directly edit the `configs/models.yaml` configuration file to do this. The main thing to watch out for is that the the model `config` option must be set up to use diff --git a/docs/index.md b/docs/index.md index 1ad2d2b66d..3c5bd3904b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -95,7 +95,7 @@ upgrade instructions, please see: Linux users who wish to make use of the PyPatchMatch inpainting functions will need to perform a bit of extra work to enable this module. Instructions can be -found at [Installing PyPatchMatch](installation/INSTALL_PATCHMATCH.md). +found at [Installing PyPatchMatch](installation/060_INSTALL_PATCHMATCH.md). ## :fontawesome-solid-computer: Hardware Requirements @@ -137,25 +137,24 @@ images in full-precision mode: ## :octicons-gift-24: InvokeAI Features -- [The InvokeAI Web Interface](features/WEB.md) - - [WebGUI hotkey reference guide](features/WEBUIHOTKEYS.md) - - [WebGUI Unified Canvas for Img2Img, inpainting and outpainting](features/UNIFIED_CANVAS.md) +- [The InvokeAI Web Interface](features/WEB.md) - +[WebGUI hotkey reference guide](features/WEBUIHOTKEYS.md) - +[WebGUI Unified Canvas for Img2Img, inpainting and outpainting](features/UNIFIED_CANVAS.md) -- [The Command Line Interace](features/CLI.md) - - [Image2Image](features/IMG2IMG.md) - - [Inpainting](features/INPAINTING.md) - - [Outpainting](features/OUTPAINTING.md) - - [Adding custom styles and subjects](features/CONCEPTS.md) - - [Upscaling and Face Reconstruction](features/POSTPROCESS.md) +- [The Command Line Interace](features/CLI.md) - +[Image2Image](features/IMG2IMG.md) - [Inpainting](features/INPAINTING.md) - +[Outpainting](features/OUTPAINTING.md) - +[Adding custom styles and subjects](features/CONCEPTS.md) - +[Upscaling and Face Reconstruction](features/POSTPROCESS.md) - [Generating Variations](features/VARIATIONS.md) - [Prompt Engineering](features/PROMPTS.md) - Miscellaneous - - [NSFW Checker](features/NSFW.md) - - [Embiggen upscaling](features/EMBIGGEN.md) - - [Other](features/OTHER.md) + - [NSFW Checker](features/NSFW.md) + - [Embiggen upscaling](features/EMBIGGEN.md) + - [Other](features/OTHER.md) ## :octicons-log-16: Latest Changes diff --git a/docs/installation/010_INSTALL_AUTOMATED.md b/docs/installation/010_INSTALL_AUTOMATED.md index 503cf6a2b0..8b1bc97be7 100644 --- a/docs/installation/010_INSTALL_AUTOMATED.md +++ b/docs/installation/010_INSTALL_AUTOMATED.md @@ -30,8 +30,6 @@ version of InvokeAI with the option to upgrade to experimental versions later. installed, it will print out the version number. If it is version `3.9.1` or higher, you meet requirements. - - !!! warning "If you see an older version, or get a command not found error" Go to [Python Downloads](https://www.python.org/downloads/) and @@ -53,7 +51,7 @@ version of InvokeAI with the option to upgrade to experimental versions later. "Modify" existing installation. - Installation requires an up to date version of the Microsoft Visual C libraries. Please install the 2015-2022 libraries available here: https://learn.microsoft.com/en-us/cpp/windows/deploying-native-desktop-applications-visual-cpp?view=msvc-170 - + === "Mac users" - After installing Python, you may need to run the @@ -83,7 +81,7 @@ version of InvokeAI with the option to upgrade to experimental versions later. In particular, Ubuntu version 20.04 LTS comes with an old version of Python, does not come with the PIP package manager installed, and to make matters worse, the `python` command points to Python2, not Python3. Here is the quick recipe for bringing your system up to date: - + ``` sudo apt update sudo apt install python3.9 @@ -174,7 +172,7 @@ version of InvokeAI with the option to upgrade to experimental versions later. and configuring them. We provide a list of popular models that InvokeAI performs well with. However, you can add more weight files later on using the command-line client or the Web UI. See - [Installing Models](INSTALLING_MODELS.md) for details. + [Installing Models](050_INSTALLING_MODELS.md) for details. Note that the main Stable Diffusion weights file is protected by a license agreement that you must agree to in order to use. The script will list the @@ -185,7 +183,7 @@ version of InvokeAI with the option to upgrade to experimental versions later. If you have already downloaded the weights file(s) for another Stable Diffusion distribution, you may skip this step (by selecting "skip" when prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [Installing Models](INSTALLING_MODELS.md). + process for this is described in [Installing Models](050_INSTALLING_MODELS.md). 11. The script will now exit and you'll be ready to generate some images. Look for the directory `invokeai` installed in the location you chose at the diff --git a/docs/installation/020_INSTALL_MANUAL.md b/docs/installation/020_INSTALL_MANUAL.md index 2f22738303..94246652a2 100644 --- a/docs/installation/020_INSTALL_MANUAL.md +++ b/docs/installation/020_INSTALL_MANUAL.md @@ -151,7 +151,7 @@ manager, please follow these steps: If you have already downloaded the weights file(s) for another Stable Diffusion distribution, you may skip this step (by selecting "skip" when prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [here](INSTALLING_MODELS.md). + process for this is described in [here](050_INSTALLING_MODELS.md). 7. Run the command-line- or the web- interface: @@ -308,8 +308,8 @@ manager, please follow these steps: dir ``` - !!! warning "Do not try to run conda on directly on the subdirectory environments file. This won't work. Instead, copy or link it to the top-level directory as shown." - + !!! warning "Do not try to run conda on directly on the subdirectory environments file. This won't work. Instead, copy or link it to the top-level directory as shown." + 6. Create the conda environment: ```bash @@ -369,7 +369,7 @@ manager, please follow these steps: If you have already downloaded the weights file(s) for another Stable Diffusion distribution, you may skip this step (by selecting "skip" when prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [here](INSTALLING_MODELS.md). + process for this is described in [here](050_INSTALLING_MODELS.md). 9. Run the command-line- or the web- interface: diff --git a/docs/installation/deprecated_documentation/INSTALL_BINARY.md b/docs/installation/deprecated_documentation/INSTALL_BINARY.md index 30d52daa18..bc12f3d848 100644 --- a/docs/installation/deprecated_documentation/INSTALL_BINARY.md +++ b/docs/installation/deprecated_documentation/INSTALL_BINARY.md @@ -10,7 +10,7 @@ InvokeAI is released, you will download and reinstall the new version. If you wish to tinker with unreleased versions of InvokeAI that introduce potentially unstable new features, you should consider using the [source installer](INSTALL_SOURCE.md) or one of the -[manual install](INSTALL_MANUAL.md) methods. +[manual install](../020_INSTALL_MANUAL.md) methods. **Important Caveats** - This script does not support AMD GPUs. For Linux AMD support, diff --git a/docs/installation/deprecated_documentation/INSTALL_SOURCE.md b/docs/installation/deprecated_documentation/INSTALL_SOURCE.md index 3629a8c8be..2b1b750fbf 100644 --- a/docs/installation/deprecated_documentation/INSTALL_SOURCE.md +++ b/docs/installation/deprecated_documentation/INSTALL_SOURCE.md @@ -12,7 +12,7 @@ of Linux, MacOS or Windows. It will leave you with a version that runs a stable version of InvokeAI with the option to upgrade to experimental versions later. Before you begin, make sure that you meet the -[hardware requirements](index.md#Hardware_Requirements) and has the appropriate +[hardware requirements](../../index.md#hardware-requirements) and has the appropriate GPU drivers installed. In particular, if you are a Linux user with an AMD GPU installed, you may need to install the [ROCm driver](https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html). @@ -50,15 +50,15 @@ off the process. inflating: invokeAI\readme.txt ``` -3. If you are a macOS user, you may need to install the Xcode command line tools. - These are a set of tools that are needed to run certain applications in a Terminal, +3. If you are a macOS user, you may need to install the Xcode command line tools. + These are a set of tools that are needed to run certain applications in a Terminal, including InvokeAI. This package is provided directly by Apple. - + To install, open a terminal window and run `xcode-select --install`. You will get a macOS system popup guiding you through the install. If you already have them - installed, you will instead see some output in the Terminal advising you that the + installed, you will instead see some output in the Terminal advising you that the tools are already installed. - + More information can be found here: https://www.freecodecamp.org/news/install-xcode-command-line-tools/ @@ -100,7 +100,7 @@ off the process. If you have already downloaded the weights file(s) for another Stable Diffusion distribution, you may skip this step (by selecting "skip" when prompted) and configure InvokeAI to use the previously-downloaded files. The - process for this is described in [Installing Models](INSTALLING_MODELS.md). + process for this is described in [Installing Models](../050_INSTALLING_MODELS.md). 8. The script will now exit and you'll be ready to generate some images. The invokeAI directory will contain numerous files. Look for a shell script @@ -128,7 +128,7 @@ python scripts/invoke.py --web --max_load_models=3 \ ``` These options are described in detail in the -[Command-Line Interface](../features/CLI.md) documentation. +[Command-Line Interface](../../features/CLI.md) documentation. ## Troubleshooting diff --git a/docs/installation/index.md b/docs/installation/index.md index b523a1efad..ef50cbab5f 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -5,7 +5,7 @@ title: Overview We offer several ways to install InvokeAI, each one suited to your experience and preferences. -1. [Automated Installer](010_INSTALL_AUTOMATED.md) +1. [Automated Installer](010_INSTALL_AUTOMATED.md) This is a script that will install all of InvokeAI's essential third party libraries and InvokeAI itself. It includes access to a @@ -31,4 +31,3 @@ experience and preferences. InvokeAI and its dependencies. This method is recommended for individuals with experience with Docker containers and understand the pluses and minuses of a container-based install. - diff --git a/scripts/configure_invokeai.py b/scripts/configure_invokeai.py index 146dd01eaa..531b39fb94 100644 --- a/scripts/configure_invokeai.py +++ b/scripts/configure_invokeai.py @@ -71,7 +71,7 @@ def postscript(errors: None): You're all set! If you installed using one of the automated installation scripts, -execute 'invoke.sh' (Linux/macOS) or 'invoke.bat' (Windows) to +execute 'invoke.sh' (Linux/macOS) or 'invoke.bat' (Windows) to start InvokeAI. If you installed manually, activate the 'invokeai' environment @@ -113,7 +113,7 @@ def user_wants_to_download_weights()->str: print('''You can download and configure the weights files manually or let this script do it for you. Manual installation is described at: -https://github.com/invoke-ai/InvokeAI/blob/main/docs/installation/INSTALLING_MODELS.md +https://invoke-ai.github.io/InvokeAI/installation/020_INSTALL_MANUAL/ You may download the recommended models (about 10GB total), select a customized set, or completely skip this step. From 69cc0993f81cdda5b2bf57a8d514c8252e0a0ae4 Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 16 Dec 2022 11:26:36 +1300 Subject: [PATCH 20/26] Add Embedding Parsing (#1973) * Add Embedding Parsing * Add Embedding Parsing * Return token_dim in embedding_info * fixes to handle other variants 1. Handle the case of a .bin file being mislabeled .pt (seen in the wild at https://cyberes.github.io/stable-diffusion-textual-inversion-models/) 2. Handle the "broken" .pt files reported by https://github.com/invoke-ai/InvokeAI/issues/1829 3. When token name is not available, use the basename of the pt or bin file rather than the whole path. fixes #1829 * remove whitespace Co-authored-by: Lincoln Stein --- ldm/modules/embedding_manager.py | 122 +++++++++++++++++++++++++------ 1 file changed, 99 insertions(+), 23 deletions(-) diff --git a/ldm/modules/embedding_manager.py b/ldm/modules/embedding_manager.py index 239fd346ab..af9383bbd6 100644 --- a/ldm/modules/embedding_manager.py +++ b/ldm/modules/embedding_manager.py @@ -256,32 +256,22 @@ class EmbeddingManager(nn.Module): return [x for x in expanded_paths if os.path.splitext(x)[1] in ('.pt','.bin')] def _load(self, ckpt_path, full=True): - - scan_result = scan_file_path(ckpt_path) - if scan_result.infected_files == 1: - print(f'\n### Security Issues Found in Model: {scan_result.issues_count}') - print('### For your safety, InvokeAI will not load this embed.') + try: + scan_result = scan_file_path(ckpt_path) + if scan_result.infected_files == 1: + print(f'\n### Security Issues Found in Model: {scan_result.issues_count}') + print('### For your safety, InvokeAI will not load this embed.') + return + except Exception: + print(f"### WARNING::: Invalid or corrupt embeddings found. Ignoring: {ckpt_path}") return - - ckpt = torch.load(ckpt_path, map_location='cpu') - # Handle .pt textual inversion files - if 'string_to_token' in ckpt and 'string_to_param' in ckpt: - filename = os.path.basename(ckpt_path) - token_str = '.'.join(filename.split('.')[:-1]) # filename excluding extension - if len(ckpt["string_to_token"]) > 1: - print(f">> {ckpt_path} has >1 embedding, only the first will be used") - - string_to_param_dict = ckpt['string_to_param'] - embedding = list(string_to_param_dict.values())[0] - self.add_embedding(token_str, embedding, full) - - # Handle .bin textual inversion files from Huggingface Concepts - # https://huggingface.co/sd-concepts-library + embedding_info = self.parse_embedding(ckpt_path) + if embedding_info: + self.max_vectors_per_token = embedding_info['num_vectors_per_token'] + self.add_embedding(embedding_info['name'], embedding_info['embedding'], full) else: - for token_str in list(ckpt.keys()): - embedding = ckpt[token_str] - self.add_embedding(token_str, embedding, full) + print(f'>> Failed to load embedding located at {ckpt_path}. Unsupported file.') def add_embedding(self, token_str, embedding, full): if token_str in self.string_to_param_dict: @@ -302,6 +292,92 @@ class EmbeddingManager(nn.Module): self.string_to_token_dict[token_str] = token self.string_to_param_dict[token_str] = torch.nn.Parameter(embedding) + def parse_embedding(self, embedding_file: str): + file_type = embedding_file.split('.')[-1] + if file_type == 'pt': + return self.parse_embedding_pt(embedding_file) + elif file_type == 'bin': + return self.parse_embedding_bin(embedding_file) + else: + print(f'>> Not a recognized embedding file: {embedding_file}') + + def parse_embedding_pt(self, embedding_file): + embedding_ckpt = torch.load(embedding_file, map_location='cpu') + embedding_info = {} + + # Check if valid embedding file + if 'string_to_token' and 'string_to_param' in embedding_ckpt: + + # Catch variants that do not have the expected keys or values. + try: + embedding_info['name'] = embedding_ckpt['name'] or os.path.basename(os.path.splitext(embedding_file)[0]) + + # Check num of embeddings and warn user only the first will be used + embedding_info['num_of_embeddings'] = len(embedding_ckpt["string_to_token"]) + if embedding_info['num_of_embeddings'] > 1: + print('>> More than 1 embedding found. Will use the first one') + + embedding = list(embedding_ckpt['string_to_param'].values())[0] + except (AttributeError,KeyError): + return self.handle_broken_pt_variants(embedding_ckpt, embedding_file) + + embedding_info['embedding'] = embedding + embedding_info['num_vectors_per_token'] = embedding.size()[0] + embedding_info['token_dim'] = embedding.size()[1] + + try: + embedding_info['trained_steps'] = embedding_ckpt['step'] + embedding_info['trained_model_name'] = embedding_ckpt['sd_checkpoint_name'] + embedding_info['trained_model_checksum'] = embedding_ckpt['sd_checkpoint'] + except AttributeError: + print(">> No Training Details Found. Passing ...") + + # .pt files found at https://cyberes.github.io/stable-diffusion-textual-inversion-models/ + # They are actually .bin files + elif len(embedding_ckpt.keys())==1: + print('>> Detected .bin file masquerading as .pt file') + embedding_info = self.parse_embedding_bin(embedding_file) + + else: + print('>> Invalid embedding format') + embedding_info = None + + return embedding_info + + def parse_embedding_bin(self, embedding_file): + embedding_ckpt = torch.load(embedding_file, map_location='cpu') + embedding_info = {} + + if list(embedding_ckpt.keys()) == 0: + print(">> Invalid concepts file") + embedding_info = None + else: + for token in list(embedding_ckpt.keys()): + embedding_info['name'] = token or os.path.basename(os.path.splitext(embedding_file)[0]) + embedding_info['embedding'] = embedding_ckpt[token] + embedding_info['num_vectors_per_token'] = 1 # All Concepts seem to default to 1 + embedding_info['token_dim'] = embedding_info['embedding'].size()[0] + + return embedding_info + + def handle_broken_pt_variants(self, embedding_ckpt:dict, embedding_file:str)->dict: + ''' + This handles the broken .pt file variants. We only know of one at present. + ''' + embedding_info = {} + if isinstance(list(embedding_ckpt['string_to_token'].values())[0],torch.Tensor): + print('>> Detected .pt file variant 1') # example at https://github.com/invoke-ai/InvokeAI/issues/1829 + for token in list(embedding_ckpt['string_to_token'].keys()): + embedding_info['name'] = token if token != '*' else os.path.basename(os.path.splitext(embedding_file)[0]) + embedding_info['embedding'] = embedding_ckpt['string_to_param'].state_dict()[token] + embedding_info['num_vectors_per_token'] = embedding_info['embedding'].shape[0] + embedding_info['token_dim'] = embedding_info['embedding'].size()[0] + else: + print('>> Invalid embedding format') + embedding_info = None + + return embedding_info + def has_embedding_for_token(self, token_str): return token_str in self.string_to_token_dict From ffa54f4a35ed1aa5a574f911de9dab777cf01f3e Mon Sep 17 00:00:00 2001 From: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com> Date: Fri, 16 Dec 2022 10:39:16 +1300 Subject: [PATCH 21/26] Fix --config arg not being recognized --- ldm/invoke/CLI.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ldm/invoke/CLI.py b/ldm/invoke/CLI.py index 565f21e389..6fc441aac6 100644 --- a/ldm/invoke/CLI.py +++ b/ldm/invoke/CLI.py @@ -48,11 +48,12 @@ def main(): # alert - setting a global here Globals.try_patchmatch = args.patchmatch - if not os.path.exists(os.path.join(Globals.root,'configs','models.yaml')): - print(f"\n** Error. The file {os.path.join(Globals.root,'configs','models.yaml')} could not be found.") - print(f'** Please check the location of your invokeai directory and use the --root_dir option to point to the correct path.') - print(f'** This script will now exit.') - sys.exit(-1) + if not args.conf: + if not os.path.exists(os.path.join(Globals.root,'configs','models.yaml')): + print(f"\n** Error. The file {os.path.join(Globals.root,'configs','models.yaml')} could not be found.") + print(f'** Please check the location of your invokeai directory and use the --root_dir option to point to the correct path.') + print(f'** This script will now exit.') + sys.exit(-1) print(f'>> InvokeAI runtime directory is "{Globals.root}"') From 7d09d9da4970e29f3241e9765229d1ea879903c0 Mon Sep 17 00:00:00 2001 From: Eugene Brodsky Date: Fri, 16 Dec 2022 06:28:16 -0500 Subject: [PATCH 22/26] delete old 'server' package and the dependency_injector requirement (#2032) fixes #1944 --- .../environment-lin-aarch64.yml | 1 - .../environment-lin-amd.yml | 1 - .../environment-lin-cuda.yml | 1 - .../environment-win-cuda.yml | 1 - .../requirements-base.txt | 1 - server/__init__.py | 0 server/application.py | 152 ------- server/containers.py | 81 ---- server/models.py | 259 ------------ server/services.py | 392 ------------------ server/views.py | 132 ------ 11 files changed, 1021 deletions(-) delete mode 100644 server/__init__.py delete mode 100644 server/application.py delete mode 100644 server/containers.py delete mode 100644 server/models.py delete mode 100644 server/services.py delete mode 100644 server/views.py diff --git a/environments-and-requirements/environment-lin-aarch64.yml b/environments-and-requirements/environment-lin-aarch64.yml index 4f37fe7acd..c1e7553a28 100644 --- a/environments-and-requirements/environment-lin-aarch64.yml +++ b/environments-and-requirements/environment-lin-aarch64.yml @@ -30,7 +30,6 @@ dependencies: - torchvision - transformers=4.21.3 - pip: - - dependency_injector==4.40.0 - getpass_asterisk - omegaconf==2.1.1 - picklescan diff --git a/environments-and-requirements/environment-lin-amd.yml b/environments-and-requirements/environment-lin-amd.yml index d893baad27..42ebf37266 100644 --- a/environments-and-requirements/environment-lin-amd.yml +++ b/environments-and-requirements/environment-lin-amd.yml @@ -10,7 +10,6 @@ dependencies: - pip: - --extra-index-url https://download.pytorch.org/whl/rocm5.2/ - albumentations==0.4.3 - - dependency_injector==4.40.0 - diffusers==0.6.0 - einops==0.3.0 - eventlet diff --git a/environments-and-requirements/environment-lin-cuda.yml b/environments-and-requirements/environment-lin-cuda.yml index 3ef150ba00..ce60cfd96b 100644 --- a/environments-and-requirements/environment-lin-cuda.yml +++ b/environments-and-requirements/environment-lin-cuda.yml @@ -13,7 +13,6 @@ dependencies: - cudatoolkit=11.6 - pip: - albumentations==0.4.3 - - dependency_injector==4.40.0 - diffusers==0.6.0 - einops==0.3.0 - eventlet diff --git a/environments-and-requirements/environment-win-cuda.yml b/environments-and-requirements/environment-win-cuda.yml index 4e05db6d35..580f84f8ec 100644 --- a/environments-and-requirements/environment-win-cuda.yml +++ b/environments-and-requirements/environment-win-cuda.yml @@ -13,7 +13,6 @@ dependencies: - cudatoolkit=11.6 - pip: - albumentations==0.4.3 - - dependency_injector==4.40.0 - diffusers==0.6.0 - einops==0.3.0 - eventlet diff --git a/environments-and-requirements/requirements-base.txt b/environments-and-requirements/requirements-base.txt index 1d8d722d5e..1bbf69f94b 100644 --- a/environments-and-requirements/requirements-base.txt +++ b/environments-and-requirements/requirements-base.txt @@ -1,6 +1,5 @@ # pip will resolve the version which matches torch albumentations -dependency_injector==4.40.0 diffusers==0.10.* einops eventlet diff --git a/server/__init__.py b/server/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/server/application.py b/server/application.py deleted file mode 100644 index a48ee5488d..0000000000 --- a/server/application.py +++ /dev/null @@ -1,152 +0,0 @@ -# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) - -"""Application module.""" -import argparse -import json -import os -import sys -from flask import Flask -from flask_cors import CORS -from flask_socketio import SocketIO -from omegaconf import OmegaConf -from dependency_injector.wiring import inject, Provide -from ldm.invoke.args import Args -from server import views -from server.containers import Container -from server.services import GeneratorService, SignalService - -# The socketio_service is injected here (rather than created in run_app) to initialize it -@inject -def initialize_app( - app: Flask, - socketio: SocketIO = Provide[Container.socketio] -) -> SocketIO: - socketio.init_app(app) - - return socketio - -# The signal and generator services are injected to warm up the processing queues -# TODO: Initialize these a better way? -@inject -def initialize_generator( - signal_service: SignalService = Provide[Container.signal_service], - generator_service: GeneratorService = Provide[Container.generator_service] -): - pass - - -def run_app(config, host, port) -> Flask: - app = Flask(__name__, static_url_path='') - - # Set up dependency injection container - container = Container() - container.config.from_dict(config) - container.wire(modules=[__name__]) - app.container = container - - # Set up CORS - CORS(app, resources={r'/api/*': {'origins': '*'}}) - - # Web Routes - app.add_url_rule('/', view_func=views.WebIndex.as_view('web_index', 'index.html')) - app.add_url_rule('/index.css', view_func=views.WebIndex.as_view('web_index_css', 'index.css')) - app.add_url_rule('/index.js', view_func=views.WebIndex.as_view('web_index_js', 'index.js')) - app.add_url_rule('/config.js', view_func=views.WebConfig.as_view('web_config')) - - # API Routes - app.add_url_rule('/api/jobs', view_func=views.ApiJobs.as_view('api_jobs')) - app.add_url_rule('/api/cancel', view_func=views.ApiCancel.as_view('api_cancel')) - - # TODO: Get storage root from config - app.add_url_rule('/api/images/', view_func=views.ApiImages.as_view('api_images', '../')) - app.add_url_rule('/api/images//metadata', view_func=views.ApiImagesMetadata.as_view('api_images_metadata', '../')) - app.add_url_rule('/api/images', view_func=views.ApiImagesList.as_view('api_images_list')) - app.add_url_rule('/api/intermediates//', view_func=views.ApiIntermediates.as_view('api_intermediates', '../')) - - app.static_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), '../static/dream_web/')) - - # Initialize - socketio = initialize_app(app) - initialize_generator() - - print(">> Started Stable Diffusion api server!") - if host == '0.0.0.0': - print(f"Point your browser at http://localhost:{port} or use the host's DNS name or IP address.") - else: - print(">> Default host address now 127.0.0.1 (localhost). Use --host 0.0.0.0 to bind any address.") - print(f">> Point your browser at http://{host}:{port}.") - - # Run the app - socketio.run(app, host, port) - - -def main(): - """Initialize command-line parsers and the diffusion model""" - arg_parser = Args() - opt = arg_parser.parse_args() - - if opt.laion400m: - print('--laion400m flag has been deprecated. Please use --model laion400m instead.') - sys.exit(-1) - if opt.weights: - print('--weights argument has been deprecated. Please edit ./configs/models.yaml, and select the weights using --model instead.') - sys.exit(-1) - - # try: - # models = OmegaConf.load(opt.config) - # width = models[opt.model].width - # height = models[opt.model].height - # config = models[opt.model].config - # weights = models[opt.model].weights - # except (FileNotFoundError, IOError, KeyError) as e: - # print(f'{e}. Aborting.') - # sys.exit(-1) - - #print('* Initializing, be patient...\n') - sys.path.append('.') - - # these two lines prevent a horrible warning message from appearing - # when the frozen CLIP tokenizer is imported - import transformers - - transformers.logging.set_verbosity_error() - - appConfig = opt.__dict__ - - # appConfig = { - # "model": { - # "width": width, - # "height": height, - # "sampler_name": opt.sampler_name, - # "weights": weights, - # "precision": opt.precision, - # "config": config, - # "grid": opt.grid, - # "latent_diffusion_weights": opt.laion400m, - # "embedding_path": opt.embedding_path - # } - # } - - # make sure the output directory exists - if not os.path.exists(opt.outdir): - os.makedirs(opt.outdir) - - # gets rid of annoying messages about random seed - from pytorch_lightning import logging - logging.getLogger('pytorch_lightning').setLevel(logging.ERROR) - - print('\n* starting api server...') - # Change working directory to the stable-diffusion directory - os.chdir( - os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) - ) - - # Start server - try: - run_app(appConfig, opt.host, opt.port) - except KeyboardInterrupt: - pass - - -if __name__ == '__main__': - main() diff --git a/server/containers.py b/server/containers.py deleted file mode 100644 index f1e246482f..0000000000 --- a/server/containers.py +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) - -"""Containers module.""" - -from dependency_injector import containers, providers -from flask_socketio import SocketIO -from ldm.generate import Generate -from server import services - -class Container(containers.DeclarativeContainer): - wiring_config = containers.WiringConfiguration(packages=['server']) - - config = providers.Configuration() - - socketio = providers.ThreadSafeSingleton( - SocketIO, - app = None - ) - - # TODO: Add a model provider service that provides model(s) dynamically - model_singleton = providers.ThreadSafeSingleton( - Generate, - model = config.model, - sampler_name = config.sampler_name, - embedding_path = config.embedding_path, - precision = config.precision - # config = config.model.config, - - # width = config.model.width, - # height = config.model.height, - # sampler_name = config.model.sampler_name, - # weights = config.model.weights, - # precision = config.model.precision, - # grid = config.model.grid, - # seamless = config.model.seamless, - # embedding_path = config.model.embedding_path, - # device_type = config.model.device_type - ) - - # TODO: get location from config - image_storage_service = providers.ThreadSafeSingleton( - services.ImageStorageService, - './outputs/img-samples/' - ) - - # TODO: get location from config - image_intermediates_storage_service = providers.ThreadSafeSingleton( - services.ImageStorageService, - './outputs/intermediates/' - ) - - signal_queue_service = providers.ThreadSafeSingleton( - services.SignalQueueService - ) - - signal_service = providers.ThreadSafeSingleton( - services.SignalService, - socketio = socketio, - queue = signal_queue_service - ) - - generation_queue_service = providers.ThreadSafeSingleton( - services.JobQueueService - ) - - # TODO: get locations from config - log_service = providers.ThreadSafeSingleton( - services.LogService, - './outputs/img-samples/', - 'dream_web_log.txt' - ) - - generator_service = providers.ThreadSafeSingleton( - services.GeneratorService, - model = model_singleton, - queue = generation_queue_service, - imageStorage = image_storage_service, - intermediateStorage = image_intermediates_storage_service, - log = log_service, - signal_service = signal_service - ) diff --git a/server/models.py b/server/models.py deleted file mode 100644 index 7b6cd07fa5..0000000000 --- a/server/models.py +++ /dev/null @@ -1,259 +0,0 @@ -# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) - -from base64 import urlsafe_b64encode -import json -import string -from copy import deepcopy -from datetime import datetime, timezone -from enum import Enum -from typing import Any, Dict, List, Union -from uuid import uuid4 - - -class DreamBase(): - # Id - id: str - - # Initial Image - enable_init_image: bool - initimg: string = None - - # Img2Img - enable_img2img: bool # TODO: support this better - strength: float = 0 # TODO: name this something related to img2img to make it clearer? - fit = None # Fit initial image dimensions - - # Generation - enable_generate: bool - prompt: string = "" - seed: int = 0 # 0 is random - steps: int = 10 - width: int = 512 - height: int = 512 - cfg_scale: float = 7.5 - threshold: float = 0.0 - perlin: float = 0.0 - sampler_name: string = 'klms' - seamless: bool = False - hires_fix: bool = False - model: str = None # The model to use (currently unused) - embeddings = None # The embeddings to use (currently unused) - progress_images: bool = False - progress_latents: bool = False - - # GFPGAN - enable_gfpgan: bool - facetool_strength: float = 0 - - # Upscale - enable_upscale: bool - upscale: None - upscale_level: int = None - upscale_strength: float = 0.75 - - # Embiggen - enable_embiggen: bool - embiggen: Union[None, List[float]] = None - embiggen_tiles: Union[None, List[int]] = None - - # Metadata - time: int - - def __init__(self): - self.id = urlsafe_b64encode(uuid4().bytes).decode('ascii') - - def parse_json(self, j, new_instance=False): - # Id - if 'id' in j and not new_instance: - self.id = j.get('id') - - # Initial Image - self.enable_init_image = 'enable_init_image' in j and bool(j.get('enable_init_image')) - if self.enable_init_image: - self.initimg = j.get('initimg') - - # Img2Img - self.enable_img2img = 'enable_img2img' in j and bool(j.get('enable_img2img')) - if self.enable_img2img: - self.strength = float(j.get('strength')) - self.fit = 'fit' in j - - # Generation - self.enable_generate = 'enable_generate' in j and bool(j.get('enable_generate')) - if self.enable_generate: - self.prompt = j.get('prompt') - self.seed = int(j.get('seed')) - self.steps = int(j.get('steps')) - self.width = int(j.get('width')) - self.height = int(j.get('height')) - self.cfg_scale = float(j.get('cfgscale') or j.get('cfg_scale')) - self.threshold = float(j.get('threshold')) - self.perlin = float(j.get('perlin')) - self.sampler_name = j.get('sampler') or j.get('sampler_name') - # model: str = None # The model to use (currently unused) - # embeddings = None # The embeddings to use (currently unused) - self.seamless = 'seamless' in j - self.hires_fix = 'hires_fix' in j - self.progress_images = 'progress_images' in j - self.progress_latents = 'progress_latents' in j - - # GFPGAN - self.enable_gfpgan = 'enable_gfpgan' in j and bool(j.get('enable_gfpgan')) - if self.enable_gfpgan: - self.facetool_strength = float(j.get('facetool_strength')) - - # Upscale - self.enable_upscale = 'enable_upscale' in j and bool(j.get('enable_upscale')) - if self.enable_upscale: - self.upscale_level = j.get('upscale_level') - self.upscale_strength = j.get('upscale_strength') - self.upscale = None if self.upscale_level in {None,''} else [int(self.upscale_level),float(self.upscale_strength)] - - # Embiggen - self.enable_embiggen = 'enable_embiggen' in j and bool(j.get('enable_embiggen')) - if self.enable_embiggen: - self.embiggen = j.get('embiggen') - self.embiggen_tiles = j.get('embiggen_tiles') - - # Metadata - self.time = int(j.get('time')) if ('time' in j and not new_instance) else int(datetime.now(timezone.utc).timestamp()) - - -class DreamResult(DreamBase): - # Result - has_upscaled: False - has_gfpgan: False - - # TODO: use something else for state tracking - images_generated: int = 0 - images_upscaled: int = 0 - - def __init__(self): - super().__init__() - - def clone_without_img(self): - copy = deepcopy(self) - copy.initimg = None - return copy - - def to_json(self): - copy = deepcopy(self) - copy.initimg = None - j = json.dumps(copy.__dict__) - return j - - @staticmethod - def from_json(j, newTime: bool = False): - d = DreamResult() - d.parse_json(j) - return d - - -# TODO: switch this to a pipelined request, with pluggable steps -# Will likely require generator code changes to accomplish -class JobRequest(DreamBase): - # Iteration - iterations: int = 1 - variation_amount = None - with_variations = None - - # Results - results: List[DreamResult] = [] - - def __init__(self): - super().__init__() - - def newDreamResult(self) -> DreamResult: - result = DreamResult() - result.parse_json(self.__dict__, new_instance=True) - return result - - @staticmethod - def from_json(j): - job = JobRequest() - job.parse_json(j) - - # Metadata - job.time = int(j.get('time')) if ('time' in j) else int(datetime.now(timezone.utc).timestamp()) - - # Iteration - if job.enable_generate: - job.iterations = int(j.get('iterations')) - job.variation_amount = float(j.get('variation_amount')) - job.with_variations = j.get('with_variations') - - return job - - -class ProgressType(Enum): - GENERATION = 1 - UPSCALING_STARTED = 2 - UPSCALING_DONE = 3 - -class Signal(): - event: str - data = None - room: str = None - broadcast: bool = False - - def __init__(self, event: str, data, room: str = None, broadcast: bool = False): - self.event = event - self.data = data - self.room = room - self.broadcast = broadcast - - @staticmethod - def image_progress(jobId: str, dreamId: str, step: int, totalSteps: int, progressType: ProgressType = ProgressType.GENERATION, hasProgressImage: bool = False): - return Signal('dream_progress', { - 'jobId': jobId, - 'dreamId': dreamId, - 'step': step, - 'totalSteps': totalSteps, - 'hasProgressImage': hasProgressImage, - 'progressType': progressType.name - }, room=jobId, broadcast=True) - - # TODO: use a result id or something? Like a sub-job - @staticmethod - def image_result(jobId: str, dreamId: str, dreamResult: DreamResult): - return Signal('dream_result', { - 'jobId': jobId, - 'dreamId': dreamId, - 'dreamRequest': dreamResult.clone_without_img().__dict__ - }, room=jobId, broadcast=True) - - @staticmethod - def job_started(jobId: str): - return Signal('job_started', { - 'jobId': jobId - }, room=jobId, broadcast=True) - - @staticmethod - def job_done(jobId: str): - return Signal('job_done', { - 'jobId': jobId - }, room=jobId, broadcast=True) - - @staticmethod - def job_canceled(jobId: str): - return Signal('job_canceled', { - 'jobId': jobId - }, room=jobId, broadcast=True) - - -class PaginatedItems(): - items: List[Any] - page: int # Current Page - pages: int # Total number of pages - per_page: int # Number of items per page - total: int # Total number of items in result - - def __init__(self, items: List[Any], page: int, pages: int, per_page: int, total: int): - self.items = items - self.page = page - self.pages = pages - self.per_page = per_page - self.total = total - - def to_json(self): - return json.dumps(self.__dict__) diff --git a/server/services.py b/server/services.py deleted file mode 100644 index cd97520ebf..0000000000 --- a/server/services.py +++ /dev/null @@ -1,392 +0,0 @@ -# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) - -from argparse import ArgumentParser -import base64 -from datetime import datetime, timezone -import glob -import json -import os -from pathlib import Path -from queue import Empty, Queue -import shlex -from threading import Thread -import time -from flask_socketio import SocketIO, join_room, leave_room -from ldm.invoke.args import Args -from ldm.invoke.generator import embiggen -from PIL import Image - -from ldm.invoke.pngwriter import PngWriter -from ldm.invoke.server import CanceledException -from ldm.generate import Generate -from server.models import DreamResult, JobRequest, PaginatedItems, ProgressType, Signal - -class JobQueueService: - __queue: Queue = Queue() - - def push(self, dreamRequest: DreamResult): - self.__queue.put(dreamRequest) - - def get(self, timeout: float = None) -> DreamResult: - return self.__queue.get(timeout= timeout) - -class SignalQueueService: - __queue: Queue = Queue() - - def push(self, signal: Signal): - self.__queue.put(signal) - - def get(self) -> Signal: - return self.__queue.get(block=False) - - -class SignalService: - __socketio: SocketIO - __queue: SignalQueueService - - def __init__(self, socketio: SocketIO, queue: SignalQueueService): - self.__socketio = socketio - self.__queue = queue - - def on_join(data): - room = data['room'] - join_room(room) - self.__socketio.emit("test", "something", room=room) - - def on_leave(data): - room = data['room'] - leave_room(room) - - self.__socketio.on_event('join_room', on_join) - self.__socketio.on_event('leave_room', on_leave) - - self.__socketio.start_background_task(self.__process) - - def __process(self): - # preload the model - print('Started signal queue processor') - try: - while True: - try: - signal = self.__queue.get() - self.__socketio.emit(signal.event, signal.data, room=signal.room, broadcast=signal.broadcast) - except Empty: - pass - finally: - self.__socketio.sleep(0.001) - - except KeyboardInterrupt: - print('Signal queue processor stopped') - - - def emit(self, signal: Signal): - self.__queue.push(signal) - - -# TODO: Name this better? -# TODO: Logging and signals should probably be event based (multiple listeners for an event) -class LogService: - __location: str - __logFile: str - - def __init__(self, location:str, file:str): - self.__location = location - self.__logFile = file - - def log(self, dreamResult: DreamResult, seed = None, upscaled = False): - with open(os.path.join(self.__location, self.__logFile), "a") as log: - log.write(f"{dreamResult.id}: {dreamResult.to_json()}\n") - - -class ImageStorageService: - __location: str - __pngWriter: PngWriter - __legacyParser: ArgumentParser - - def __init__(self, location): - self.__location = location - self.__pngWriter = PngWriter(self.__location) - self.__legacyParser = Args() # TODO: inject this? - - def __getName(self, dreamId: str, postfix: str = '') -> str: - return f'{dreamId}{postfix}.png' - - def save(self, image, dreamResult: DreamResult, postfix: str = '') -> str: - name = self.__getName(dreamResult.id, postfix) - meta = dreamResult.to_json() # TODO: make all methods consistent with writing metadata. Standardize metadata. - path = self.__pngWriter.save_image_and_prompt_to_png(image, dream_prompt=meta, metadata=None, name=name) - return path - - def path(self, dreamId: str, postfix: str = '') -> str: - name = self.__getName(dreamId, postfix) - path = os.path.join(self.__location, name) - return path - - # Returns true if found, false if not found or error - def delete(self, dreamId: str, postfix: str = '') -> bool: - path = self.path(dreamId, postfix) - if (os.path.exists(path)): - os.remove(path) - return True - else: - return False - - def getMetadata(self, dreamId: str, postfix: str = '') -> DreamResult: - path = self.path(dreamId, postfix) - image = Image.open(path) - text = image.text - if text.__contains__('Dream'): - dreamMeta = text.get('Dream') - try: - j = json.loads(dreamMeta) - return DreamResult.from_json(j) - except ValueError: - # Try to parse command-line format (legacy metadata format) - try: - opt = self.__parseLegacyMetadata(dreamMeta) - optd = opt.__dict__ - if (not 'width' in optd) or (optd.get('width') is None): - optd['width'] = image.width - if (not 'height' in optd) or (optd.get('height') is None): - optd['height'] = image.height - if (not 'steps' in optd) or (optd.get('steps') is None): - optd['steps'] = 10 # No way around this unfortunately - seems like it wasn't storing this previously - - optd['time'] = os.path.getmtime(path) # Set timestamp manually (won't be exactly correct though) - - return DreamResult.from_json(optd) - - except: - return None - else: - return None - - def __parseLegacyMetadata(self, command: str) -> DreamResult: - # before splitting, escape single quotes so as not to mess - # up the parser - command = command.replace("'", "\\'") - - try: - elements = shlex.split(command) - except ValueError as e: - return None - - # rearrange the arguments to mimic how it works in the Dream bot. - switches = [''] - switches_started = False - - for el in elements: - if el[0] == '-' and not switches_started: - switches_started = True - if switches_started: - switches.append(el) - else: - switches[0] += el - switches[0] += ' ' - switches[0] = switches[0][: len(switches[0]) - 1] - - try: - opt = self.__legacyParser.parse_cmd(switches) - return opt - except SystemExit: - return None - - def list_files(self, page: int, perPage: int) -> PaginatedItems: - files = sorted(glob.glob(os.path.join(self.__location,'*.png')), key=os.path.getmtime, reverse=True) - count = len(files) - - startId = page * perPage - pageCount = int(count / perPage) + 1 - endId = min(startId + perPage, count) - items = [] if startId >= count else files[startId:endId] - - items = list(map(lambda f: Path(f).stem, items)) - - return PaginatedItems(items, page, pageCount, perPage, count) - - -class GeneratorService: - __model: Generate - __queue: JobQueueService - __imageStorage: ImageStorageService - __intermediateStorage: ImageStorageService - __log: LogService - __thread: Thread - __cancellationRequested: bool = False - __signal_service: SignalService - - def __init__(self, model: Generate, queue: JobQueueService, imageStorage: ImageStorageService, intermediateStorage: ImageStorageService, log: LogService, signal_service: SignalService): - self.__model = model - self.__queue = queue - self.__imageStorage = imageStorage - self.__intermediateStorage = intermediateStorage - self.__log = log - self.__signal_service = signal_service - - # Create the background thread - self.__thread = Thread(target=self.__process, name = "GeneratorService") - self.__thread.daemon = True - self.__thread.start() - - - # Request cancellation of the current job - def cancel(self): - self.__cancellationRequested = True - - - # TODO: Consider moving this to its own service if there's benefit in separating the generator - def __process(self): - # preload the model - # TODO: support multiple models - print('Preloading model') - tic = time.time() - self.__model.load_model() - print(f'>> model loaded in', '%4.2fs' % (time.time() - tic)) - - print('Started generation queue processor') - try: - while True: - dreamRequest = self.__queue.get() - self.__generate(dreamRequest) - - except KeyboardInterrupt: - print('Generation queue processor stopped') - - - def __on_start(self, jobRequest: JobRequest): - self.__signal_service.emit(Signal.job_started(jobRequest.id)) - - - def __on_image_result(self, jobRequest: JobRequest, image, seed, upscaled=False): - dreamResult = jobRequest.newDreamResult() - dreamResult.seed = seed - dreamResult.has_upscaled = upscaled - dreamResult.iterations = 1 - jobRequest.results.append(dreamResult) - # TODO: Separate status of GFPGAN? - - self.__imageStorage.save(image, dreamResult) - - # TODO: handle upscaling logic better (this is appending data to log, but only on first generation) - if not upscaled: - self.__log.log(dreamResult) - - # Send result signal - self.__signal_service.emit(Signal.image_result(jobRequest.id, dreamResult.id, dreamResult)) - - upscaling_requested = dreamResult.enable_upscale or dreamResult.enable_gfpgan - - # Report upscaling status - # TODO: this is very coupled to logic inside the generator. Fix that. - if upscaling_requested and any(result.has_upscaled for result in jobRequest.results): - progressType = ProgressType.UPSCALING_STARTED if len(jobRequest.results) < 2 * jobRequest.iterations else ProgressType.UPSCALING_DONE - upscale_count = sum(1 for i in jobRequest.results if i.has_upscaled) - self.__signal_service.emit(Signal.image_progress(jobRequest.id, dreamResult.id, upscale_count, jobRequest.iterations, progressType)) - - - def __on_progress(self, jobRequest: JobRequest, sample, step): - if self.__cancellationRequested: - self.__cancellationRequested = False - raise CanceledException - - # TODO: Progress per request will be easier once the seeds (and ids) can all be pre-generated - hasProgressImage = False - s = str(len(jobRequest.results)) - if jobRequest.progress_images and step % 5 == 0 and step < jobRequest.steps - 1: - image = self.__model._sample_to_image(sample) - - # TODO: clean this up, use a pre-defined dream result - result = DreamResult() - result.parse_json(jobRequest.__dict__, new_instance=False) - self.__intermediateStorage.save(image, result, postfix=f'.{s}.{step}') - hasProgressImage = True - - self.__signal_service.emit(Signal.image_progress(jobRequest.id, f'{jobRequest.id}.{s}', step, jobRequest.steps, ProgressType.GENERATION, hasProgressImage)) - - - def __generate(self, jobRequest: JobRequest): - try: - # TODO: handle this file a file service for init images - initimgfile = None # TODO: support this on the model directly? - if (jobRequest.enable_init_image): - if jobRequest.initimg is not None: - with open("./img2img-tmp.png", "wb") as f: - initimg = jobRequest.initimg.split(",")[1] # Ignore mime type - f.write(base64.b64decode(initimg)) - initimgfile = "./img2img-tmp.png" - - # Use previous seed if set to -1 - initSeed = jobRequest.seed - if initSeed == -1: - initSeed = self.__model.seed - - # Zero gfpgan strength if the model doesn't exist - # TODO: determine if this could be at the top now? Used to cause circular import - from ldm.gfpgan.gfpgan_tools import gfpgan_model_exists - if not gfpgan_model_exists: - jobRequest.enable_gfpgan = False - - # Signal start - self.__on_start(jobRequest) - - # Generate in model - # TODO: Split job generation requests instead of fitting all parameters here - # TODO: Support no generation (just upscaling/gfpgan) - - upscale = None if not jobRequest.enable_upscale else jobRequest.upscale - facetool_strength = 0 if not jobRequest.enable_gfpgan else jobRequest.facetool_strength - - if not jobRequest.enable_generate: - # If not generating, check if we're upscaling or running gfpgan - if not upscale and not facetool_strength: - # Invalid settings (TODO: Add message to help user) - raise CanceledException() - - image = Image.open(initimgfile) - # TODO: support progress for upscale? - self.__model.upscale_and_reconstruct( - image_list = [[image,0]], - upscale = upscale, - strength = facetool_strength, - save_original = False, - image_callback = lambda image, seed, upscaled=False: self.__on_image_result(jobRequest, image, seed, upscaled)) - - else: - # Generating - run the generation - init_img = None if (not jobRequest.enable_img2img or jobRequest.strength == 0) else initimgfile - - - self.__model.prompt2image( - prompt = jobRequest.prompt, - init_img = init_img, # TODO: ensure this works - strength = None if init_img is None else jobRequest.strength, - fit = None if init_img is None else jobRequest.fit, - iterations = jobRequest.iterations, - cfg_scale = jobRequest.cfg_scale, - threshold = jobRequest.threshold, - perlin = jobRequest.perlin, - width = jobRequest.width, - height = jobRequest.height, - seed = jobRequest.seed, - steps = jobRequest.steps, - variation_amount = jobRequest.variation_amount, - with_variations = jobRequest.with_variations, - facetool_strength = facetool_strength, - upscale = upscale, - sampler_name = jobRequest.sampler_name, - seamless = jobRequest.seamless, - hires_fix = jobRequest.hires_fix, - embiggen = jobRequest.embiggen, - embiggen_tiles = jobRequest.embiggen_tiles, - step_callback = lambda sample, step: self.__on_progress(jobRequest, sample, step), - image_callback = lambda image, seed, upscaled=False: self.__on_image_result(jobRequest, image, seed, upscaled)) - - except CanceledException: - self.__signal_service.emit(Signal.job_canceled(jobRequest.id)) - - finally: - self.__signal_service.emit(Signal.job_done(jobRequest.id)) - - # Remove the temp file - if (initimgfile is not None): - os.remove("./img2img-tmp.png") diff --git a/server/views.py b/server/views.py deleted file mode 100644 index db4857d14f..0000000000 --- a/server/views.py +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) 2022 Kyle Schouviller (https://github.com/kyle0654) - -"""Views module.""" -import json -import os -from queue import Queue -from flask import current_app, jsonify, request, Response, send_from_directory, stream_with_context, url_for -from flask.views import MethodView -from dependency_injector.wiring import inject, Provide - -from server.models import DreamResult, JobRequest -from server.services import GeneratorService, ImageStorageService, JobQueueService -from server.containers import Container - -class ApiJobs(MethodView): - - @inject - def post(self, job_queue_service: JobQueueService = Provide[Container.generation_queue_service]): - jobRequest = JobRequest.from_json(request.json) - - print(f">> Request to generate with prompt: {jobRequest.prompt}") - - # Push the request - job_queue_service.push(jobRequest) - - return { 'jobId': jobRequest.id } - - -class WebIndex(MethodView): - init_every_request = False - __file: str = None - - def __init__(self, file): - self.__file = file - - def get(self): - return current_app.send_static_file(self.__file) - - -class WebConfig(MethodView): - init_every_request = False - - def get(self): - # unfortunately this import can't be at the top level, since that would cause a circular import - from ldm.gfpgan.gfpgan_tools import gfpgan_model_exists - config = { - 'gfpgan_model_exists': gfpgan_model_exists - } - js = f"let config = {json.dumps(config)};\n" - return Response(js, mimetype="application/javascript") - - -class ApiCancel(MethodView): - init_every_request = False - - @inject - def get(self, generator_service: GeneratorService = Provide[Container.generator_service]): - generator_service.cancel() - return Response(status=204) - - -# TODO: Combine all image storage access -class ApiImages(MethodView): - init_every_request = False - __pathRoot = None - __storage: ImageStorageService - - @inject - def __init__(self, pathBase, storage: ImageStorageService = Provide[Container.image_storage_service]): - self.__pathRoot = os.path.abspath(os.path.join(os.path.dirname(__file__), pathBase)) - self.__storage = storage - - def get(self, dreamId): - name = self.__storage.path(dreamId) - fullpath=os.path.join(self.__pathRoot, name) - return send_from_directory(os.path.dirname(fullpath), os.path.basename(fullpath)) - - def delete(self, dreamId): - result = self.__storage.delete(dreamId) - return Response(status=204) if result else Response(status=404) - - -class ApiImagesMetadata(MethodView): - init_every_request = False - __pathRoot = None - __storage: ImageStorageService - - @inject - def __init__(self, pathBase, storage: ImageStorageService = Provide[Container.image_storage_service]): - self.__pathRoot = os.path.abspath(os.path.join(os.path.dirname(__file__), pathBase)) - self.__storage = storage - - def get(self, dreamId): - meta = self.__storage.getMetadata(dreamId) - j = {} if meta is None else meta.__dict__ - return j - - -class ApiIntermediates(MethodView): - init_every_request = False - __pathRoot = None - __storage: ImageStorageService = Provide[Container.image_intermediates_storage_service] - - @inject - def __init__(self, pathBase, storage: ImageStorageService = Provide[Container.image_intermediates_storage_service]): - self.__pathRoot = os.path.abspath(os.path.join(os.path.dirname(__file__), pathBase)) - self.__storage = storage - - def get(self, dreamId, step): - name = self.__storage.path(dreamId, postfix=f'.{step}') - fullpath=os.path.join(self.__pathRoot, name) - return send_from_directory(os.path.dirname(fullpath), os.path.basename(fullpath)) - - def delete(self, dreamId): - result = self.__storage.delete(dreamId) - return Response(status=204) if result else Response(status=404) - - -class ApiImagesList(MethodView): - init_every_request = False - __storage: ImageStorageService - - @inject - def __init__(self, storage: ImageStorageService = Provide[Container.image_storage_service]): - self.__storage = storage - - def get(self): - page = request.args.get("page", default=0, type=int) - perPage = request.args.get("per_page", default=10, type=int) - - result = self.__storage.list_files(page, perPage) - return result.__dict__ From c0c4d7ca6989908fed3984cabea02cc3587b3a19 Mon Sep 17 00:00:00 2001 From: Matthias Wild <40327258+mauwii@users.noreply.github.com> Date: Fri, 16 Dec 2022 13:53:37 +0100 Subject: [PATCH 23/26] update (docker-)build scripts, `.dockerignore` and add patchmatch (#1970) * update build scripts and dockerignore updates to build and run script: - read repository name - include flavor in container name - read arch via arch command - use latest tag instead of arch - don't bindmount `$HOME/.huggingface` - make sure HUGGINGFACE_TOKEN is set updates to .dockerignore - include environment-and-requirements - exclude binary_installer - exclude docker-build - exclude docs * disable push and pr triggers of cloud image also disable pushing. This was decided since: - it is not multiarch useable - the default image is already cloud aproved * integrate patchmatch in container * pin verisons of recently introduced dependencies * remove now unecesarry part from build.sh move huggingface token to run script, so it can download missing models * move GPU_FLAGS to run script since not needed at build time * update env.sh - read REPOSITORY_NAME from env if available - add comment to explain the intension of this file - remove unecesarry exports * get rid of repository_name_lc * capitalize variables * update INSTALL_DOCKER with new variables * add comments pointing to the docs Co-authored-by: Lincoln Stein --- .dockerignore | 9 +---- .github/workflows/build-cloud-img.yml | 20 +++++------ docker-build/Dockerfile | 27 ++++++++++----- docker-build/build.sh | 46 +++++++++---------------- docker-build/env.sh | 20 ++++------- docker-build/run.sh | 28 ++++++++++----- docs/installation/040_INSTALL_DOCKER.md | 21 +++++------ 7 files changed, 83 insertions(+), 88 deletions(-) diff --git a/.dockerignore b/.dockerignore index 255335040f..5df924ddee 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,16 +1,13 @@ * !backend +!environments-and-requirements !frontend -!binary_installer !ldm !main.py !scripts !server !static !setup.py -!docker-build -!docs -docker-build/Dockerfile # Guard against pulling in any models that might exist in the directory tree **/*.pt* @@ -19,8 +16,4 @@ docker-build/Dockerfile !configs configs/models.yaml -# unignore environment dirs/files, but ignore the environment.yml file or symlink in case it exists -!environment* -environment.yml - **/__pycache__ diff --git a/.github/workflows/build-cloud-img.yml b/.github/workflows/build-cloud-img.yml index 9ef41a26c3..f27cbea80a 100644 --- a/.github/workflows/build-cloud-img.yml +++ b/.github/workflows/build-cloud-img.yml @@ -1,15 +1,15 @@ name: Build and push cloud image on: workflow_dispatch: - push: - branches: - - main - tags: - - v* - # we will NOT push the image on pull requests, only test buildability. - pull_request: - branches: - - main + # push: + # branches: + # - main + # tags: + # - v* + # # we will NOT push the image on pull requests, only test buildability. + # pull_request: + # branches: + # - main permissions: contents: read @@ -82,6 +82,6 @@ jobs: file: docker-build/Dockerfile.cloud platforms: Linux/${{ matrix.arch }} # do not push the image on PRs - push: ${{ github.event_name != 'pull_request' }} + push: false tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docker-build/Dockerfile b/docker-build/Dockerfile index d85d65dd57..353a02b50c 100644 --- a/docker-build/Dockerfile +++ b/docker-build/Dockerfile @@ -14,9 +14,10 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -# set workdir, PATH and copy sources -WORKDIR /usr/src/app -ENV PATH /usr/src/app/.venv/bin:$PATH +# set WORKDIR, PATH and copy sources +ARG WORKDIR=/usr/src/app +WORKDIR ${WORKDIR} +ENV PATH ${WORKDIR}/.venv/bin:$PATH ARG PIP_REQUIREMENTS=requirements-lin-cuda.txt COPY . ./environments-and-requirements/${PIP_REQUIREMENTS} ./ @@ -38,18 +39,28 @@ FROM python:3.10-slim AS runtime RUN apt-get update \ && apt-get install -y \ --no-install-recommends \ + build-essential=12.9 \ libgl1-mesa-glx=20.3.* \ libglib2.0-0=2.66.* \ + libopencv-dev=4.5.* \ + python3-opencv=4.5.* \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -WORKDIR /usr/src/app -COPY --from=builder /usr/src/app . - -# set Environment, Entrypoint and default CMD +# setup environment +ARG WORKDIR=/usr/src/app +WORKDIR ${WORKDIR} +COPY --from=builder ${WORKDIR} . +ENV PATH=${WORKDIR}/.venv/bin:$PATH ENV INVOKEAI_ROOT /data ENV INVOKE_MODEL_RECONFIGURE --yes -ENV PATH=/usr/src/app/.venv/bin:$PATH +# Initialize patchmatch +RUN ln -sf \ + /usr/lib/"$(arch)"-linux-gnu/pkgconfig/opencv4.pc \ + /usr/lib/"$(arch)"-linux-gnu/pkgconfig/opencv.pc \ + && python3 -c "from patchmatch import patch_match" + +# set Entrypoint and default CMD ENTRYPOINT [ "python3", "scripts/invoke.py" ] CMD [ "--web", "--host=0.0.0.0" ] diff --git a/docker-build/build.sh b/docker-build/build.sh index 6f0fbc174f..14e010d9c3 100755 --- a/docker-build/build.sh +++ b/docker-build/build.sh @@ -1,49 +1,35 @@ #!/usr/bin/env bash set -e -# IMPORTANT: You need to have a token on huggingface.co to be able to download the checkpoints!!! -# configure values by using env when executing build.sh f.e. `env ARCH=aarch64 ./build.sh` +# How to use: https://invoke-ai.github.io/InvokeAI/installation/INSTALL_DOCKER/#setup source ./docker-build/env.sh \ || echo "please execute docker-build/build.sh from repository root" \ || exit 1 -pip_requirements=${PIP_REQUIREMENTS:-requirements-lin-cuda.txt} -dockerfile=${INVOKE_DOCKERFILE:-docker-build/Dockerfile} +PIP_REQUIREMENTS=${PIP_REQUIREMENTS:-requirements-lin-cuda.txt} +DOCKERFILE=${INVOKE_DOCKERFILE:-docker-build/Dockerfile} # print the settings echo -e "You are using these values:\n" -echo -e "Dockerfile:\t ${dockerfile}" -echo -e "requirements:\t ${pip_requirements}" -echo -e "volumename:\t ${volumename}" -echo -e "arch:\t\t ${arch}" -echo -e "platform:\t ${platform}" -echo -e "invokeai_tag:\t ${invokeai_tag}\n" +echo -e "Dockerfile:\t ${DOCKERFILE}" +echo -e "Requirements:\t ${PIP_REQUIREMENTS}" +echo -e "Volumename:\t ${VOLUMENAME}" +echo -e "arch:\t\t ${ARCH}" +echo -e "Platform:\t ${PLATFORM}" +echo -e "Invokeai_tag:\t ${INVOKEAI_TAG}\n" -if [[ -n "$(docker volume ls -f name="${volumename}" -q)" ]]; then - echo "Volume already exists" - echo +if [[ -n "$(docker volume ls -f name="${VOLUMENAME}" -q)" ]]; then + echo -e "Volume already exists\n" else echo -n "createing docker volume " - docker volume create "${volumename}" + docker volume create "${VOLUMENAME}" fi # Build Container docker build \ - --platform="${platform}" \ - --tag="${invokeai_tag}" \ - --build-arg="PIP_REQUIREMENTS=${pip_requirements}" \ - --file="${dockerfile}" \ + --platform="${PLATFORM}" \ + --tag="${INVOKEAI_TAG}" \ + --build-arg="PIP_REQUIREMENTS=${PIP_REQUIREMENTS}" \ + --file="${DOCKERFILE}" \ . - -docker run \ - --rm \ - --platform="$platform" \ - --name="$project_name" \ - --hostname="$project_name" \ - --mount="source=$volumename,target=/data" \ - --mount="type=bind,source=$HOME/.huggingface,target=/root/.huggingface" \ - --env="HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}" \ - --entrypoint="python3" \ - "${invokeai_tag}" \ - scripts/configure_invokeai.py --yes diff --git a/docker-build/env.sh b/docker-build/env.sh index 76d4127ec1..a9021b484d 100644 --- a/docker-build/env.sh +++ b/docker-build/env.sh @@ -1,15 +1,9 @@ #!/usr/bin/env bash -project_name=${PROJECT_NAME:-invokeai} -volumename=${VOLUMENAME:-${project_name}_data} -arch=${ARCH:-x86_64} -platform=${PLATFORM:-Linux/${arch}} -invokeai_tag=${INVOKEAI_TAG:-${project_name}:${arch}} -gpus=${GPU_FLAGS:+--gpus=${GPU_FLAGS}} - -export project_name -export volumename -export arch -export platform -export invokeai_tag -export gpus +# Variables shared by build.sh and run.sh +REPOSITORY_NAME=${REPOSITORY_NAME:-$(basename "$(git rev-parse --show-toplevel)")} +VOLUMENAME=${VOLUMENAME:-${REPOSITORY_NAME,,}_data} +ARCH=${ARCH:-$(arch)} +PLATFORM=${PLATFORM:-Linux/${ARCH}} +CONTAINER_FLAVOR=${CONTAINER_FLAVOR:-cuda} +INVOKEAI_TAG=${REPOSITORY_NAME,,}-${CONTAINER_FLAVOR}:${INVOKEAI_TAG:-latest} diff --git a/docker-build/run.sh b/docker-build/run.sh index d2f232d6fa..b7089fccd2 100755 --- a/docker-build/run.sh +++ b/docker-build/run.sh @@ -1,21 +1,31 @@ #!/usr/bin/env bash set -e -source ./docker-build/env.sh || echo "please run from repository root" || exit 1 +# How to use: https://invoke-ai.github.io/InvokeAI/installation/INSTALL_DOCKER/#run-the-container +# IMPORTANT: You need to have a token on huggingface.co to be able to download the checkpoints!!! + +source ./docker-build/env.sh \ + || echo "please run from repository root" \ + || exit 1 + +# check if HUGGINGFACE_TOKEN is available +# You must have accepted the terms of use for required models +HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN:?Please set your token for Huggingface as HUGGINGFACE_TOKEN} echo -e "You are using these values:\n" -echo -e "volumename:\t ${volumename}" -echo -e "invokeai_tag:\t ${invokeai_tag}\n" +echo -e "Volumename:\t ${VOLUMENAME}" +echo -e "Invokeai_tag:\t ${INVOKEAI_TAG}\n" docker run \ --interactive \ --tty \ --rm \ - --platform="$platform" \ - --name="$project_name" \ - --hostname="$project_name" \ - --mount="source=$volumename,target=/data" \ + --platform="$PLATFORM" \ + --name="${REPOSITORY_NAME,,}" \ + --hostname="${REPOSITORY_NAME,,}" \ + --mount="source=$VOLUMENAME,target=/data" \ + --env="HUGGINGFACE_TOKEN=${HUGGINGFACE_TOKEN}" \ --publish=9090:9090 \ --cap-add=sys_nice \ - $gpus \ - "$invokeai_tag" ${1:+$@} + ${GPU_FLAGS:+--gpus=${GPU_FLAGS}} \ + "$INVOKEAI_TAG" ${1:+$@} diff --git a/docs/installation/040_INSTALL_DOCKER.md b/docs/installation/040_INSTALL_DOCKER.md index 9b9ccaadf0..c7c2d6adae 100644 --- a/docs/installation/040_INSTALL_DOCKER.md +++ b/docs/installation/040_INSTALL_DOCKER.md @@ -78,15 +78,16 @@ Some Suggestions of variables you may want to change besides the Token:
-| Environment-Variable | Default value | Description | -| -------------------- | ----------------------------- | -------------------------------------------------------------------------------------------- | -| `HUGGINGFACE_TOKEN` | No default, but **required**! | This is the only **required** variable, without it you can't download the huggingface models | -| `PROJECT_NAME` | `invokeai` | affects the project folder, tag- and volume name | -| `VOLUMENAME` | `${PROJECT_NAME}_data` | Name of the Docker Volume where model files will be stored | -| `ARCH` | `x86_64` | can be changed to f.e. aarch64 if you are using a ARM based CPU | -| `INVOKEAI_TAG` | `${PROJECT_NAME}:${ARCH}` | the Container Repository / Tag which will be used | -| `PIP_REQUIREMENTS` | `requirements-lin-cuda.txt` | the requirements file to use (from `environments-and-requirements`) | -| `INVOKE_DOCKERFILE` | `docker-build/Dockerfile` | the Dockerfile which should be built, handy for development | +| Environment-Variable | Default value | Description | +| -------------------- | ----------------------------- | -------------------------------------------------------------------------------------------- | +| `HUGGINGFACE_TOKEN` | No default, but **required**! | This is the only **required** variable, without it you can't download the huggingface models | +| `REPOSITORY_NAME` | The Basename of the Repo folder | This name will used as the container repository/image name | +| `VOLUMENAME` | `${REPOSITORY_NAME,,}_data` | Name of the Docker Volume where model files will be stored | +| `ARCH` | arch of the build machine | can be changed if you want to build the image for another arch | +| `INVOKEAI_TAG` | latest | the Container Repository / Tag which will be used | +| `PIP_REQUIREMENTS` | `requirements-lin-cuda.txt` | the requirements file to use (from `environments-and-requirements`) | +| `CONTAINER_FLAVOR` | cuda | the flavor of the image, which can be changed if you build f.e. with amd requirements file. | +| `INVOKE_DOCKERFILE` | `docker-build/Dockerfile` | the Dockerfile which should be built, handy for development |
@@ -129,7 +130,7 @@ also do so. ## Running the container on your GPU -If you have an Nvidia GPU, you can enable InvokeAI to run on the GPU by running the container with an extra +If you have an Nvidia GPU, you can enable InvokeAI to run on the GPU by running the container with an extra environment variable to enable GPU usage and have the process run much faster: ```bash From 2aa5bb6aad115f6a0039a2d5445e69b581e164eb Mon Sep 17 00:00:00 2001 From: Kaspar Emanuel Date: Fri, 16 Dec 2022 12:56:39 +0000 Subject: [PATCH 24/26] Auto-format frontend (#2009) * Auto-format frontend * Update lint-frontend GA workflow node and checkout * Fix linter error in ThemeChanger * Add a `on: pull_request` to lint-frontend workflow Co-authored-by: Lincoln Stein --- .github/workflows/lint-frontend.yml | 10 ++++-- frontend/index.html | 24 +++++++------- frontend/package.json | 3 ++ frontend/src/Loading.tsx | 32 +++++++++---------- .../common/components/radix-ui/IAITooltip.tsx | 9 ++++-- .../common/hooks/useClickOutsideWatcher.ts | 2 +- .../src/common/icons/ImageToImageIcon.tsx | 2 +- frontend/src/common/icons/NodesIcon.tsx | 2 +- frontend/src/common/icons/OutpaintIcon.tsx | 2 +- frontend/src/common/icons/TextToImageIcon.tsx | 2 +- .../components/IAICanvasIntermediateImage.tsx | 2 +- .../features/canvas/hooks/useCanvasMouseUp.ts | 5 ++- .../gallery/store/thunks/uploadImage.ts | 2 +- .../BoundingBoxSettings.tsx | 3 +- .../Upscale/UpscaleOptions.tsx | 2 +- .../components/ProcessButtons/Loopback.tsx | 5 ++- .../features/system/components/Console.tsx | 6 +++- .../system/components/ThemeChanger.tsx | 2 +- .../ImageToImage/InitImagePreview.tsx | 2 +- frontend/vite.config.ts | 2 +- frontend/yarn.lock | 5 +++ 21 files changed, 75 insertions(+), 49 deletions(-) diff --git a/.github/workflows/lint-frontend.yml b/.github/workflows/lint-frontend.yml index c2eeeb9a08..3b4496d800 100644 --- a/.github/workflows/lint-frontend.yml +++ b/.github/workflows/lint-frontend.yml @@ -1,6 +1,9 @@ name: Lint frontend on: + pull_request: + paths: + - 'frontend/**' push: paths: - 'frontend/**' @@ -14,11 +17,12 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Setup Node 18 - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: '18' - - uses: actions/checkout@v2 - - run: 'yarn install' + - uses: actions/checkout@v3 + - run: 'yarn install --frozen-lockfile' - run: 'yarn tsc' - run: 'yarn run madge' - run: 'yarn run lint --max-warnings=0' + - run: 'yarn run prettier --check' diff --git a/frontend/index.html b/frontend/index.html index b8776b3bfb..8314e22a7d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,16 +1,14 @@ + + + + InvokeAI - A Stable Diffusion Toolkit + + - - - - InvokeAI - A Stable Diffusion Toolkit - - - - -
- - - - \ No newline at end of file + +
+ + + diff --git a/frontend/package.json b/frontend/package.json index b142094b7b..e0f53d6daa 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,6 +10,8 @@ "preview": "vite preview", "madge": "madge --circular src/main.tsx", "lint": "eslint src/", + "prettier": "prettier '*.{json,cjs,ts,html}' 'src/**/*.{ts,tsx}'", + "fmt": "npm run prettier -- --write", "postinstall": "patch-package" }, "dependencies": { @@ -63,6 +65,7 @@ "madge": "^5.0.1", "patch-package": "^6.5.0", "postinstall-postinstall": "^2.1.0", + "prettier": "^2.8.1", "sass": "^1.55.0", "terser": "^5.16.1", "tsc-watch": "^5.0.3", diff --git a/frontend/src/Loading.tsx b/frontend/src/Loading.tsx index 83dba59fc4..8e71bb9ac6 100644 --- a/frontend/src/Loading.tsx +++ b/frontend/src/Loading.tsx @@ -1,22 +1,22 @@ import { Flex, Spinner } from '@chakra-ui/react'; const Loading = () => { - return ( - - - - ); + return ( + + + + ); }; export default Loading; diff --git a/frontend/src/common/components/radix-ui/IAITooltip.tsx b/frontend/src/common/components/radix-ui/IAITooltip.tsx index 438ab17ae2..539751a8ca 100644 --- a/frontend/src/common/components/radix-ui/IAITooltip.tsx +++ b/frontend/src/common/components/radix-ui/IAITooltip.tsx @@ -20,10 +20,15 @@ const IAITooltip = (props: IAITooltipProps) => { {e.preventDefault()}} + onPointerDownOutside={(e) => { + e.preventDefault(); + }} className="invokeai__tooltip-content" > - + {children} diff --git a/frontend/src/common/hooks/useClickOutsideWatcher.ts b/frontend/src/common/hooks/useClickOutsideWatcher.ts index 6e216a2d06..1f20c06302 100644 --- a/frontend/src/common/hooks/useClickOutsideWatcher.ts +++ b/frontend/src/common/hooks/useClickOutsideWatcher.ts @@ -1,4 +1,4 @@ -import { RefObject, useEffect} from 'react'; +import { RefObject, useEffect } from 'react'; const watchers: { ref: RefObject; diff --git a/frontend/src/common/icons/ImageToImageIcon.tsx b/frontend/src/common/icons/ImageToImageIcon.tsx index 3c4ad0892a..711d23366a 100644 --- a/frontend/src/common/icons/ImageToImageIcon.tsx +++ b/frontend/src/common/icons/ImageToImageIcon.tsx @@ -1,4 +1,4 @@ -import { createIcon } from "@chakra-ui/react"; +import { createIcon } from '@chakra-ui/react'; const ImageToImageIcon = createIcon({ displayName: 'ImageToImageIcon', diff --git a/frontend/src/common/icons/NodesIcon.tsx b/frontend/src/common/icons/NodesIcon.tsx index 95a8b4102b..273deaa8cd 100644 --- a/frontend/src/common/icons/NodesIcon.tsx +++ b/frontend/src/common/icons/NodesIcon.tsx @@ -1,4 +1,4 @@ -import { createIcon } from "@chakra-ui/react"; +import { createIcon } from '@chakra-ui/react'; const NodesIcon = createIcon({ displayName: 'NodesIcon', diff --git a/frontend/src/common/icons/OutpaintIcon.tsx b/frontend/src/common/icons/OutpaintIcon.tsx index c01a61c932..dcfc62ad8f 100644 --- a/frontend/src/common/icons/OutpaintIcon.tsx +++ b/frontend/src/common/icons/OutpaintIcon.tsx @@ -1,4 +1,4 @@ -import { createIcon } from "@chakra-ui/react"; +import { createIcon } from '@chakra-ui/react'; const OutpaintIcon = createIcon({ displayName: 'OutpaintIcon', diff --git a/frontend/src/common/icons/TextToImageIcon.tsx b/frontend/src/common/icons/TextToImageIcon.tsx index 97e84fdf19..f6148ea49c 100644 --- a/frontend/src/common/icons/TextToImageIcon.tsx +++ b/frontend/src/common/icons/TextToImageIcon.tsx @@ -1,4 +1,4 @@ -import { createIcon } from "@chakra-ui/react"; +import { createIcon } from '@chakra-ui/react'; const TextToImageIcon = createIcon({ displayName: 'TextToImageIcon', diff --git a/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx b/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx index 65cedebdee..f1a76def45 100644 --- a/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx +++ b/frontend/src/features/canvas/components/IAICanvasIntermediateImage.tsx @@ -43,7 +43,7 @@ const IAICanvasIntermediateImage = (props: Props) => { const { boundingBox: { x, y, width, height }, } = intermediateImage; - + return loadedImageElement ? ( { - const { boundingBoxDimensions, boundingBoxScaleMethod: boundingBoxScale } = canvas; + const { boundingBoxDimensions, boundingBoxScaleMethod: boundingBoxScale } = + canvas; return { boundingBoxDimensions, boundingBoxScale, diff --git a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx index c88d2cb7cf..46929556f4 100644 --- a/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx +++ b/frontend/src/features/options/components/AdvancedOptions/Upscale/UpscaleOptions.tsx @@ -60,7 +60,7 @@ const UpscaleOptions = () => { const handleChangeStrength = (v: number) => dispatch(setUpscalingStrength(v)); return ( -
+
state.options, diff --git a/frontend/src/features/system/components/Console.tsx b/frontend/src/features/system/components/Console.tsx index 20eaa3a8b8..2122deb5d9 100644 --- a/frontend/src/features/system/components/Console.tsx +++ b/frontend/src/features/system/components/Console.tsx @@ -1,7 +1,11 @@ import { IconButton, Tooltip } from '@chakra-ui/react'; import { useAppDispatch, useAppSelector } from 'app/storeHooks'; import { RootState } from 'app/store'; -import { errorSeen, setShouldShowLogViewer, SystemState } from 'features/system/store/systemSlice'; +import { + errorSeen, + setShouldShowLogViewer, + SystemState, +} from 'features/system/store/systemSlice'; import { useLayoutEffect, useRef, useState } from 'react'; import { FaAngleDoubleDown, FaCode, FaMinus } from 'react-icons/fa'; import { createSelector } from '@reduxjs/toolkit'; diff --git a/frontend/src/features/system/components/ThemeChanger.tsx b/frontend/src/features/system/components/ThemeChanger.tsx index 33f52b2d97..a547c9ac5b 100644 --- a/frontend/src/features/system/components/ThemeChanger.tsx +++ b/frontend/src/features/system/components/ThemeChanger.tsx @@ -23,7 +23,7 @@ export default function ThemeChanger() { if (colorMode !== currentTheme) { setColorMode(currentTheme); } - }, [colorMode, currentTheme]); + }, [setColorMode, colorMode, currentTheme]); const handleChangeTheme = (theme: string) => { dispatch(setCurrentTheme(theme)); diff --git a/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx b/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx index 045f2e4477..17807dcaf3 100644 --- a/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx +++ b/frontend/src/features/tabs/components/ImageToImage/InitImagePreview.tsx @@ -31,7 +31,7 @@ export default function InitImagePreview() { return ( <>
- {/*
*/} + {/*
*/}

Initial Image

{/* { * We need to polyfill for Array.prototype.findLast(); the polyfill plugin above * overrides any target specified here. */ - // target: 'esnext', + // target: 'esnext', chunkSizeWarningLimit: 1500, // we don't really care about chunk size }, }; diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 0691ecf3d2..867d1711d3 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3880,6 +3880,11 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" +prettier@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" + integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== + pretty-ms@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" From de7abce46423027ff254801b287afc5c2940e85d Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 16 Dec 2022 10:14:49 -0500 Subject: [PATCH 25/26] add an argument that lets user specify folders to scan for weights (#1977) * add an argument that lets user specify folders to scan for weights This PR adds a `--weight_folders` argument to invoke.py. Using argparse, it adds a "weight_folders" attribute to the Args object, and can be used like this: ``` '''test.py''' from ldm.invoke.args import Args args = Args().parse_args() for folder in args.weight_folders: print(folder) ``` Example output: ``` python test.py --weight_folders /tmp/weights /home/fred/invokeai/weights "./my folder with spaces/weight files" /tmp/weights /home/fred/invokeai/weights ./my folder with spaces/weight files ``` * change --weight_folders to --weight_dirs --- ldm/invoke/args.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ldm/invoke/args.py b/ldm/invoke/args.py index 98a75c9886..d7769c76e7 100644 --- a/ldm/invoke/args.py +++ b/ldm/invoke/args.py @@ -431,6 +431,12 @@ class Args(object): '--model', help='Indicates which diffusion model to load (defaults to "default" stanza in configs/models.yaml)', ) + model_group.add_argument( + '--weight_dirs', + nargs='+', + type=str, + help='List of one or more directories that will be auto-scanned for new model weights to import', + ) model_group.add_argument( '--png_compression','-z', type=int, From f1748d70172f1735c296379ec4859cc0c4638890 Mon Sep 17 00:00:00 2001 From: Lincoln Stein Date: Fri, 16 Dec 2022 11:50:02 -0500 Subject: [PATCH 26/26] avoid leaking data to HuggingFace (#2021) Before making a concept download request to HuggingFace, the concepts library module now checks the concept name against a downloaded list of all the concepts currently known to HuggingFace. If the requested concept is not on the list, then no download request is made. --- ldm/invoke/concepts_lib.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ldm/invoke/concepts_lib.py b/ldm/invoke/concepts_lib.py index 942406acd3..e40eda814d 100644 --- a/ldm/invoke/concepts_lib.py +++ b/ldm/invoke/concepts_lib.py @@ -46,6 +46,9 @@ class Concepts(object): the named concept. Returns None if invalid or cannot be downloaded. ''' + if not concept_name in self.list_concepts(): + print(f'This concept is not known to the Hugging Face library. Generation will continue without the concept.') + return None return self.get_concept_file(concept_name.lower(),'learned_embeds.bin') def concept_to_trigger(self, concept_name:str)->str: