Compare commits
68 Commits
ryan/seaml
...
ryan/graph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2684b45af | ||
|
|
d4c36da3ee | ||
|
|
dfe0b73890 | ||
|
|
c0c8fa9a89 | ||
|
|
ad7139829c | ||
|
|
a24e63d440 | ||
|
|
59437a02c3 | ||
|
|
98a44d7fa1 | ||
|
|
07416753be | ||
|
|
630854ce26 | ||
|
|
b55c2b99a7 | ||
|
|
f81d36c95f | ||
|
|
26b7aadd32 | ||
|
|
8e7e3c2b4a | ||
|
|
f2e8b66be4 | ||
|
|
ff09fd30dc | ||
|
|
9fcc30c3d6 | ||
|
|
b29a6522ef | ||
|
|
936d19cd60 | ||
|
|
f25b6ee5d1 | ||
|
|
7dea079220 | ||
|
|
7fc08962fb | ||
|
|
71155d9e72 | ||
|
|
6ccd72349d | ||
|
|
30e12376d3 | ||
|
|
23c8a893e1 | ||
|
|
7d93329401 | ||
|
|
968fb655a4 | ||
|
|
80ec9f4131 | ||
|
|
f19def5f7b | ||
|
|
9e1dd8ac9c | ||
|
|
ebd68b7a6c | ||
|
|
68a231afea | ||
|
|
21ab650ac0 | ||
|
|
b501bd709f | ||
|
|
4082f25062 | ||
|
|
63d74b4ba6 | ||
|
|
da5907613b | ||
|
|
3a9201bd31 | ||
|
|
d6e2cb7cef | ||
|
|
0809e832d4 | ||
|
|
7269c9f02e | ||
|
|
d86d7e5c33 | ||
|
|
5d87578746 | ||
|
|
04aef021fc | ||
|
|
0fc08bb384 | ||
|
|
5779542084 | ||
|
|
ebda81e96e | ||
|
|
3fe332e85f | ||
|
|
3428ea1b3c | ||
|
|
6024fc7baf | ||
|
|
75c1c4ce5a | ||
|
|
ffa05a0bb3 | ||
|
|
a20e17330b | ||
|
|
4e83644433 | ||
|
|
604f0083f2 | ||
|
|
2a8a158823 | ||
|
|
f8c3db72e9 | ||
|
|
60815807f9 | ||
|
|
196fb0e014 | ||
|
|
eba668956d | ||
|
|
ee5ec023f4 | ||
|
|
d59661e0af | ||
|
|
f51e8eeae1 | ||
|
|
6e06935e75 | ||
|
|
f7f697849c | ||
|
|
8e17e29a5c | ||
|
|
12e9f17f7a |
8
.github/CODEOWNERS
vendored
@@ -1,5 +1,5 @@
|
||||
# continuous integration
|
||||
/.github/workflows/ @lstein @blessedcoolant @hipsterusername
|
||||
/.github/workflows/ @lstein @blessedcoolant @hipsterusername @ebr
|
||||
|
||||
# documentation
|
||||
/docs/ @lstein @blessedcoolant @hipsterusername @Millu
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
# installation and configuration
|
||||
/pyproject.toml @lstein @blessedcoolant @hipsterusername
|
||||
/docker/ @lstein @blessedcoolant @hipsterusername
|
||||
/docker/ @lstein @blessedcoolant @hipsterusername @ebr
|
||||
/scripts/ @ebr @lstein @hipsterusername
|
||||
/installer/ @lstein @ebr @hipsterusername
|
||||
/invokeai/assets @lstein @ebr @hipsterusername
|
||||
@@ -26,9 +26,7 @@
|
||||
|
||||
# front ends
|
||||
/invokeai/frontend/CLI @lstein @hipsterusername
|
||||
/invokeai/frontend/install @lstein @ebr @hipsterusername
|
||||
/invokeai/frontend/install @lstein @ebr @hipsterusername
|
||||
/invokeai/frontend/merge @lstein @blessedcoolant @hipsterusername
|
||||
/invokeai/frontend/training @lstein @blessedcoolant @hipsterusername
|
||||
/invokeai/frontend/web @psychedelicious @blessedcoolant @maryhipp @hipsterusername
|
||||
|
||||
|
||||
|
||||
5
.github/workflows/build-container.yml
vendored
@@ -40,10 +40,14 @@ jobs:
|
||||
- name: Free up more disk space on the runner
|
||||
# https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930
|
||||
run: |
|
||||
echo "----- Free space before cleanup"
|
||||
df -h
|
||||
sudo rm -rf /usr/share/dotnet
|
||||
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||
sudo swapoff /mnt/swapfile
|
||||
sudo rm -rf /mnt/swapfile
|
||||
echo "----- Free space after cleanup"
|
||||
df -h
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -91,6 +95,7 @@ jobs:
|
||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build container
|
||||
timeout-minutes: 40
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
|
||||
@@ -59,7 +59,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
|
||||
# #### Build the Web UI ------------------------------------
|
||||
|
||||
FROM node:18-slim AS web-builder
|
||||
FROM node:20-slim AS web-builder
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable
|
||||
@@ -68,7 +68,7 @@ WORKDIR /build
|
||||
COPY invokeai/frontend/web/ ./
|
||||
RUN --mount=type=cache,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
RUN pnpm run build
|
||||
RUN npx vite build
|
||||
|
||||
#### Runtime stage ---------------------------------------
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 297 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 4.9 MiB |
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 209 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 112 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 132 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 119 KiB |
|
Before Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 60 KiB |
BIN
docs/assets/nodes/workflow_library.png
Normal file
|
After Width: | Height: | Size: 129 KiB |
53
docs/deprecated/2to3.md
Normal file
@@ -0,0 +1,53 @@
|
||||
## :octicons-log-16: Important Changes Since Version 2.3
|
||||
|
||||
### Nodes
|
||||
|
||||
Behind the scenes, InvokeAI has been completely rewritten to support
|
||||
"nodes," small unitary operations that can be combined into graphs to
|
||||
form arbitrary workflows. For example, there is a prompt node that
|
||||
processes the prompt string and feeds it to a text2latent node that
|
||||
generates a latent image. The latents are then fed to a latent2image
|
||||
node that translates the latent image into a PNG.
|
||||
|
||||
The WebGUI has a node editor that allows you to graphically design and
|
||||
execute custom node graphs. The ability to save and load graphs is
|
||||
still a work in progress, but coming soon.
|
||||
|
||||
### Command-Line Interface Retired
|
||||
|
||||
All "invokeai" command-line interfaces have been retired as of version
|
||||
3.4.
|
||||
|
||||
To launch the Web GUI from the command-line, use the command
|
||||
`invokeai-web` rather than the traditional `invokeai --web`.
|
||||
|
||||
### ControlNet
|
||||
|
||||
This version of InvokeAI features ControlNet, a system that allows you
|
||||
to achieve exact poses for human and animal figures by providing a
|
||||
model to follow. Full details are found in [ControlNet](features/CONTROLNET.md)
|
||||
|
||||
### New Schedulers
|
||||
|
||||
The list of schedulers has been completely revamped and brought up to date:
|
||||
|
||||
| **Short Name** | **Scheduler** | **Notes** |
|
||||
|----------------|---------------------------------|-----------------------------|
|
||||
| **ddim** | DDIMScheduler | |
|
||||
| **ddpm** | DDPMScheduler | |
|
||||
| **deis** | DEISMultistepScheduler | |
|
||||
| **lms** | LMSDiscreteScheduler | |
|
||||
| **pndm** | PNDMScheduler | |
|
||||
| **heun** | HeunDiscreteScheduler | original noise schedule |
|
||||
| **heun_k** | HeunDiscreteScheduler | using karras noise schedule |
|
||||
| **euler** | EulerDiscreteScheduler | original noise schedule |
|
||||
| **euler_k** | EulerDiscreteScheduler | using karras noise schedule |
|
||||
| **kdpm_2** | KDPM2DiscreteScheduler | |
|
||||
| **kdpm_2_a** | KDPM2AncestralDiscreteScheduler | |
|
||||
| **dpmpp_2s** | DPMSolverSinglestepScheduler | |
|
||||
| **dpmpp_2m** | DPMSolverMultistepScheduler | original noise scnedule |
|
||||
| **dpmpp_2m_k** | DPMSolverMultistepScheduler | using karras noise schedule |
|
||||
| **unipc** | UniPCMultistepScheduler | CPU only |
|
||||
| **lcm** | LCMScheduler | |
|
||||
|
||||
Please see [3.0.0 Release Notes](https://github.com/invoke-ai/InvokeAI/releases/tag/v3.0.0) for further details.
|
||||
@@ -229,29 +229,28 @@ clarity on the intent and common use cases we expect for utilizing them.
|
||||
currently being rendered by your browser into a merged copy of the image. This
|
||||
lowers the resource requirements and should improve performance.
|
||||
|
||||
### Seam Correction
|
||||
### Compositing / Seam Correction
|
||||
|
||||
When doing Inpainting or Outpainting, Invoke needs to merge the pixels generated
|
||||
by Stable Diffusion into your existing image. To do this, the area around the
|
||||
`seam` at the boundary between your image and the new generation is
|
||||
by Stable Diffusion into your existing image. This is achieved through compositing - the area around the the boundary between your image and the new generation is
|
||||
automatically blended to produce a seamless output. In a fully automatic
|
||||
process, a mask is generated to cover the seam, and then the area of the seam is
|
||||
process, a mask is generated to cover the boundary, and then the area of the boundary is
|
||||
Inpainted.
|
||||
|
||||
Although the default options should work well most of the time, sometimes it can
|
||||
help to alter the parameters that control the seam Inpainting. A wider seam and
|
||||
a blur setting of about 1/3 of the seam have been noted as producing
|
||||
consistently strong results (e.g. 96 wide and 16 blur - adds up to 32 blur with
|
||||
both sides). Seam strength of 0.7 is best for reducing hard seams.
|
||||
help to alter the parameters that control the Compositing. A larger blur and
|
||||
a blur setting have been noted as producing
|
||||
consistently strong results . Strength of 0.7 is best for reducing hard seams.
|
||||
|
||||
- **Mode** - What part of the image will have the the Compositing applied to it.
|
||||
- **Mask edge** will apply Compositing to the edge of the masked area
|
||||
- **Mask** will apply Compositing to the entire masked area
|
||||
- **Unmasked** will apply Compositing to the entire image
|
||||
- **Steps** - Number of generation steps that will occur during the Coherence Pass, similar to Denoising Steps. Higher step counts will generally have better results.
|
||||
- **Strength** - How much noise is added for the Coherence Pass, similar to Denoising Strength. A strength of 0 will result in an unchanged image, while a strength of 1 will result in an image with a completely new area as defined by the Mode setting.
|
||||
- **Blur** - Adjusts the pixel radius of the the mask. A larger blur radius will cause the mask to extend past the visibly masked area, while too small of a blur radius will result in a mask that is smaller than the visibly masked area.
|
||||
- **Blur Method** - The method of blur applied to the masked area.
|
||||
|
||||
- **Seam Size** - The size of the seam masked area. Set higher to make a larger
|
||||
mask around the seam.
|
||||
- **Seam Blur** - The size of the blur that is applied on _each_ side of the
|
||||
masked area.
|
||||
- **Seam Strength** - The Image To Image Strength parameter used for the
|
||||
Inpainting generation that is applied to the seam area.
|
||||
- **Seam Steps** - The number of generation steps that should be used to Inpaint
|
||||
the seam.
|
||||
|
||||
### Infill & Scaling
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ title: Home
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 50px;
|
||||
background-color: #448AFF;
|
||||
background-color: #35A4DB;
|
||||
color: #fff;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
@@ -43,7 +43,7 @@ title: Home
|
||||
<div align="center" markdown>
|
||||
|
||||
|
||||
[](https://github.com/invoke-ai/InvokeAI)
|
||||
[](https://github.com/invoke-ai/InvokeAI)
|
||||
|
||||
[![discord badge]][discord link]
|
||||
|
||||
@@ -145,60 +145,6 @@ Mac and Linux machines, and runs on GPU cards with as little as 4 GB of RAM.
|
||||
- [Guide to InvokeAI Runtime Settings](features/CONFIGURATION.md)
|
||||
- [Database Maintenance and other Command Line Utilities](features/UTILITIES.md)
|
||||
|
||||
## :octicons-log-16: Important Changes Since Version 2.3
|
||||
|
||||
### Nodes
|
||||
|
||||
Behind the scenes, InvokeAI has been completely rewritten to support
|
||||
"nodes," small unitary operations that can be combined into graphs to
|
||||
form arbitrary workflows. For example, there is a prompt node that
|
||||
processes the prompt string and feeds it to a text2latent node that
|
||||
generates a latent image. The latents are then fed to a latent2image
|
||||
node that translates the latent image into a PNG.
|
||||
|
||||
The WebGUI has a node editor that allows you to graphically design and
|
||||
execute custom node graphs. The ability to save and load graphs is
|
||||
still a work in progress, but coming soon.
|
||||
|
||||
### Command-Line Interface Retired
|
||||
|
||||
All "invokeai" command-line interfaces have been retired as of version
|
||||
3.4.
|
||||
|
||||
To launch the Web GUI from the command-line, use the command
|
||||
`invokeai-web` rather than the traditional `invokeai --web`.
|
||||
|
||||
### ControlNet
|
||||
|
||||
This version of InvokeAI features ControlNet, a system that allows you
|
||||
to achieve exact poses for human and animal figures by providing a
|
||||
model to follow. Full details are found in [ControlNet](features/CONTROLNET.md)
|
||||
|
||||
### New Schedulers
|
||||
|
||||
The list of schedulers has been completely revamped and brought up to date:
|
||||
|
||||
| **Short Name** | **Scheduler** | **Notes** |
|
||||
|----------------|---------------------------------|-----------------------------|
|
||||
| **ddim** | DDIMScheduler | |
|
||||
| **ddpm** | DDPMScheduler | |
|
||||
| **deis** | DEISMultistepScheduler | |
|
||||
| **lms** | LMSDiscreteScheduler | |
|
||||
| **pndm** | PNDMScheduler | |
|
||||
| **heun** | HeunDiscreteScheduler | original noise schedule |
|
||||
| **heun_k** | HeunDiscreteScheduler | using karras noise schedule |
|
||||
| **euler** | EulerDiscreteScheduler | original noise schedule |
|
||||
| **euler_k** | EulerDiscreteScheduler | using karras noise schedule |
|
||||
| **kdpm_2** | KDPM2DiscreteScheduler | |
|
||||
| **kdpm_2_a** | KDPM2AncestralDiscreteScheduler | |
|
||||
| **dpmpp_2s** | DPMSolverSinglestepScheduler | |
|
||||
| **dpmpp_2m** | DPMSolverMultistepScheduler | original noise scnedule |
|
||||
| **dpmpp_2m_k** | DPMSolverMultistepScheduler | using karras noise schedule |
|
||||
| **unipc** | UniPCMultistepScheduler | CPU only |
|
||||
| **lcm** | LCMScheduler | |
|
||||
|
||||
Please see [3.0.0 Release Notes](https://github.com/invoke-ai/InvokeAI/releases/tag/v3.0.0) for further details.
|
||||
|
||||
## :material-target: Troubleshooting
|
||||
|
||||
Please check out our **[:material-frequently-asked-questions:
|
||||
|
||||
@@ -6,10 +6,17 @@ If you're not familiar with Diffusion, take a look at our [Diffusion Overview.](
|
||||
|
||||
## Features
|
||||
|
||||
### Workflow Library
|
||||
The Workflow Library enables you to save workflows to the Invoke database, allowing you to easily creating, modify and share workflows as needed.
|
||||
|
||||
A curated set of workflows are provided by default - these are designed to help explain important nodes' usage in the Workflow Editor.
|
||||
|
||||

|
||||
|
||||
### Linear View
|
||||
The Workflow Editor allows you to create a UI for your workflow, to make it easier to iterate on your generations.
|
||||
|
||||
To add an input to the Linear UI, right click on the input label and select "Add to Linear View".
|
||||
To add an input to the Linear UI, right click on the **input label** and select "Add to Linear View".
|
||||
|
||||
The Linear UI View will also be part of the saved workflow, allowing you share workflows and enable other to use them, regardless of complexity.
|
||||
|
||||
@@ -30,7 +37,7 @@ Any node or input field can be renamed in the workflow editor. If the input fiel
|
||||
Nodes have a "Use Cache" option in their footer. This allows for performance improvements by using the previously cached values during the workflow processing.
|
||||
|
||||
|
||||
## Important Concepts
|
||||
## Important Nodes & Concepts
|
||||
|
||||
There are several node grouping concepts that can be examined with a narrow focus. These (and other) groupings can be pieced together to make up functional graph setups, and are important to understanding how groups of nodes work together as part of a whole. Note that the screenshots below aren't examples of complete functioning node graphs (see Examples).
|
||||
|
||||
@@ -56,7 +63,7 @@ The ImageToLatents node takes in a pixel image and a VAE and outputs a latents.
|
||||
|
||||
It is common to want to use both the same seed (for continuity) and random seeds (for variety). To define a seed, simply enter it into the 'Seed' field on a noise node. Conversely, the RandomInt node generates a random integer between 'Low' and 'High', and can be used as input to the 'Seed' edge point on a noise node to randomize your seed.
|
||||
|
||||

|
||||

|
||||
|
||||
### ControlNet
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Example Workflows
|
||||
|
||||
We've curated some example workflows for you to get started with Workflows in InvokeAI
|
||||
We've curated some example workflows for you to get started with Workflows in InvokeAI! These can also be found in the Workflow Library, located in the Workflow Editor of Invoke.
|
||||
|
||||
To use them, right click on your desired workflow, follow the link to GitHub and click the "⬇" button to download the raw file. You can then use the "Load Workflow" functionality in InvokeAI to load the workflow and start generating images!
|
||||
|
||||
|
||||
@@ -215,6 +215,7 @@ We thank them for all of their time and hard work.
|
||||
- Robert Bolender
|
||||
- Robin Rombach
|
||||
- Rohan Barar
|
||||
- rohinish404
|
||||
- rpagliuca
|
||||
- rromb
|
||||
- Rupesh Sreeraman
|
||||
|
||||
5
docs/stylesheets/extra.css
Normal file
@@ -0,0 +1,5 @@
|
||||
:root {
|
||||
--md-primary-fg-color: #35A4DB;
|
||||
--md-primary-fg-color--light: #35A4DB;
|
||||
--md-primary-fg-color--dark: #35A4DB;
|
||||
}
|
||||
@@ -241,12 +241,12 @@ class InvokeAiInstance:
|
||||
pip[
|
||||
"install",
|
||||
"--require-virtualenv",
|
||||
"numpy~=1.24.0", # choose versions that won't be uninstalled during phase 2
|
||||
"numpy==1.26.3", # choose versions that won't be uninstalled during phase 2
|
||||
"urllib3~=1.26.0",
|
||||
"requests~=2.28.0",
|
||||
"torch==2.1.2",
|
||||
"torchmetrics==0.11.4",
|
||||
"torchvision>=0.16.2",
|
||||
"torchvision==0.16.2",
|
||||
"--force-reinstall",
|
||||
"--find-links" if find_links is not None else None,
|
||||
find_links,
|
||||
|
||||
@@ -76,7 +76,7 @@ mimetypes.add_type("text/css", ".css")
|
||||
|
||||
# Create the app
|
||||
# TODO: create this all in a method so configuration/etc. can be passed in?
|
||||
app = FastAPI(title="Invoke AI", docs_url=None, redoc_url=None, separate_input_output_schemas=False)
|
||||
app = FastAPI(title="Invoke - Community Edition", docs_url=None, redoc_url=None, separate_input_output_schemas=False)
|
||||
|
||||
# Add event handler
|
||||
event_handler_id: int = id(app)
|
||||
@@ -205,8 +205,8 @@ app.openapi = custom_openapi # type: ignore [method-assign] # this is a valid a
|
||||
def overridden_swagger() -> HTMLResponse:
|
||||
return get_swagger_ui_html(
|
||||
openapi_url=app.openapi_url, # type: ignore [arg-type] # this is always a string
|
||||
title=app.title,
|
||||
swagger_favicon_url="/static/docs/favicon.ico",
|
||||
title=f"{app.title} - Swagger UI",
|
||||
swagger_favicon_url="static/docs/invoke-favicon-docs.svg",
|
||||
)
|
||||
|
||||
|
||||
@@ -214,8 +214,8 @@ def overridden_swagger() -> HTMLResponse:
|
||||
def overridden_redoc() -> HTMLResponse:
|
||||
return get_redoc_html(
|
||||
openapi_url=app.openapi_url, # type: ignore [arg-type] # this is always a string
|
||||
title=app.title,
|
||||
redoc_favicon_url="/static/docs/favicon.ico",
|
||||
title=f"{app.title} - Redoc",
|
||||
redoc_favicon_url="static/docs/invoke-favicon-docs.svg",
|
||||
)
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ if (web_root_path / "dist").exists():
|
||||
def get_index() -> FileResponse:
|
||||
return FileResponse(Path(web_root_path, "dist/index.html"), headers={"Cache-Control": "no-store"})
|
||||
|
||||
# # Must mount *after* the other routes else it borks em
|
||||
# Must mount *after* the other routes else it borks em
|
||||
app.mount("/assets", StaticFiles(directory=Path(web_root_path, "dist/assets/")), name="assets")
|
||||
app.mount("/locales", StaticFiles(directory=Path(web_root_path, "dist/locales/")), name="locales")
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# Copyright (c) 2023 Kyle Schouviller (https://github.com/kyle0654)
|
||||
|
||||
import contextlib
|
||||
from contextlib import ExitStack
|
||||
from functools import singledispatchmethod
|
||||
from typing import List, Literal, Optional, Union
|
||||
@@ -717,23 +716,10 @@ class DenoiseLatentsInvocation(BaseInvocation):
|
||||
**self.unet.unet.model_dump(),
|
||||
context=context,
|
||||
)
|
||||
|
||||
# Prepare seamless context, if configured.
|
||||
seamless_context = contextlib.nullcontext()
|
||||
seamless_config = self.unet.seamless
|
||||
if seamless_config is not None:
|
||||
seamless_context = set_seamless(
|
||||
model=unet_info.context.model,
|
||||
axes=seamless_config.axes,
|
||||
skipped_layers=seamless_config.skipped_layers,
|
||||
skip_second_resnet=seamless_config.skip_second_resnet,
|
||||
skip_conv2=seamless_config.skip_conv2,
|
||||
)
|
||||
|
||||
with (
|
||||
ExitStack() as exit_stack,
|
||||
ModelPatcher.apply_freeu(unet_info.context.model, self.unet.freeu_config),
|
||||
seamless_context,
|
||||
set_seamless(unet_info.context.model, self.unet.seamless_axes),
|
||||
unet_info as unet,
|
||||
# Apply the LoRA after unet has been moved to its target device for faster patching.
|
||||
ModelPatcher.apply_lora_unet(unet, _lora_loader()),
|
||||
@@ -840,19 +826,7 @@ class LatentsToImageInvocation(BaseInvocation, WithMetadata):
|
||||
context=context,
|
||||
)
|
||||
|
||||
# Prepare seamless context, if configured.
|
||||
seamless_context = contextlib.nullcontext()
|
||||
seamless_config = self.vae.seamless
|
||||
if seamless_config is not None:
|
||||
seamless_context = set_seamless(
|
||||
model=vae_info.context.model,
|
||||
axes=seamless_config.axes,
|
||||
skipped_layers=seamless_config.skipped_layers,
|
||||
skip_second_resnet=seamless_config.skip_second_resnet,
|
||||
skip_conv2=seamless_config.skip_conv2,
|
||||
)
|
||||
|
||||
with seamless_context, vae_info as vae:
|
||||
with set_seamless(vae_info.context.model, self.vae.seamless_axes), vae_info as vae:
|
||||
latents = latents.to(vae.device)
|
||||
if self.fp32:
|
||||
vae.to(dtype=torch.float32)
|
||||
|
||||
@@ -19,13 +19,6 @@ from .baseinvocation import (
|
||||
)
|
||||
|
||||
|
||||
class SeamlessSettings(BaseModel):
|
||||
axes: List[str] = Field(description="Axes('x' and 'y') to which apply seamless")
|
||||
skipped_layers: int = Field(description="How much down layers skip when applying seamless")
|
||||
skip_second_resnet: bool = Field(description="Skip or not second resnet in down blocks when applying seamless")
|
||||
skip_conv2: bool = Field(description="Skip or not conv2 in down blocks when applying seamless")
|
||||
|
||||
|
||||
class ModelInfo(BaseModel):
|
||||
model_name: str = Field(description="Info to load submodel")
|
||||
base_model: BaseModelType = Field(description="Base model")
|
||||
@@ -43,8 +36,8 @@ class UNetField(BaseModel):
|
||||
unet: ModelInfo = Field(description="Info to load unet submodel")
|
||||
scheduler: ModelInfo = Field(description="Info to load scheduler submodel")
|
||||
loras: List[LoraInfo] = Field(description="Loras to apply on model loading")
|
||||
seamless_axes: List[str] = Field(default_factory=list, description='Axes("x" and "y") to which apply seamless')
|
||||
freeu_config: Optional[FreeUConfig] = Field(default=None, description="FreeU configuration")
|
||||
seamless: Optional[SeamlessSettings] = Field(default=None, description="Seamless settings applied to model")
|
||||
|
||||
|
||||
class ClipField(BaseModel):
|
||||
@@ -57,7 +50,7 @@ class ClipField(BaseModel):
|
||||
class VaeField(BaseModel):
|
||||
# TODO: better naming?
|
||||
vae: ModelInfo = Field(description="Info to load vae submodel")
|
||||
seamless: Optional[SeamlessSettings] = Field(default=None, description="Seamless settings applied to model")
|
||||
seamless_axes: List[str] = Field(default_factory=list, description='Axes("x" and "y") to which apply seamless')
|
||||
|
||||
|
||||
@invocation_output("unet_output")
|
||||
@@ -458,11 +451,6 @@ class SeamlessModeInvocation(BaseInvocation):
|
||||
)
|
||||
seamless_y: bool = InputField(default=True, input=Input.Any, description="Specify whether Y axis is seamless")
|
||||
seamless_x: bool = InputField(default=True, input=Input.Any, description="Specify whether X axis is seamless")
|
||||
skipped_layers: int = InputField(default=0, input=Input.Any, description="How much model's down layers to skip")
|
||||
skip_second_resnet: bool = InputField(
|
||||
default=True, input=Input.Any, description="Skip or not second resnet in down layers"
|
||||
)
|
||||
skip_conv2: bool = InputField(default=True, input=Input.Any, description="Skip or not conv2 in down layers")
|
||||
|
||||
def invoke(self, context: InvocationContext) -> SeamlessModeOutput:
|
||||
# Conditionally append 'x' and 'y' based on seamless_x and seamless_y
|
||||
@@ -477,19 +465,9 @@ class SeamlessModeInvocation(BaseInvocation):
|
||||
seamless_axes_list.append("y")
|
||||
|
||||
if unet is not None:
|
||||
unet.seamless = SeamlessSettings(
|
||||
axes=seamless_axes_list,
|
||||
skipped_layers=self.skipped_layers,
|
||||
skip_second_resnet=self.skip_second_resnet,
|
||||
skip_conv2=self.skip_conv2,
|
||||
)
|
||||
unet.seamless_axes = seamless_axes_list
|
||||
if vae is not None:
|
||||
vae.seamless = SeamlessSettings(
|
||||
axes=seamless_axes_list,
|
||||
skipped_layers=self.skipped_layers,
|
||||
skip_second_resnet=self.skip_second_resnet,
|
||||
skip_conv2=self.skip_conv2,
|
||||
)
|
||||
vae.seamless_axes = seamless_axes_list
|
||||
|
||||
return SeamlessModeOutput(unet=unet, vae=vae)
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
"""Init file for InvokeAI configure package."""
|
||||
|
||||
from invokeai.app.services.config.config_common import PagingArgumentParser
|
||||
|
||||
from .config_default import InvokeAIAppConfig, get_invokeai_config
|
||||
|
||||
__all__ = ["InvokeAIAppConfig", "get_invokeai_config"]
|
||||
__all__ = ["InvokeAIAppConfig", "get_invokeai_config", "PagingArgumentParser"]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import cProfile
|
||||
import time
|
||||
import traceback
|
||||
from threading import BoundedSemaphore, Event, Thread
|
||||
@@ -39,6 +40,9 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
|
||||
self.__threadLimit.acquire()
|
||||
queue_item: Optional[InvocationQueueItem] = None
|
||||
|
||||
profiler = None
|
||||
last_gesid = None
|
||||
|
||||
while not stop_event.is_set():
|
||||
try:
|
||||
queue_item = self.__invoker.services.queue.get()
|
||||
@@ -49,6 +53,21 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
|
||||
# do not hammer the queue
|
||||
time.sleep(0.5)
|
||||
continue
|
||||
|
||||
if last_gesid != queue_item.graph_execution_state_id:
|
||||
if profiler is not None:
|
||||
# I'm not sure what would cause us to get here, but if we do, we should restart the profiler for
|
||||
# the new graph_execution_state_id.
|
||||
profiler.disable()
|
||||
logger.info(f"Stopped profiler for {last_gesid}.")
|
||||
profiler = None
|
||||
last_gesid = None
|
||||
|
||||
profiler = cProfile.Profile()
|
||||
profiler.enable()
|
||||
last_gesid = queue_item.graph_execution_state_id
|
||||
logger.info(f"Started profiling {last_gesid}.")
|
||||
|
||||
try:
|
||||
graph_execution_state = self.__invoker.services.graph_execution_manager.get(
|
||||
queue_item.graph_execution_state_id
|
||||
@@ -201,6 +220,13 @@ class DefaultInvocationProcessor(InvocationProcessorABC):
|
||||
queue_id=queue_item.session_queue_id,
|
||||
graph_execution_state_id=graph_execution_state.id,
|
||||
)
|
||||
if profiler is not None:
|
||||
profiler.disable()
|
||||
dump_path = f"{last_gesid}.prof"
|
||||
profiler.dump_stats(dump_path)
|
||||
logger.info(f"Saved profile to {dump_path}.")
|
||||
profiler = None
|
||||
last_gesid = None
|
||||
|
||||
except KeyboardInterrupt:
|
||||
pass # Log something? KeyboardInterrupt is probably not going to be seen by the processor
|
||||
|
||||
@@ -169,7 +169,7 @@ class SqliteWorkflowRecordsStorage(WorkflowRecordsStorageBase):
|
||||
|
||||
self._cursor.execute(count_query, count_params)
|
||||
total = self._cursor.fetchone()[0]
|
||||
pages = int(total / per_page) + 1
|
||||
pages = total // per_page + (total % per_page > 0)
|
||||
|
||||
return PaginatedResults(
|
||||
items=workflows,
|
||||
|
||||
31
invokeai/backend/model_management/detect_baked_in_vae.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# Copyright (c) 2024 Lincoln Stein and the InvokeAI Development Team
|
||||
"""
|
||||
This module exports the function has_baked_in_sdxl_vae().
|
||||
It returns True if an SDXL checkpoint model has the original SDXL 1.0 VAE,
|
||||
which doesn't work properly in fp16 mode.
|
||||
"""
|
||||
|
||||
import hashlib
|
||||
from pathlib import Path
|
||||
|
||||
from safetensors.torch import load_file
|
||||
|
||||
SDXL_1_0_VAE_HASH = "bc40b16c3a0fa4625abdfc01c04ffc21bf3cefa6af6c7768ec61eb1f1ac0da51"
|
||||
|
||||
|
||||
def has_baked_in_sdxl_vae(checkpoint_path: Path) -> bool:
|
||||
"""Return true if the checkpoint contains a custom (non SDXL-1.0) VAE."""
|
||||
hash = _vae_hash(checkpoint_path)
|
||||
return hash != SDXL_1_0_VAE_HASH
|
||||
|
||||
|
||||
def _vae_hash(checkpoint_path: Path) -> str:
|
||||
checkpoint = load_file(checkpoint_path, device="cpu")
|
||||
vae_keys = [x for x in checkpoint.keys() if x.startswith("first_stage_model.")]
|
||||
hash = hashlib.new("sha256")
|
||||
for key in vae_keys:
|
||||
value = checkpoint[key]
|
||||
hash.update(bytes(key, "UTF-8"))
|
||||
hash.update(bytes(str(value), "UTF-8"))
|
||||
|
||||
return hash.hexdigest()
|
||||
@@ -13,6 +13,7 @@ from safetensors.torch import load_file
|
||||
from transformers import CLIPTextModel, CLIPTokenizer
|
||||
|
||||
from invokeai.app.shared.models import FreeUConfig
|
||||
from invokeai.backend.model_management.model_load_optimizations import skip_torch_weight_init
|
||||
|
||||
from .models.lora import LoRAModel
|
||||
|
||||
@@ -211,8 +212,12 @@ class ModelPatcher:
|
||||
for i in range(ti_embedding.shape[0]):
|
||||
new_tokens_added += ti_tokenizer.add_tokens(_get_trigger(ti_name, i))
|
||||
|
||||
# modify text_encoder
|
||||
text_encoder.resize_token_embeddings(init_tokens_count + new_tokens_added, pad_to_multiple_of)
|
||||
# Modify text_encoder.
|
||||
# resize_token_embeddings(...) constructs a new torch.nn.Embedding internally. Initializing the weights of
|
||||
# this embedding is slow and unnecessary, so we wrap this step in skip_torch_weight_init() to save some
|
||||
# time.
|
||||
with skip_torch_weight_init():
|
||||
text_encoder.resize_token_embeddings(init_tokens_count + new_tokens_added, pad_to_multiple_of)
|
||||
model_embeddings = text_encoder.get_input_embeddings()
|
||||
|
||||
for ti_name, ti in ti_list:
|
||||
|
||||
@@ -370,6 +370,8 @@ class LoRACheckpointProbe(CheckpointProbeBase):
|
||||
return BaseModelType.StableDiffusion1
|
||||
elif token_vector_length == 1024:
|
||||
return BaseModelType.StableDiffusion2
|
||||
elif token_vector_length == 1280:
|
||||
return BaseModelType.StableDiffusionXL # recognizes format at https://civitai.com/models/224641
|
||||
elif token_vector_length == 2048:
|
||||
return BaseModelType.StableDiffusionXL
|
||||
else:
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
import json
|
||||
import os
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import Literal, Optional
|
||||
|
||||
from omegaconf import OmegaConf
|
||||
from pydantic import Field
|
||||
|
||||
from invokeai.app.services.config import InvokeAIAppConfig
|
||||
from invokeai.backend.model_management.detect_baked_in_vae import has_baked_in_sdxl_vae
|
||||
from invokeai.backend.util.logging import InvokeAILogger
|
||||
|
||||
from .base import (
|
||||
BaseModelType,
|
||||
DiffusersModel,
|
||||
@@ -116,14 +121,28 @@ class StableDiffusionXLModel(DiffusersModel):
|
||||
# The convert script adapted from the diffusers package uses
|
||||
# strings for the base model type. To avoid making too many
|
||||
# source code changes, we simply translate here
|
||||
if Path(output_path).exists():
|
||||
return output_path
|
||||
|
||||
if isinstance(config, cls.CheckpointConfig):
|
||||
from invokeai.backend.model_management.models.stable_diffusion import _convert_ckpt_and_cache
|
||||
|
||||
# Hack in VAE-fp16 fix - If model sdxl-vae-fp16-fix is installed,
|
||||
# then we bake it into the converted model unless there is already
|
||||
# a nonstandard VAE installed.
|
||||
kwargs = {}
|
||||
app_config = InvokeAIAppConfig.get_config()
|
||||
vae_path = app_config.models_path / "sdxl/vae/sdxl-vae-fp16-fix"
|
||||
if vae_path.exists() and not has_baked_in_sdxl_vae(Path(model_path)):
|
||||
InvokeAILogger.get_logger().warning("No baked-in VAE detected. Inserting sdxl-vae-fp16-fix.")
|
||||
kwargs["vae_path"] = vae_path
|
||||
|
||||
return _convert_ckpt_and_cache(
|
||||
version=base_model,
|
||||
model_config=config,
|
||||
output_path=output_path,
|
||||
use_safetensors=False, # corrupts sdxl models for some reason
|
||||
**kwargs,
|
||||
)
|
||||
else:
|
||||
return model_path
|
||||
|
||||
@@ -25,55 +25,71 @@ def _conv_forward_asymmetric(self, input, weight, bias):
|
||||
|
||||
|
||||
@contextmanager
|
||||
def set_seamless(
|
||||
model: Union[UNet2DConditionModel, AutoencoderKL],
|
||||
axes: List[str],
|
||||
skipped_layers: int,
|
||||
skip_second_resnet: bool,
|
||||
skip_conv2: bool,
|
||||
):
|
||||
def set_seamless(model: Union[UNet2DConditionModel, AutoencoderKL], seamless_axes: List[str]):
|
||||
try:
|
||||
to_restore = []
|
||||
|
||||
for m_name, m in model.named_modules():
|
||||
if not isinstance(m, (nn.Conv2d, nn.ConvTranspose2d)):
|
||||
continue
|
||||
|
||||
if isinstance(model, UNet2DConditionModel) and m_name.startswith("down_blocks.") and ".resnets." in m_name:
|
||||
# down_blocks.1.resnets.1.conv1
|
||||
_, block_num, _, resnet_num, submodule_name = m_name.split(".")
|
||||
block_num = int(block_num)
|
||||
resnet_num = int(resnet_num)
|
||||
|
||||
# if block_num >= seamless_down_blocks:
|
||||
if block_num >= len(model.down_blocks) - skipped_layers:
|
||||
if isinstance(model, UNet2DConditionModel):
|
||||
if ".attentions." in m_name:
|
||||
continue
|
||||
|
||||
if resnet_num > 0 and skip_second_resnet:
|
||||
if ".resnets." in m_name:
|
||||
if ".conv2" in m_name:
|
||||
continue
|
||||
if ".conv_shortcut" in m_name:
|
||||
continue
|
||||
|
||||
"""
|
||||
if isinstance(model, UNet2DConditionModel):
|
||||
if False and ".upsamplers." in m_name:
|
||||
continue
|
||||
|
||||
if submodule_name == "conv2" and skip_conv2:
|
||||
if False and ".downsamplers." in m_name:
|
||||
continue
|
||||
|
||||
m.asymmetric_padding_mode = {}
|
||||
m.asymmetric_padding = {}
|
||||
m.asymmetric_padding_mode["x"] = "circular" if ("x" in axes) else "constant"
|
||||
m.asymmetric_padding["x"] = (
|
||||
m._reversed_padding_repeated_twice[0],
|
||||
m._reversed_padding_repeated_twice[1],
|
||||
0,
|
||||
0,
|
||||
)
|
||||
m.asymmetric_padding_mode["y"] = "circular" if ("y" in axes) else "constant"
|
||||
m.asymmetric_padding["y"] = (
|
||||
0,
|
||||
0,
|
||||
m._reversed_padding_repeated_twice[2],
|
||||
m._reversed_padding_repeated_twice[3],
|
||||
)
|
||||
if True and ".resnets." in m_name:
|
||||
if True and ".conv1" in m_name:
|
||||
if False and "down_blocks" in m_name:
|
||||
continue
|
||||
if False and "mid_block" in m_name:
|
||||
continue
|
||||
if False and "up_blocks" in m_name:
|
||||
continue
|
||||
|
||||
to_restore.append((m, m._conv_forward))
|
||||
m._conv_forward = _conv_forward_asymmetric.__get__(m, nn.Conv2d)
|
||||
if True and ".conv2" in m_name:
|
||||
continue
|
||||
|
||||
if True and ".conv_shortcut" in m_name:
|
||||
continue
|
||||
|
||||
if True and ".attentions." in m_name:
|
||||
continue
|
||||
|
||||
if False and m_name in ["conv_in", "conv_out"]:
|
||||
continue
|
||||
"""
|
||||
|
||||
if isinstance(m, (nn.Conv2d, nn.ConvTranspose2d)):
|
||||
m.asymmetric_padding_mode = {}
|
||||
m.asymmetric_padding = {}
|
||||
m.asymmetric_padding_mode["x"] = "circular" if ("x" in seamless_axes) else "constant"
|
||||
m.asymmetric_padding["x"] = (
|
||||
m._reversed_padding_repeated_twice[0],
|
||||
m._reversed_padding_repeated_twice[1],
|
||||
0,
|
||||
0,
|
||||
)
|
||||
m.asymmetric_padding_mode["y"] = "circular" if ("y" in seamless_axes) else "constant"
|
||||
m.asymmetric_padding["y"] = (
|
||||
0,
|
||||
0,
|
||||
m._reversed_padding_repeated_twice[2],
|
||||
m._reversed_padding_repeated_twice[3],
|
||||
)
|
||||
|
||||
to_restore.append((m, m._conv_forward))
|
||||
m._conv_forward = _conv_forward_asymmetric.__get__(m, nn.Conv2d)
|
||||
|
||||
yield
|
||||
|
||||
|
||||
1
invokeai/frontend/web/.gitignore
vendored
@@ -8,6 +8,7 @@ pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
.pnpm-store
|
||||
# We want to distribute the repo
|
||||
dist
|
||||
dist/**
|
||||
|
||||
|
Before Width: | Height: | Size: 116 KiB |
@@ -7,9 +7,8 @@
|
||||
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
|
||||
<meta http-equiv="Pragma" content="no-cache">
|
||||
<meta http-equiv="Expires" content="0">
|
||||
<title>InvokeAI - A Stable Diffusion Toolkit</title>
|
||||
<link rel="mask-icon" href="/invoke-key-ylw-sm.svg" color="#E6FD13" sizes="any" />
|
||||
<link rel="icon" href="/invoke-key-char-on-ylw.svg" />
|
||||
<title>Invoke - Community Edition</title>
|
||||
<link rel="icon" type="icon" href="assets/images/invoke-favicon.svg" />
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
|
||||
@@ -73,10 +73,11 @@
|
||||
"chakra-react-select": "^4.7.6",
|
||||
"compare-versions": "^6.1.0",
|
||||
"dateformat": "^5.0.3",
|
||||
"framer-motion": "^10.16.16",
|
||||
"i18next": "^23.7.13",
|
||||
"framer-motion": "^10.17.9",
|
||||
"i18next": "^23.7.16",
|
||||
"i18next-http-backend": "^2.4.2",
|
||||
"idb-keyval": "^6.2.1",
|
||||
"jsondiffpatch": "^0.6.0",
|
||||
"konva": "^9.3.0",
|
||||
"lodash-es": "^4.17.21",
|
||||
"nanostores": "^0.9.5",
|
||||
@@ -90,22 +91,22 @@
|
||||
"react-dropzone": "^14.2.3",
|
||||
"react-error-boundary": "^4.0.12",
|
||||
"react-hook-form": "^7.49.2",
|
||||
"react-hotkeys-hook": "4.4.1",
|
||||
"react-hotkeys-hook": "4.4.3",
|
||||
"react-i18next": "^14.0.0",
|
||||
"react-icons": "^4.12.0",
|
||||
"react-konva": "^18.2.10",
|
||||
"react-redux": "9.0.4",
|
||||
"react-resizable-panels": "^1.0.7",
|
||||
"react-resizable-panels": "^1.0.8",
|
||||
"react-select": "5.8.0",
|
||||
"react-textarea-autosize": "^8.5.3",
|
||||
"react-use": "^17.4.2",
|
||||
"react-virtuoso": "^4.6.2",
|
||||
"reactflow": "^11.10.1",
|
||||
"redux-dynamic-middlewares": "^2.2.0",
|
||||
"redux-remember": "^5.0.1",
|
||||
"redux-remember": "^5.1.0",
|
||||
"roarr": "^7.21.0",
|
||||
"serialize-error": "^11.0.3",
|
||||
"socket.io-client": "^4.7.2",
|
||||
"socket.io-client": "^4.7.3",
|
||||
"type-fest": "^4.9.0",
|
||||
"use-debounce": "^10.0.0",
|
||||
"use-image": "^1.1.1",
|
||||
@@ -121,27 +122,27 @@
|
||||
"ts-toolbelt": "^9.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@arthurgeron/eslint-plugin-react-usememo": "^2.2.2",
|
||||
"@arthurgeron/eslint-plugin-react-usememo": "^2.2.3",
|
||||
"@chakra-ui/cli": "^2.4.1",
|
||||
"@storybook/addon-docs": "^7.6.6",
|
||||
"@storybook/addon-essentials": "^7.6.6",
|
||||
"@storybook/addon-interactions": "^7.6.6",
|
||||
"@storybook/addon-links": "^7.6.6",
|
||||
"@storybook/addon-storysource": "^7.6.6",
|
||||
"@storybook/blocks": "^7.6.6",
|
||||
"@storybook/manager-api": "^7.6.6",
|
||||
"@storybook/react": "^7.6.6",
|
||||
"@storybook/react-vite": "^7.6.6",
|
||||
"@storybook/test": "^7.6.6",
|
||||
"@storybook/theming": "^7.6.6",
|
||||
"@storybook/addon-docs": "^7.6.7",
|
||||
"@storybook/addon-essentials": "^7.6.7",
|
||||
"@storybook/addon-interactions": "^7.6.7",
|
||||
"@storybook/addon-links": "^7.6.7",
|
||||
"@storybook/addon-storysource": "^7.6.7",
|
||||
"@storybook/blocks": "^7.6.7",
|
||||
"@storybook/manager-api": "^7.6.7",
|
||||
"@storybook/react": "^7.6.7",
|
||||
"@storybook/react-vite": "^7.6.7",
|
||||
"@storybook/test": "^7.6.7",
|
||||
"@storybook/theming": "^7.6.7",
|
||||
"@types/dateformat": "^5.0.2",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"@types/node": "^20.10.6",
|
||||
"@types/react": "^18.2.46",
|
||||
"@types/node": "^20.10.7",
|
||||
"@types/react": "^18.2.47",
|
||||
"@types/react-dom": "^18.2.18",
|
||||
"@types/uuid": "^9.0.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.16.0",
|
||||
"@typescript-eslint/parser": "^6.16.0",
|
||||
"@typescript-eslint/eslint-plugin": "^6.18.0",
|
||||
"@typescript-eslint/parser": "^6.18.0",
|
||||
"@vitejs/plugin-react-swc": "^3.5.0",
|
||||
"concurrently": "^8.2.2",
|
||||
"eslint": "^8.56.0",
|
||||
@@ -159,10 +160,10 @@
|
||||
"openapi-typescript": "^6.7.3",
|
||||
"prettier": "^3.1.1",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"storybook": "^7.6.6",
|
||||
"storybook": "^7.6.7",
|
||||
"ts-toolbelt": "^9.6.0",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.0.10",
|
||||
"vite": "^5.0.11",
|
||||
"vite-plugin-css-injected-by-js": "^3.3.1",
|
||||
"vite-plugin-dts": "^3.7.0",
|
||||
"vite-plugin-eslint": "^1.8.1",
|
||||
|
||||
2226
invokeai/frontend/web/pnpm-lock.yaml
generated
4
invokeai/frontend/web/public/assets/images/invoke-avatar-circle.svg
Executable file
@@ -0,0 +1,4 @@
|
||||
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="100" height="100" rx="50" fill="#E6FD13"/>
|
||||
<path d="M55.8887 40.7241H66.369V33.6309H33.6309V40.7241H44.1111L55.8887 59.2757H66.369V66.369H33.6309V59.2757H44.1111" stroke="#181818" stroke-width="2.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 321 B |
4
invokeai/frontend/web/public/assets/images/invoke-avatar-square.svg
Executable file
@@ -0,0 +1,4 @@
|
||||
<svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="100" height="100" fill="#E6FD13"/>
|
||||
<path d="M55.8887 40.7241H66.369V33.6309H33.6309V40.7241H44.1111L55.8887 59.2757H66.369V66.369H33.6309V59.2757H44.1111" stroke="#181818" stroke-width="2.5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 313 B |
BIN
invokeai/frontend/web/public/assets/images/invoke-favicon.png
Executable file
|
After Width: | Height: | Size: 947 B |
4
invokeai/frontend/web/public/assets/images/invoke-favicon.svg
Executable file
@@ -0,0 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="16" height="16" rx="2" fill="#E6FD13"/>
|
||||
<path d="M9.61889 5.45H12.5V3.5H3.5V5.45H6.38111L9.61889 10.55H12.5V12.5H3.5V10.55H6.38111" stroke="black"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 265 B |
4
invokeai/frontend/web/public/assets/images/invoke-key-char-lrg.svg
Executable file
@@ -0,0 +1,4 @@
|
||||
<svg width="106" height="106" viewBox="0 0 106 106" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="3" y="3" width="100" height="100" rx="6.66667" stroke="#181818" stroke-width="5"/>
|
||||
<path d="M63.9137 36H83.1211V23H23.1211V36H42.3285L63.9137 70H83.1211V83H23.1211V70H42.3285" stroke="#181818" stroke-width="5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 328 B |
4
invokeai/frontend/web/public/assets/images/invoke-key-char-sml.svg
Executable file
@@ -0,0 +1,4 @@
|
||||
<svg width="42" height="42" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="1" y="1" width="40" height="40" rx="4" stroke="#181818" stroke-width="2"/>
|
||||
<path d="M25.3659 14.2H33.0488V9H9.04883V14.2H16.7318L25.3659 27.8H33.0488V33H9.04883V27.8H16.7318" stroke="#181818" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
4
invokeai/frontend/web/public/assets/images/invoke-key-wht-sml.svg
Executable file
@@ -0,0 +1,4 @@
|
||||
<svg width="42" height="42" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect x="1" y="1" width="40" height="40" rx="4" stroke="white" stroke-width="2"/>
|
||||
<path d="M25.3659 14.2H33.0488V9H9.04883V14.2H16.7318L25.3659 27.8H33.0488V33H9.04883V27.8H16.7318" stroke="white" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 319 B |
3
invokeai/frontend/web/public/assets/images/invoke-symbol-char-lrg.svg
Executable file
@@ -0,0 +1,3 @@
|
||||
<svg width="66" height="66" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M43.9137 16H63.1211V3H3.12109V16H22.3285L43.9137 50H63.1211V63H3.12109V50H22.3285" stroke="#181818" stroke-width="5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 231 B |
3
invokeai/frontend/web/public/assets/images/invoke-symbol-char-sml.svg
Executable file
@@ -0,0 +1,3 @@
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.5975 5.33333H21V1H1V5.33333H7.40246L14.5975 16.6667H21V21H1V16.6667H7.40246" stroke="#181818" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 229 B |
3
invokeai/frontend/web/public/assets/images/invoke-symbol-wht-lrg.svg
Executable file
@@ -0,0 +1,3 @@
|
||||
<svg width="66" height="66" viewBox="0 0 66 66" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M43.9137 16H63.1211V3H3.12109V16H22.3285L43.9137 50H63.1211V63H3.12109V50H22.3285" stroke="white" stroke-width="5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 229 B |
3
invokeai/frontend/web/public/assets/images/invoke-symbol-wht-sml.svg
Executable file
@@ -0,0 +1,3 @@
|
||||
<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.5975 5.33333H21V1H1V5.33333H7.40246L14.5975 16.6667H21V21H1V16.6667H7.40246" stroke="white" stroke-width="2"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 227 B |
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
@@ -0,0 +1,13 @@
|
||||
<svg width="231" height="100" viewBox="0 0 231 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_659_3591)">
|
||||
<rect width="100" height="100" fill="#181818"/>
|
||||
<path d="M57.1951 38.6667H70V30H30V38.6667H42.8049L57.1951 61.3333H70V70H30V61.3333H42.8049" stroke="white" stroke-width="2.8"/>
|
||||
<rect width="131" height="100" transform="translate(100)" fill="#181818"/>
|
||||
<path d="M111.37 43.34H107.89V39.65H111.37V43.34ZM116.38 60.5H102.76V58.16H108.22V47.84H103.36V45.5H111.07V58.16H116.38V60.5ZM120.538 60.5V45.5H123.388V47.6C124.288 46.25 125.788 45.2 128.188 45.2C131.638 45.2 133.588 47.3 133.588 50.45V60.5H130.738V51.05C130.738 48.95 129.838 47.6 127.708 47.6H127.468C125.338 47.6 123.388 49.25 123.388 52.1V60.5H120.538ZM141.786 60.5L136.236 45.5H139.176L143.526 57.71L147.876 45.5H150.786L145.236 60.5H141.786ZM159.723 60.8C155.673 60.8 152.523 57.65 152.523 53C152.523 48.35 155.673 45.2 159.723 45.2C163.773 45.2 166.923 48.35 166.923 53C166.923 57.65 163.773 60.8 159.723 60.8ZM155.373 53C155.373 56.45 157.173 58.4 159.603 58.4H159.843C162.273 58.4 164.073 56.45 164.073 53C164.073 49.55 162.273 47.6 159.843 47.6H159.603C157.173 47.6 155.373 49.55 155.373 53ZM170.804 60.5V39.5H173.654V51.98L180.254 45.5H184.004L177.764 51.47L184.304 60.5H180.794L175.724 53.42L173.654 55.43V60.5H170.804ZM192.459 60.8C188.739 60.8 185.379 58.22 185.379 52.97C185.379 47.78 188.829 45.2 192.369 45.2C196.269 45.2 198.729 47.9 198.729 51.8V53.45H188.229C188.409 56.87 190.599 58.4 192.429 58.4H192.669C194.139 58.4 195.549 57.65 195.849 56.06H198.699C198.159 59.09 195.549 60.8 192.459 60.8ZM188.409 51.2H195.879C195.759 48.59 194.199 47.6 192.489 47.6H192.249C190.689 47.6 188.949 48.53 188.409 51.2Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_659_3591">
|
||||
<rect width="231" height="100" rx="5" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,13 @@
|
||||
<svg width="116" height="50" viewBox="0 0 116 50" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_659_3586)">
|
||||
<rect width="50" height="50" fill="#181818"/>
|
||||
<path d="M28.5975 19.3333H35V15H15V19.3333H21.4025L28.5975 30.6667H35V35H15V30.6667H21.4025" stroke="white" stroke-width="1.2"/>
|
||||
<rect width="66" height="50" transform="translate(50)" fill="#181818"/>
|
||||
<path d="M55.685 21.92H53.945V20.075H55.685V21.92ZM58.19 30.5H51.38V29.33H54.11V24.17H51.68V23H55.535V29.33H58.19V30.5ZM60.2691 30.5V23H61.6941V24.05C62.1441 23.375 62.8941 22.85 64.0941 22.85C65.8191 22.85 66.7941 23.9 66.7941 25.475V30.5H65.3691V25.775C65.3691 24.725 64.9191 24.05 63.8541 24.05H63.7341C62.6691 24.05 61.6941 24.875 61.6941 26.3V30.5H60.2691ZM70.8931 30.5L68.1181 23H69.5881L71.7631 29.105L73.9381 23H75.3931L72.6181 30.5H70.8931ZM79.8614 30.65C77.8364 30.65 76.2614 29.075 76.2614 26.75C76.2614 24.425 77.8364 22.85 79.8614 22.85C81.8864 22.85 83.4614 24.425 83.4614 26.75C83.4614 29.075 81.8864 30.65 79.8614 30.65ZM77.6864 26.75C77.6864 28.475 78.5864 29.45 79.8014 29.45H79.9214C81.1364 29.45 82.0364 28.475 82.0364 26.75C82.0364 25.025 81.1364 24.05 79.9214 24.05H79.8014C78.5864 24.05 77.6864 25.025 77.6864 26.75ZM85.4018 30.5V20H86.8268V26.24L90.1268 23H92.0018L88.8818 25.985L92.1518 30.5H90.3968L87.8618 26.96L86.8268 27.965V30.5H85.4018ZM96.2296 30.65C94.3696 30.65 92.6896 29.36 92.6896 26.735C92.6896 24.14 94.4146 22.85 96.1846 22.85C98.1346 22.85 99.3646 24.2 99.3646 26.15V26.975H94.1146C94.2046 28.685 95.2996 29.45 96.2146 29.45H96.3346C97.0696 29.45 97.7746 29.075 97.9246 28.28H99.3496C99.0796 29.795 97.7746 30.65 96.2296 30.65ZM94.2046 25.85H97.9396C97.8796 24.545 97.0996 24.05 96.2446 24.05H96.1246C95.3446 24.05 94.4746 24.515 94.2046 25.85Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_659_3586">
|
||||
<rect width="116" height="50" rx="4" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,13 @@
|
||||
<svg width="231" height="100" viewBox="0 0 231 100" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_659_3578)">
|
||||
<rect width="100" height="100" fill="#E6FD13"/>
|
||||
<path d="M57.1951 38.6667H70V30H30V38.6667H42.8049L57.1951 61.3333H70V70H30V61.3333H42.8049" stroke="#181818" stroke-width="2.8"/>
|
||||
<rect width="131" height="100" transform="translate(100)" fill="#E6FD13"/>
|
||||
<path d="M111.37 43.34H107.89V39.65H111.37V43.34ZM116.38 60.5H102.76V58.16H108.22V47.84H103.36V45.5H111.07V58.16H116.38V60.5ZM120.538 60.5V45.5H123.388V47.6C124.288 46.25 125.788 45.2 128.188 45.2C131.638 45.2 133.588 47.3 133.588 50.45V60.5H130.738V51.05C130.738 48.95 129.838 47.6 127.708 47.6H127.468C125.338 47.6 123.388 49.25 123.388 52.1V60.5H120.538ZM141.786 60.5L136.236 45.5H139.176L143.526 57.71L147.876 45.5H150.786L145.236 60.5H141.786ZM159.723 60.8C155.673 60.8 152.523 57.65 152.523 53C152.523 48.35 155.673 45.2 159.723 45.2C163.773 45.2 166.923 48.35 166.923 53C166.923 57.65 163.773 60.8 159.723 60.8ZM155.373 53C155.373 56.45 157.173 58.4 159.603 58.4H159.843C162.273 58.4 164.073 56.45 164.073 53C164.073 49.55 162.273 47.6 159.843 47.6H159.603C157.173 47.6 155.373 49.55 155.373 53ZM170.804 60.5V39.5H173.654V51.98L180.254 45.5H184.004L177.764 51.47L184.304 60.5H180.794L175.724 53.42L173.654 55.43V60.5H170.804ZM192.459 60.8C188.739 60.8 185.379 58.22 185.379 52.97C185.379 47.78 188.829 45.2 192.369 45.2C196.269 45.2 198.729 47.9 198.729 51.8V53.45H188.229C188.409 56.87 190.599 58.4 192.429 58.4H192.669C194.139 58.4 195.549 57.65 195.849 56.06H198.699C198.159 59.09 195.549 60.8 192.459 60.8ZM188.409 51.2H195.879C195.759 48.59 194.199 47.6 192.489 47.6H192.249C190.689 47.6 188.949 48.53 188.409 51.2Z" fill="#181818"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_659_3578">
|
||||
<rect width="231" height="100" rx="5" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,13 @@
|
||||
<svg width="116" height="50" viewBox="0 0 116 50" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_659_3573)">
|
||||
<rect width="50" height="50" fill="#E6FD13"/>
|
||||
<path d="M28.5975 19.3333H35V15H15V19.3333H21.4025L28.5975 30.6667H35V35H15V30.6667H21.4025" stroke="#181818" stroke-width="1.2"/>
|
||||
<rect width="66" height="50" transform="translate(50)" fill="#E6FD13"/>
|
||||
<path d="M55.685 21.92H53.945V20.075H55.685V21.92ZM58.19 30.5H51.38V29.33H54.11V24.17H51.68V23H55.535V29.33H58.19V30.5ZM60.2691 30.5V23H61.6941V24.05C62.1441 23.375 62.8941 22.85 64.0941 22.85C65.8191 22.85 66.7941 23.9 66.7941 25.475V30.5H65.3691V25.775C65.3691 24.725 64.9191 24.05 63.8541 24.05H63.7341C62.6691 24.05 61.6941 24.875 61.6941 26.3V30.5H60.2691ZM70.8931 30.5L68.1181 23H69.5881L71.7631 29.105L73.9381 23H75.3931L72.6181 30.5H70.8931ZM79.8614 30.65C77.8364 30.65 76.2614 29.075 76.2614 26.75C76.2614 24.425 77.8364 22.85 79.8614 22.85C81.8864 22.85 83.4614 24.425 83.4614 26.75C83.4614 29.075 81.8864 30.65 79.8614 30.65ZM77.6864 26.75C77.6864 28.475 78.5864 29.45 79.8014 29.45H79.9214C81.1364 29.45 82.0364 28.475 82.0364 26.75C82.0364 25.025 81.1364 24.05 79.9214 24.05H79.8014C78.5864 24.05 77.6864 25.025 77.6864 26.75ZM85.4018 30.5V20H86.8268V26.24L90.1268 23H92.0018L88.8818 25.985L92.1518 30.5H90.3968L87.8618 26.96L86.8268 27.965V30.5H85.4018ZM96.2296 30.65C94.3696 30.65 92.6896 29.36 92.6896 26.735C92.6896 24.14 94.4146 22.85 96.1846 22.85C98.1346 22.85 99.3646 24.2 99.3646 26.15V26.975H94.1146C94.2046 28.685 95.2996 29.45 96.2146 29.45H96.3346C97.0696 29.45 97.7746 29.075 97.9246 28.28H99.3496C99.0796 29.795 97.7746 30.65 96.2296 30.65ZM94.2046 25.85H97.9396C97.8796 24.545 97.0996 24.05 96.2446 24.05H96.1246C95.3446 24.05 94.4746 24.515 94.2046 25.85Z" fill="#181818"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_659_3573">
|
||||
<rect width="116" height="50" rx="4" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -0,0 +1,8 @@
|
||||
<svg width="293" height="65" viewBox="0 0 293 65" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M273.51 65.0002C269.604 65.0002 266.003 64.1152 262.707 62.3453C259.472 60.5143 256.848 57.7983 254.834 54.1974C252.881 50.5964 251.904 46.2326 251.904 41.1058C251.904 36.0401 252.881 31.7373 254.834 28.1974C256.848 24.5964 259.472 21.911 262.707 20.141C266.003 18.31 269.512 17.3945 273.235 17.3945C277.142 17.3945 280.559 18.249 283.489 19.9579C286.419 21.6058 288.677 23.9556 290.264 27.0072C291.851 30.0589 292.644 33.5683 292.644 37.5354V42.5706H260.602C260.785 45.8664 261.517 48.6434 262.799 50.9016C264.08 53.1598 265.667 54.8688 267.559 56.0284C269.512 57.127 271.465 57.6763 273.419 57.6763H274.151C276.531 57.6763 278.637 57.0659 280.468 55.8453C282.299 54.6246 283.428 52.8547 283.855 50.5354H292.553C291.759 55.0518 289.592 58.5918 286.052 61.1551C282.513 63.7185 278.332 65.0002 273.51 65.0002ZM283.947 35.7044C283.764 31.9814 282.696 29.2349 280.743 27.465C278.851 25.634 276.47 24.7185 273.602 24.7185H272.869C270.184 24.7185 267.742 25.6035 265.545 27.3734C263.409 29.1434 261.944 31.9204 261.151 35.7044H283.947Z" fill="#181818"/>
|
||||
<path d="M205.254 0H213.951V38.0846L234.092 18.3099H245.536L226.494 36.5282L246.451 64.0846H235.74L220.268 42.4789L213.951 48.6127V64.0846H205.254V0Z" fill="#181818"/>
|
||||
<path d="M173.507 65.0002C169.418 65.0002 165.695 63.9932 162.338 61.9791C158.981 59.965 156.326 57.1575 154.373 53.5565C152.481 49.9556 151.535 45.8359 151.535 41.1974C151.535 36.5589 152.481 32.4391 154.373 28.8382C156.326 25.2373 158.981 22.4297 162.338 20.4157C165.695 18.4016 169.418 17.3945 173.507 17.3945C177.596 17.3945 181.319 18.4016 184.676 20.4157C188.033 22.4297 190.658 25.2373 192.55 28.8382C194.503 32.4391 195.479 36.5589 195.479 41.1974C195.479 45.8359 194.503 49.9556 192.55 53.5565C190.658 57.1575 188.033 59.965 184.676 61.9791C181.319 63.9932 177.596 65.0002 173.507 65.0002ZM173.873 57.6763C177.657 57.6763 180.74 56.2115 183.12 53.2819C185.561 50.3523 186.782 46.3241 186.782 41.1974C186.782 36.0706 185.561 32.0424 183.12 29.1129C180.74 26.1833 177.657 24.7185 173.873 24.7185H173.141C169.357 24.7185 166.244 26.1833 163.803 29.1129C161.423 32.0424 160.232 36.0706 160.232 41.1974C160.232 46.3241 161.423 50.3523 163.803 53.2819C166.244 56.2115 169.357 57.6763 173.141 57.6763H173.873Z" fill="#181818"/>
|
||||
<path d="M146.078 18.3096L129.141 64.0843H118.613L101.676 18.3096H110.648L123.922 55.5702L137.197 18.3096H146.078Z" fill="#181818"/>
|
||||
<path d="M53.9727 18.31H62.6699V24.7185C65.9047 19.8358 70.7873 17.3945 77.3179 17.3945C82.5057 17.3945 86.5339 18.8593 89.4025 21.7889C92.3321 24.6575 93.7969 28.533 93.7969 33.4157V64.0847H85.0997V35.2467C85.0997 31.8899 84.3368 29.296 82.8109 27.465C81.3461 25.634 79.0268 24.7185 75.8531 24.7185H75.1207C72.9235 24.7185 70.8789 25.2678 68.9869 26.3664C67.0948 27.465 65.569 29.0518 64.4094 31.1269C63.2497 33.2021 62.6699 35.6434 62.6699 38.4509V64.0847H53.9727V18.31Z" fill="#181818"/>
|
||||
<path d="M15.732 0.144531H26.4041V11.4605H15.732V0.144531ZM0 56.9086H16.744V25.2606H1.84V18.0846H25.4841V56.9086H41.7681V64.0846H0V56.9086Z" fill="#181818"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,8 @@
|
||||
<svg width="293" height="65" viewBox="0 0 293 65" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M273.51 65.0002C269.604 65.0002 266.003 64.1152 262.707 62.3453C259.472 60.5143 256.848 57.7983 254.834 54.1974C252.881 50.5964 251.904 46.2326 251.904 41.1058C251.904 36.0401 252.881 31.7373 254.834 28.1974C256.848 24.5964 259.472 21.911 262.707 20.141C266.003 18.31 269.512 17.3945 273.235 17.3945C277.142 17.3945 280.559 18.249 283.489 19.9579C286.419 21.6058 288.677 23.9556 290.264 27.0072C291.851 30.0589 292.644 33.5683 292.644 37.5354V42.5706H260.602C260.785 45.8664 261.517 48.6434 262.799 50.9016C264.08 53.1598 265.667 54.8688 267.559 56.0284C269.512 57.127 271.465 57.6763 273.419 57.6763H274.151C276.531 57.6763 278.637 57.0659 280.468 55.8453C282.299 54.6246 283.428 52.8547 283.855 50.5354H292.553C291.759 55.0518 289.592 58.5918 286.052 61.1551C282.513 63.7185 278.332 65.0002 273.51 65.0002ZM283.947 35.7044C283.764 31.9814 282.696 29.2349 280.743 27.465C278.851 25.634 276.47 24.7185 273.602 24.7185H272.869C270.184 24.7185 267.742 25.6035 265.545 27.3734C263.409 29.1434 261.944 31.9204 261.151 35.7044H283.947Z" fill="white"/>
|
||||
<path d="M205.254 0H213.951V38.0846L234.092 18.3099H245.536L226.494 36.5282L246.451 64.0846H235.74L220.268 42.4789L213.951 48.6127V64.0846H205.254V0Z" fill="white"/>
|
||||
<path d="M173.507 65.0002C169.418 65.0002 165.695 63.9932 162.338 61.9791C158.981 59.965 156.326 57.1575 154.373 53.5565C152.481 49.9556 151.535 45.8359 151.535 41.1974C151.535 36.5589 152.481 32.4391 154.373 28.8382C156.326 25.2373 158.981 22.4297 162.338 20.4157C165.695 18.4016 169.418 17.3945 173.507 17.3945C177.596 17.3945 181.319 18.4016 184.676 20.4157C188.033 22.4297 190.658 25.2373 192.55 28.8382C194.503 32.4391 195.479 36.5589 195.479 41.1974C195.479 45.8359 194.503 49.9556 192.55 53.5565C190.658 57.1575 188.033 59.965 184.676 61.9791C181.319 63.9932 177.596 65.0002 173.507 65.0002ZM173.873 57.6763C177.657 57.6763 180.74 56.2115 183.12 53.2819C185.561 50.3523 186.782 46.3241 186.782 41.1974C186.782 36.0706 185.561 32.0424 183.12 29.1129C180.74 26.1833 177.657 24.7185 173.873 24.7185H173.141C169.357 24.7185 166.244 26.1833 163.803 29.1129C161.423 32.0424 160.232 36.0706 160.232 41.1974C160.232 46.3241 161.423 50.3523 163.803 53.2819C166.244 56.2115 169.357 57.6763 173.141 57.6763H173.873Z" fill="white"/>
|
||||
<path d="M146.078 18.3096L129.141 64.0843H118.613L101.676 18.3096H110.648L123.922 55.5702L137.197 18.3096H146.078Z" fill="white"/>
|
||||
<path d="M53.9727 18.31H62.6699V24.7185C65.9047 19.8358 70.7873 17.3945 77.3179 17.3945C82.5057 17.3945 86.5339 18.8593 89.4025 21.7889C92.3321 24.6575 93.7969 28.533 93.7969 33.4157V64.0847H85.0997V35.2467C85.0997 31.8899 84.3368 29.296 82.8109 27.465C81.3461 25.634 79.0268 24.7185 75.8531 24.7185H75.1207C72.9235 24.7185 70.8789 25.2678 68.9869 26.3664C67.0948 27.465 65.569 29.0518 64.4094 31.1269C63.2497 33.2021 62.6699 35.6434 62.6699 38.4509V64.0847H53.9727V18.31Z" fill="white"/>
|
||||
<path d="M15.732 0.144531H26.4041V11.4605H15.732V0.144531ZM0 56.9086H16.744V25.2606H1.84V18.0846H25.4841V56.9086H41.7681V64.0846H0V56.9086Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
@@ -1,4 +0,0 @@
|
||||
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="32" height="32" rx="6" fill="#E6FD13"/>
|
||||
<path d="M19.2378 10.9H25V7H7V10.9H12.7622L19.2378 21.1H25V25H7V21.1H12.7622" stroke="#181818" stroke-width="1.5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 272 B |
40
invokeai/frontend/web/public/locales/hu.json
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"accessibility": {
|
||||
"mode": "Mód",
|
||||
"uploadImage": "Fénykép feltöltése",
|
||||
"zoomIn": "Nagyítás",
|
||||
"nextImage": "Következő kép",
|
||||
"previousImage": "Előző kép",
|
||||
"menu": "Menü",
|
||||
"zoomOut": "Kicsinyítés",
|
||||
"loadMore": "Több betöltése"
|
||||
},
|
||||
"boards": {
|
||||
"cancel": "Mégsem",
|
||||
"loading": "Betöltés..."
|
||||
},
|
||||
"accordions": {
|
||||
"image": {
|
||||
"title": "Kép"
|
||||
}
|
||||
},
|
||||
"common": {
|
||||
"accept": "Elfogad",
|
||||
"ai": "ai",
|
||||
"back": "Vissza",
|
||||
"cancel": "Mégsem",
|
||||
"close": "Bezár",
|
||||
"or": "vagy",
|
||||
"details": "Részletek",
|
||||
"darkMode": "Sötét Mód",
|
||||
"error": "Hiba",
|
||||
"file": "Fájl",
|
||||
"githubLabel": "Github",
|
||||
"hotkeysLabel": "Gyorsbillentyűk",
|
||||
"delete": "Törlés",
|
||||
"data": "Adat",
|
||||
"discordLabel": "Discord",
|
||||
"folder": "Mappa",
|
||||
"langEnglish": "Angol"
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,9 @@
|
||||
"unsaved": "Non salvato",
|
||||
"direction": "Direzione",
|
||||
"advancedOptions": "Opzioni avanzate",
|
||||
"free": "Libero"
|
||||
"free": "Libero",
|
||||
"or": "o",
|
||||
"preferencesLabel": "Preferenze"
|
||||
},
|
||||
"gallery": {
|
||||
"generations": "Generazioni",
|
||||
|
||||
@@ -121,7 +121,11 @@
|
||||
"unsaved": "несохраненный",
|
||||
"input": "Вход",
|
||||
"details": "Детали",
|
||||
"notInstalled": "Нет $t(common.installed)"
|
||||
"notInstalled": "Нет $t(common.installed)",
|
||||
"preferencesLabel": "Предпочтения",
|
||||
"or": "или",
|
||||
"advancedOptions": "Расширенные настройки",
|
||||
"free": "Свободно"
|
||||
},
|
||||
"gallery": {
|
||||
"generations": "Генерации",
|
||||
@@ -365,7 +369,22 @@
|
||||
"desc": "Открывает меню добавления узла",
|
||||
"title": "Добавление узлов"
|
||||
},
|
||||
"nodesHotkeys": "Горячие клавиши узлов"
|
||||
"nodesHotkeys": "Горячие клавиши узлов",
|
||||
"cancelAndClear": {
|
||||
"desc": "Отмена текущего элемента очереди и очистка всех ожидающих элементов",
|
||||
"title": "Отменить и очистить"
|
||||
},
|
||||
"resetOptionsAndGallery": {
|
||||
"title": "Сброс настроек и галереи",
|
||||
"desc": "Сброс панелей галереи и настроек"
|
||||
},
|
||||
"searchHotkeys": "Поиск горячих клавиш",
|
||||
"noHotkeysFound": "Горячие клавиши не найдены",
|
||||
"toggleOptionsAndGallery": {
|
||||
"desc": "Открытие и закрытие панели опций и галереи",
|
||||
"title": "Переключить опции и галерею"
|
||||
},
|
||||
"clearSearch": "Очистить поиск"
|
||||
},
|
||||
"modelManager": {
|
||||
"modelManager": "Менеджер моделей",
|
||||
@@ -615,7 +634,8 @@
|
||||
"missingNodeTemplate": "Отсутствует шаблон узла",
|
||||
"readyToInvoke": "Готово к вызову",
|
||||
"missingFieldTemplate": "Отсутствует шаблон поля",
|
||||
"addingImagesTo": "Добавление изображений в"
|
||||
"addingImagesTo": "Добавление изображений в",
|
||||
"invoke": "Создать"
|
||||
},
|
||||
"seamlessX&Y": "Бесшовный X & Y",
|
||||
"isAllowedToUpscale": {
|
||||
@@ -643,7 +663,14 @@
|
||||
"useSize": "Использовать размер",
|
||||
"unmasked": "Без маски",
|
||||
"enableNoiseSettings": "Включить настройки шума",
|
||||
"coherenceMode": "Режим"
|
||||
"coherenceMode": "Режим",
|
||||
"aspect": "Соотношение",
|
||||
"imageSize": "Размер изображения",
|
||||
"swapDimensions": "Поменять местами",
|
||||
"setToOptimalSize": "Установить оптимальный для модели размер",
|
||||
"setToOptimalSizeTooSmall": "$t(parameters.setToOptimalSize) (может быть слишком маленьким)",
|
||||
"setToOptimalSizeTooLarge": "$t(parameters.setToOptimalSize) (может быть слишком большим)",
|
||||
"lockAspectRatio": "Заблокировать соотношение"
|
||||
},
|
||||
"settings": {
|
||||
"models": "Модели",
|
||||
@@ -1188,7 +1215,8 @@
|
||||
"handAndFace": "Руки и Лицо",
|
||||
"enableIPAdapter": "Включить IP Adapter",
|
||||
"maxFaces": "Макс Лица",
|
||||
"mlsdDescription": "Минималистичный детектор отрезков линии"
|
||||
"mlsdDescription": "Минималистичный детектор отрезков линии",
|
||||
"resizeSimple": "Изменить размер (простой)"
|
||||
},
|
||||
"boards": {
|
||||
"autoAddBoard": "Авто добавление Доски",
|
||||
@@ -1230,7 +1258,9 @@
|
||||
"promptsWithCount_one": "{{count}} Запрос",
|
||||
"promptsWithCount_few": "{{count}} Запроса",
|
||||
"promptsWithCount_many": "{{count}} Запросов",
|
||||
"dynamicPrompts": "Динамические запросы"
|
||||
"dynamicPrompts": "Динамические запросы",
|
||||
"loading": "Создание динамических запросов...",
|
||||
"showDynamicPrompts": "Показать динамические запросы"
|
||||
},
|
||||
"popovers": {
|
||||
"noiseUseCPU": {
|
||||
@@ -1493,7 +1523,7 @@
|
||||
"queueBack": "Добавить в очередь",
|
||||
"batchValues": "Пакетные значения",
|
||||
"cancelFailed": "Проблема с отменой элемента",
|
||||
"queueCountPrediction": "Добавить {{predicted}} в очередь",
|
||||
"queueCountPrediction": "{{promptsCount}} запросов × {{iterations}} изображений -> {{count}} генераций",
|
||||
"batchQueued": "Пакетная очередь",
|
||||
"pauseFailed": "Проблема с приостановкой рендеринга",
|
||||
"clearFailed": "Проблема с очисткой очереди",
|
||||
@@ -1540,7 +1570,8 @@
|
||||
"cancelBatchFailed": "Проблема с отменой пакета",
|
||||
"clearQueueAlertDialog2": "Вы уверены, что хотите очистить очередь?",
|
||||
"item": "Элемент",
|
||||
"graphFailedToQueue": "Не удалось поставить график в очередь"
|
||||
"graphFailedToQueue": "Не удалось поставить график в очередь",
|
||||
"openQueue": "Открыть очередь"
|
||||
},
|
||||
"sdxl": {
|
||||
"refinerStart": "Запуск перерисовщика",
|
||||
@@ -1602,7 +1633,8 @@
|
||||
"workflows": "Рабочие процессы",
|
||||
"noDescription": "Без описания",
|
||||
"uploadWorkflow": "Загрузить рабочий процесс",
|
||||
"userWorkflows": "Мои рабочие процессы"
|
||||
"userWorkflows": "Мои рабочие процессы",
|
||||
"newWorkflowCreated": "Создан новый рабочий процесс"
|
||||
},
|
||||
"embedding": {
|
||||
"noEmbeddingsLoaded": "встраивания не загружены",
|
||||
@@ -1635,9 +1667,38 @@
|
||||
"selectModel": "Выберите модель",
|
||||
"noRefinerModelsInstalled": "Модели SDXL Refiner не установлены",
|
||||
"noLoRAsInstalled": "Нет установленных LoRA",
|
||||
"selectLoRA": "Выберите LoRA"
|
||||
"selectLoRA": "Выберите LoRA",
|
||||
"noMainModelSelected": "Базовая модель не выбрана",
|
||||
"lora": "LoRA",
|
||||
"allLoRAsAdded": "Все LoRA добавлены",
|
||||
"defaultVAE": "Стандартное VAE",
|
||||
"incompatibleBaseModel": "Несовместимая базовая модель",
|
||||
"loraAlreadyAdded": "LoRA уже добавлена"
|
||||
},
|
||||
"app": {
|
||||
"storeNotInitialized": "Магазин не инициализирован"
|
||||
},
|
||||
"accordions": {
|
||||
"compositing": {
|
||||
"infillTab": "Заполнение",
|
||||
"coherenceTab": "Согласованность",
|
||||
"title": "Композиция"
|
||||
},
|
||||
"control": {
|
||||
"controlAdaptersTab": "Адаптеры контроля",
|
||||
"ipTab": "Запросы изображений",
|
||||
"title": "Контроль"
|
||||
},
|
||||
"generation": {
|
||||
"title": "Генерация",
|
||||
"conceptsTab": "Концепты",
|
||||
"modelTab": "Модель"
|
||||
},
|
||||
"advanced": {
|
||||
"title": "Расширенные"
|
||||
},
|
||||
"image": {
|
||||
"title": "Изображение"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,11 @@
|
||||
"nextPage": "下一页",
|
||||
"saveAs": "保存为",
|
||||
"unsaved": "未保存",
|
||||
"ai": "ai"
|
||||
"ai": "ai",
|
||||
"preferencesLabel": "首选项",
|
||||
"or": "或",
|
||||
"advancedOptions": "高级选项",
|
||||
"free": "自由"
|
||||
},
|
||||
"gallery": {
|
||||
"generations": "生成的图像",
|
||||
@@ -164,18 +168,18 @@
|
||||
"starImage": "收藏图像"
|
||||
},
|
||||
"hotkeys": {
|
||||
"keyboardShortcuts": "键盘快捷键",
|
||||
"appHotkeys": "应用快捷键",
|
||||
"generalHotkeys": "一般快捷键",
|
||||
"galleryHotkeys": "图库快捷键",
|
||||
"unifiedCanvasHotkeys": "统一画布快捷键",
|
||||
"keyboardShortcuts": "快捷键",
|
||||
"appHotkeys": "应用",
|
||||
"generalHotkeys": "一般",
|
||||
"galleryHotkeys": "图库",
|
||||
"unifiedCanvasHotkeys": "统一画布",
|
||||
"invoke": {
|
||||
"title": "Invoke",
|
||||
"desc": "生成图像"
|
||||
},
|
||||
"cancel": {
|
||||
"title": "取消",
|
||||
"desc": "取消图像生成"
|
||||
"desc": "取消当前队列项目"
|
||||
},
|
||||
"focusPrompt": {
|
||||
"title": "打开提示词框",
|
||||
@@ -361,11 +365,26 @@
|
||||
"title": "接受暂存图像",
|
||||
"desc": "接受当前暂存区中的图像"
|
||||
},
|
||||
"nodesHotkeys": "节点快捷键",
|
||||
"nodesHotkeys": "节点",
|
||||
"addNodes": {
|
||||
"title": "添加节点",
|
||||
"desc": "打开添加节点菜单"
|
||||
}
|
||||
},
|
||||
"cancelAndClear": {
|
||||
"desc": "取消当前队列项目并且清除所有待定项目",
|
||||
"title": "取消和清除"
|
||||
},
|
||||
"resetOptionsAndGallery": {
|
||||
"title": "重置选项和图库",
|
||||
"desc": "重置选项和图库面板"
|
||||
},
|
||||
"searchHotkeys": "检索快捷键",
|
||||
"noHotkeysFound": "未找到快捷键",
|
||||
"toggleOptionsAndGallery": {
|
||||
"desc": "打开和关闭选项和图库面板",
|
||||
"title": "开关选项和图库"
|
||||
},
|
||||
"clearSearch": "清除检索项"
|
||||
},
|
||||
"modelManager": {
|
||||
"modelManager": "模型管理器",
|
||||
@@ -563,8 +582,8 @@
|
||||
"info": "信息",
|
||||
"initialImage": "初始图像",
|
||||
"showOptionsPanel": "显示侧栏浮窗 (O 或 T)",
|
||||
"seamlessYAxis": "Y 轴",
|
||||
"seamlessXAxis": "X 轴",
|
||||
"seamlessYAxis": "无缝平铺 Y 轴",
|
||||
"seamlessXAxis": "无缝平铺 X 轴",
|
||||
"boundingBoxWidth": "边界框宽度",
|
||||
"boundingBoxHeight": "边界框高度",
|
||||
"denoisingStrength": "去噪强度",
|
||||
@@ -611,7 +630,7 @@
|
||||
"readyToInvoke": "准备调用",
|
||||
"noControlImageForControlAdapter": "有 #{{number}} 个 Control Adapter 缺失控制图像",
|
||||
"noModelForControlAdapter": "有 #{{number}} 个 Control Adapter 没有选择模型。",
|
||||
"incompatibleBaseModelForControlAdapter": "有 #{{number}} 个 Control Adapter 模型与主模型不匹配。"
|
||||
"incompatibleBaseModelForControlAdapter": "有 #{{number}} 个 Control Adapter 模型与主模型不兼容。"
|
||||
},
|
||||
"patchmatchDownScaleSize": "缩小",
|
||||
"coherenceSteps": "步数",
|
||||
@@ -642,7 +661,14 @@
|
||||
"unmasked": "取消遮罩",
|
||||
"cfgRescaleMultiplier": "CFG 重缩放倍数",
|
||||
"cfgRescale": "CFG 重缩放",
|
||||
"useSize": "使用尺寸"
|
||||
"useSize": "使用尺寸",
|
||||
"setToOptimalSize": "优化模型大小",
|
||||
"setToOptimalSizeTooSmall": "$t(parameters.setToOptimalSize) (可能过小)",
|
||||
"imageSize": "图像尺寸",
|
||||
"lockAspectRatio": "锁定纵横比",
|
||||
"swapDimensions": "交换尺寸",
|
||||
"aspect": "纵横",
|
||||
"setToOptimalSizeTooLarge": "$t(parameters.setToOptimalSize) (可能过大)"
|
||||
},
|
||||
"settings": {
|
||||
"models": "模型",
|
||||
@@ -1201,7 +1227,8 @@
|
||||
"openPose": "Openpose",
|
||||
"controlAdapter_other": "Control Adapters",
|
||||
"lineartAnime": "Lineart Anime",
|
||||
"canny": "Canny"
|
||||
"canny": "Canny",
|
||||
"resizeSimple": "缩放(简单)"
|
||||
},
|
||||
"queue": {
|
||||
"status": "状态",
|
||||
@@ -1248,7 +1275,7 @@
|
||||
"notReady": "无法排队",
|
||||
"batchFailedToQueue": "批次加入队列失败",
|
||||
"batchValues": "批次数",
|
||||
"queueCountPrediction": "添加 {{predicted}} 到队列",
|
||||
"queueCountPrediction": "{{promptsCount}} 提示词 × {{iterations}} 迭代次数 -> {{count}} 次生成",
|
||||
"batchQueued": "加入队列的批次",
|
||||
"queuedCount": "{{pending}} 待处理",
|
||||
"front": "前",
|
||||
@@ -1262,7 +1289,8 @@
|
||||
"queueMaxExceeded": "超出最大值 {{max_queue_size}},将跳过 {{skip}}",
|
||||
"graphFailedToQueue": "节点图加入队列失败",
|
||||
"batchFieldValues": "批处理值",
|
||||
"time": "时间"
|
||||
"time": "时间",
|
||||
"openQueue": "打开队列"
|
||||
},
|
||||
"sdxl": {
|
||||
"refinerStart": "Refiner 开始作用时机",
|
||||
@@ -1276,11 +1304,12 @@
|
||||
"denoisingStrength": "去噪强度",
|
||||
"refinermodel": "Refiner 模型",
|
||||
"posAestheticScore": "正向美学评分",
|
||||
"concatPromptStyle": "连接提示词 & 样式",
|
||||
"concatPromptStyle": "链接提示词 & 样式",
|
||||
"loading": "加载中...",
|
||||
"steps": "步数",
|
||||
"posStylePrompt": "正向样式提示词",
|
||||
"refiner": "Refiner"
|
||||
"refiner": "Refiner",
|
||||
"freePromptStyle": "手动输入样式提示词"
|
||||
},
|
||||
"metadata": {
|
||||
"positivePrompt": "正向提示词",
|
||||
@@ -1324,7 +1353,13 @@
|
||||
"noLoRAsInstalled": "无已安装的 LoRA",
|
||||
"esrganModel": "ESRGAN 模型",
|
||||
"addLora": "添加 LoRA",
|
||||
"noLoRAsLoaded": "无已加载的 LoRA"
|
||||
"noLoRAsLoaded": "无已加载的 LoRA",
|
||||
"noMainModelSelected": "未选择主模型",
|
||||
"lora": "LoRA",
|
||||
"allLoRAsAdded": "已添加所有 LoRA",
|
||||
"defaultVAE": "默认 VAE",
|
||||
"incompatibleBaseModel": "不兼容基础模型",
|
||||
"loraAlreadyAdded": "LoRA 已经被添加"
|
||||
},
|
||||
"boards": {
|
||||
"autoAddBoard": "自动添加面板",
|
||||
@@ -1368,7 +1403,9 @@
|
||||
"maxPrompts": "最大提示词数",
|
||||
"dynamicPrompts": "动态提示词",
|
||||
"promptsWithCount_other": "{{count}} 个提示词",
|
||||
"promptsPreview": "提示词预览"
|
||||
"promptsPreview": "提示词预览",
|
||||
"showDynamicPrompts": "显示动态提示词",
|
||||
"loading": "生成动态提示词中..."
|
||||
},
|
||||
"popovers": {
|
||||
"compositingMaskAdjustments": {
|
||||
@@ -1650,5 +1687,28 @@
|
||||
},
|
||||
"app": {
|
||||
"storeNotInitialized": "商店尚未初始化"
|
||||
},
|
||||
"accordions": {
|
||||
"compositing": {
|
||||
"infillTab": "内补",
|
||||
"coherenceTab": "一致性层",
|
||||
"title": "合成"
|
||||
},
|
||||
"control": {
|
||||
"controlAdaptersTab": "Control Adapters",
|
||||
"ipTab": "图像提示",
|
||||
"title": "Control"
|
||||
},
|
||||
"generation": {
|
||||
"title": "生成",
|
||||
"conceptsTab": "概念",
|
||||
"modelTab": "模型"
|
||||
},
|
||||
"advanced": {
|
||||
"title": "高级"
|
||||
},
|
||||
"image": {
|
||||
"title": "图像"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export const useSocketIO = () => {
|
||||
}, [baseUrl]);
|
||||
|
||||
const socketOptions = useMemo(() => {
|
||||
const options: Parameters<typeof io>[0] = {
|
||||
const options: Partial<ManagerOptions & SocketOptions> = {
|
||||
timeout: 60000,
|
||||
path: '/ws/socket.io',
|
||||
autoConnect: false, // achtung! removing this breaks the dynamic middleware
|
||||
@@ -71,7 +71,7 @@ export const useSocketIO = () => {
|
||||
setEventListeners({ dispatch, socket });
|
||||
socket.connect();
|
||||
|
||||
if ($isDebugging.get()) {
|
||||
if ($isDebugging.get() || import.meta.env.MODE === 'development') {
|
||||
window.$socketOptions = $socketOptions;
|
||||
console.log('Socket initialized', socket);
|
||||
}
|
||||
@@ -79,7 +79,7 @@ export const useSocketIO = () => {
|
||||
$isSocketInitialized.set(true);
|
||||
|
||||
return () => {
|
||||
if ($isDebugging.get()) {
|
||||
if ($isDebugging.get() || import.meta.env.MODE === 'development') {
|
||||
window.$socketOptions = undefined;
|
||||
console.log('Socket teardown', socket);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
import { createLogWriter } from '@roarr/browser-log-writer';
|
||||
import { atom } from 'nanostores';
|
||||
import type { Logger } from 'roarr';
|
||||
import type { Logger, MessageSerializer } from 'roarr';
|
||||
import { ROARR, Roarr } from 'roarr';
|
||||
import { z } from 'zod';
|
||||
|
||||
const serializeMessage: MessageSerializer = (message) => {
|
||||
return JSON.stringify(message);
|
||||
};
|
||||
|
||||
ROARR.serializeMessage = serializeMessage;
|
||||
ROARR.write = createLogWriter();
|
||||
|
||||
export const BASE_CONTEXT = {};
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import { StorageError } from 'app/store/enhancers/reduxRemember/errors';
|
||||
import { $projectId } from 'app/store/nanostores/projectId';
|
||||
import type { UseStore } from 'idb-keyval';
|
||||
import {
|
||||
clear,
|
||||
createStore as createIDBKeyValStore,
|
||||
get,
|
||||
set,
|
||||
} from 'idb-keyval';
|
||||
import { action, atom } from 'nanostores';
|
||||
import type { Driver } from 'redux-remember';
|
||||
|
||||
// Create a custom idb-keyval store (just needed to customize the name)
|
||||
export const $idbKeyValStore = atom<UseStore>(
|
||||
createIDBKeyValStore('invoke', 'invoke-store')
|
||||
);
|
||||
|
||||
export const clearIdbKeyValStore = action($idbKeyValStore, 'clear', (store) => {
|
||||
clear(store.get());
|
||||
});
|
||||
|
||||
// Create redux-remember driver, wrapping idb-keyval
|
||||
export const idbKeyValDriver: Driver = {
|
||||
getItem: (key) => {
|
||||
try {
|
||||
return get(key, $idbKeyValStore.get());
|
||||
} catch (originalError) {
|
||||
throw new StorageError({
|
||||
key,
|
||||
projectId: $projectId.get(),
|
||||
originalError,
|
||||
});
|
||||
}
|
||||
},
|
||||
setItem: (key, value) => {
|
||||
try {
|
||||
return set(key, value, $idbKeyValStore.get());
|
||||
} catch (originalError) {
|
||||
throw new StorageError({
|
||||
key,
|
||||
value,
|
||||
projectId: $projectId.get(),
|
||||
originalError,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import { parseify } from 'common/util/serialize';
|
||||
import { PersistError, RehydrateError } from 'redux-remember';
|
||||
import { serializeError } from 'serialize-error';
|
||||
|
||||
export type StorageErrorArgs = {
|
||||
key: string;
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */ // any is correct
|
||||
value?: any;
|
||||
originalError?: unknown;
|
||||
projectId?: string;
|
||||
};
|
||||
|
||||
export class StorageError extends Error {
|
||||
key: string;
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */ // any is correct
|
||||
value?: any;
|
||||
originalError?: Error;
|
||||
projectId?: string;
|
||||
|
||||
constructor({ key, value, originalError, projectId }: StorageErrorArgs) {
|
||||
super(`Error setting ${key}`);
|
||||
this.name = 'StorageSetError';
|
||||
this.key = key;
|
||||
if (value !== undefined) {
|
||||
this.value = value;
|
||||
}
|
||||
if (projectId !== undefined) {
|
||||
this.projectId = projectId;
|
||||
}
|
||||
if (originalError instanceof Error) {
|
||||
this.originalError = originalError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const errorHandler = (err: PersistError | RehydrateError) => {
|
||||
const log = logger('system');
|
||||
if (err instanceof PersistError) {
|
||||
log.error({ error: serializeError(err) }, 'Problem persisting state');
|
||||
} else if (err instanceof RehydrateError) {
|
||||
log.error({ error: serializeError(err) }, 'Problem rehydrating state');
|
||||
} else {
|
||||
log.error({ error: parseify(err) }, 'Problem in persistence layer');
|
||||
}
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
import { canvasPersistDenylist } from 'features/canvas/store/canvasPersistDenylist';
|
||||
import { controlAdaptersPersistDenylist } from 'features/controlAdapters/store/controlAdaptersPersistDenylist';
|
||||
import { dynamicPromptsPersistDenylist } from 'features/dynamicPrompts/store/dynamicPromptsPersistDenylist';
|
||||
import { galleryPersistDenylist } from 'features/gallery/store/galleryPersistDenylist';
|
||||
import { nodesPersistDenylist } from 'features/nodes/store/nodesPersistDenylist';
|
||||
import { generationPersistDenylist } from 'features/parameters/store/generationPersistDenylist';
|
||||
import { postprocessingPersistDenylist } from 'features/parameters/store/postprocessingPersistDenylist';
|
||||
import { systemPersistDenylist } from 'features/system/store/systemPersistDenylist';
|
||||
import { uiPersistDenylist } from 'features/ui/store/uiPersistDenylist';
|
||||
import { omit } from 'lodash-es';
|
||||
import type { SerializeFunction } from 'redux-remember';
|
||||
|
||||
const serializationDenylist: {
|
||||
[key: string]: string[];
|
||||
} = {
|
||||
canvas: canvasPersistDenylist,
|
||||
gallery: galleryPersistDenylist,
|
||||
generation: generationPersistDenylist,
|
||||
nodes: nodesPersistDenylist,
|
||||
postprocessing: postprocessingPersistDenylist,
|
||||
system: systemPersistDenylist,
|
||||
ui: uiPersistDenylist,
|
||||
controlNet: controlAdaptersPersistDenylist,
|
||||
dynamicPrompts: dynamicPromptsPersistDenylist,
|
||||
};
|
||||
|
||||
export const serialize: SerializeFunction = (data, key) => {
|
||||
const result = omit(data, serializationDenylist[key] ?? []);
|
||||
return JSON.stringify(result);
|
||||
};
|
||||
@@ -1,34 +0,0 @@
|
||||
import { initialCanvasState } from 'features/canvas/store/canvasSlice';
|
||||
import { initialControlAdapterState } from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||
import { initialDynamicPromptsState } from 'features/dynamicPrompts/store/dynamicPromptsSlice';
|
||||
import { initialGalleryState } from 'features/gallery/store/gallerySlice';
|
||||
import { initialNodesState } from 'features/nodes/store/nodesSlice';
|
||||
import { initialGenerationState } from 'features/parameters/store/generationSlice';
|
||||
import { initialPostprocessingState } from 'features/parameters/store/postprocessingSlice';
|
||||
import { initialSDXLState } from 'features/sdxl/store/sdxlSlice';
|
||||
import { initialConfigState } from 'features/system/store/configSlice';
|
||||
import { initialSystemState } from 'features/system/store/systemSlice';
|
||||
import { initialUIState } from 'features/ui/store/uiSlice';
|
||||
import { defaultsDeep } from 'lodash-es';
|
||||
import type { UnserializeFunction } from 'redux-remember';
|
||||
|
||||
const initialStates: {
|
||||
[key: string]: object; // TODO: type this properly
|
||||
} = {
|
||||
canvas: initialCanvasState,
|
||||
gallery: initialGalleryState,
|
||||
generation: initialGenerationState,
|
||||
nodes: initialNodesState,
|
||||
postprocessing: initialPostprocessingState,
|
||||
system: initialSystemState,
|
||||
config: initialConfigState,
|
||||
ui: initialUIState,
|
||||
controlAdapters: initialControlAdapterState,
|
||||
dynamicPrompts: initialDynamicPromptsState,
|
||||
sdxl: initialSDXLState,
|
||||
};
|
||||
|
||||
export const unserialize: UnserializeFunction = (data, key) => {
|
||||
const result = defaultsDeep(JSON.parse(data), initialStates[key]);
|
||||
return result;
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { Middleware, MiddlewareAPI } from '@reduxjs/toolkit';
|
||||
import { diff } from 'jsondiffpatch';
|
||||
|
||||
/**
|
||||
* Super simple logger middleware. Useful for debugging when the redux devtools are awkward.
|
||||
*/
|
||||
export const debugLoggerMiddleware: Middleware =
|
||||
(api: MiddlewareAPI) => (next) => (action) => {
|
||||
const originalState = api.getState();
|
||||
console.log('REDUX: dispatching', action);
|
||||
const result = next(action);
|
||||
const nextState = api.getState();
|
||||
console.log('REDUX: next state', nextState);
|
||||
console.log('REDUX: diff', diff(originalState, nextState));
|
||||
return result;
|
||||
};
|
||||
@@ -1,8 +1,10 @@
|
||||
import type { UnknownAction } from '@reduxjs/toolkit';
|
||||
import { isAnyGraphBuilt } from 'features/nodes/store/actions';
|
||||
import { nodeTemplatesBuilt } from 'features/nodes/store/nodeTemplatesSlice';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
|
||||
import type { Graph } from 'services/api/types';
|
||||
import { socketGeneratorProgress } from 'services/events/actions';
|
||||
|
||||
export const actionSanitizer = <A extends UnknownAction>(action: A): A => {
|
||||
if (isAnyGraphBuilt(action)) {
|
||||
@@ -30,5 +32,14 @@ export const actionSanitizer = <A extends UnknownAction>(action: A): A => {
|
||||
};
|
||||
}
|
||||
|
||||
if (socketGeneratorProgress.match(action)) {
|
||||
const sanitized = cloneDeep(action);
|
||||
if (sanitized.payload.data.progress_image) {
|
||||
sanitized.payload.data.progress_image.dataURL =
|
||||
'<Progress image omitted>';
|
||||
}
|
||||
return sanitized;
|
||||
}
|
||||
|
||||
return action;
|
||||
};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/**
|
||||
* This is a list of actions that should be excluded in the Redux DevTools.
|
||||
*/
|
||||
export const actionsDenylist = [
|
||||
export const actionsDenylist: string[] = [
|
||||
// very spammy canvas actions
|
||||
'canvas/setStageCoordinates',
|
||||
'canvas/setStageScale',
|
||||
'canvas/setBoundingBoxCoordinates',
|
||||
'canvas/setBoundingBoxDimensions',
|
||||
'canvas/addPointToCurrentLine',
|
||||
// 'canvas/setStageCoordinates',
|
||||
// 'canvas/setStageScale',
|
||||
// 'canvas/setBoundingBoxCoordinates',
|
||||
// 'canvas/setBoundingBoxDimensions',
|
||||
// 'canvas/addPointToCurrentLine',
|
||||
// bazillions during generation
|
||||
'socket/socketGeneratorProgress',
|
||||
'socket/appSocketGeneratorProgress',
|
||||
// 'socket/socketGeneratorProgress',
|
||||
// 'socket/appSocketGeneratorProgress',
|
||||
// this happens after every state change
|
||||
'@@REMEMBER_PERSISTED',
|
||||
// '@@REMEMBER_PERSISTED',
|
||||
];
|
||||
|
||||
@@ -5,6 +5,7 @@ import type {
|
||||
UnknownAction,
|
||||
} from '@reduxjs/toolkit';
|
||||
import { addListener, createListenerMiddleware } from '@reduxjs/toolkit';
|
||||
import { addGalleryImageClickedListener } from 'app/store/middleware/listenerMiddleware/listeners/galleryImageClicked';
|
||||
import type { AppDispatch, RootState } from 'app/store/store';
|
||||
|
||||
import { addCommitStagingAreaImageListener } from './listeners/addCommitStagingAreaImageListener';
|
||||
@@ -69,7 +70,6 @@ import { addSessionRetrievalErrorEventListener } from './listeners/socketio/sock
|
||||
import { addSocketSubscribedEventListener as addSocketSubscribedListener } from './listeners/socketio/socketSubscribed';
|
||||
import { addSocketUnsubscribedEventListener as addSocketUnsubscribedListener } from './listeners/socketio/socketUnsubscribed';
|
||||
import { addStagingAreaImageSavedListener } from './listeners/stagingAreaImageSaved';
|
||||
import { addTabChangedListener } from './listeners/tabChanged';
|
||||
import { addUpdateAllNodesRequestedListener } from './listeners/updateAllNodesRequested';
|
||||
import { addUpscaleRequestedListener } from './listeners/upscaleRequested';
|
||||
import { addWorkflowLoadRequestedListener } from './listeners/workflowLoadRequested';
|
||||
@@ -118,6 +118,9 @@ addImageToDeleteSelectedListener();
|
||||
addImagesStarredListener();
|
||||
addImagesUnstarredListener();
|
||||
|
||||
// Gallery
|
||||
addGalleryImageClickedListener();
|
||||
|
||||
// User Invoked
|
||||
addEnqueueRequestedCanvasListener();
|
||||
addEnqueueRequestedNodes();
|
||||
@@ -136,19 +139,7 @@ addCanvasMergedListener();
|
||||
addStagingAreaImageSavedListener();
|
||||
addCommitStagingAreaImageListener();
|
||||
|
||||
/**
|
||||
* Socket.IO Events - these handle SIO events directly and pass on internal application actions.
|
||||
* We don't handle SIO events in slices via `extraReducers` because some of these events shouldn't
|
||||
* actually be handled at all.
|
||||
*
|
||||
* For example, we don't want to respond to progress events for canceled sessions. To avoid
|
||||
* duplicating the logic to determine if an event should be responded to, we handle all of that
|
||||
* "is this session canceled?" logic in these listeners.
|
||||
*
|
||||
* The `socketGeneratorProgress` listener will then only dispatch the `appSocketGeneratorProgress`
|
||||
* action if it should be handled by the rest of the application. It is this `appSocketGeneratorProgress`
|
||||
* action that is handled by reducers in slices.
|
||||
*/
|
||||
// Socket.IO
|
||||
addGeneratorProgressListener();
|
||||
addGraphExecutionStateCompleteListener();
|
||||
addInvocationCompleteListener();
|
||||
@@ -196,8 +187,5 @@ addFirstListImagesListener();
|
||||
// Ad-hoc upscale workflwo
|
||||
addUpscaleRequestedListener();
|
||||
|
||||
// Tab Change
|
||||
addTabChangedListener();
|
||||
|
||||
// Dynamic prompts
|
||||
addDynamicPromptsListener();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { queueApi } from 'services/api/endpoints/queue';
|
||||
import { queueApi, selectQueueStatus } from 'services/api/endpoints/queue';
|
||||
|
||||
import { startAppListening } from '..';
|
||||
|
||||
@@ -6,7 +6,7 @@ export const addAnyEnqueuedListener = () => {
|
||||
startAppListening({
|
||||
matcher: queueApi.endpoints.enqueueBatch.matchFulfilled,
|
||||
effect: async (_, { dispatch, getState }) => {
|
||||
const { data } = queueApi.endpoints.getQueueStatus.select()(getState());
|
||||
const { data } = selectQueueStatus(getState());
|
||||
|
||||
if (!data || data.processor.is_started) {
|
||||
return;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { $logger } from 'app/logging/logger';
|
||||
import { canvasMerged } from 'features/canvas/store/actions';
|
||||
import { $canvasBaseLayer } from 'features/canvas/store/canvasNanostore';
|
||||
import { setMergedCanvas } from 'features/canvas/store/canvasSlice';
|
||||
import { getFullBaseLayerBlob } from 'features/canvas/util/getFullBaseLayerBlob';
|
||||
import { getCanvasBaseLayer } from 'features/canvas/util/konvaInstanceProvider';
|
||||
import { addToast } from 'features/system/store/systemSlice';
|
||||
import { t } from 'i18next';
|
||||
import { imagesApi } from 'services/api/endpoints/images';
|
||||
@@ -30,7 +30,7 @@ export const addCanvasMergedListener = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const canvasBaseLayer = getCanvasBaseLayer();
|
||||
const canvasBaseLayer = $canvasBaseLayer.get();
|
||||
|
||||
if (!canvasBaseLayer) {
|
||||
moduleLog.error('Problem getting canvas base layer');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { enqueueRequested } from 'app/store/actions';
|
||||
import { buildNodesGraph } from 'features/nodes/util/graph/buildNodesGraph';
|
||||
import { buildWorkflowRight } from 'features/nodes/util/workflow/buildWorkflow';
|
||||
import { buildWorkflowWithValidation } from 'features/nodes/util/workflow/buildWorkflow';
|
||||
import { queueApi } from 'services/api/endpoints/queue';
|
||||
import type { BatchConfig } from 'services/api/types';
|
||||
|
||||
@@ -15,7 +15,7 @@ export const addEnqueueRequestedNodes = () => {
|
||||
const { nodes, edges } = state.nodes;
|
||||
const workflow = state.workflow;
|
||||
const graph = buildNodesGraph(state.nodes);
|
||||
const builtWorkflow = buildWorkflowRight({
|
||||
const builtWorkflow = buildWorkflowWithValidation({
|
||||
nodes,
|
||||
edges,
|
||||
workflow,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
import { createAction } from '@reduxjs/toolkit';
|
||||
import { selectListImagesQueryArgs } from 'features/gallery/store/gallerySelectors';
|
||||
import { selectionChanged } from 'features/gallery/store/gallerySlice';
|
||||
import { imagesApi } from 'services/api/endpoints/images';
|
||||
import type { ImageDTO } from 'services/api/types';
|
||||
import { imagesSelectors } from 'services/api/util';
|
||||
|
||||
import { startAppListening } from '..';
|
||||
|
||||
export const galleryImageClicked = createAction<{
|
||||
imageDTO: ImageDTO;
|
||||
shiftKey: boolean;
|
||||
ctrlKey: boolean;
|
||||
metaKey: boolean;
|
||||
}>('gallery/imageClicked');
|
||||
|
||||
/**
|
||||
* This listener handles the logic for selecting images in the gallery.
|
||||
*
|
||||
* Previously, this logic was in a `useCallback` with the whole gallery selection as a dependency. Every time
|
||||
* the selection changed, the callback got recreated and all images rerendered. This could easily block for
|
||||
* hundreds of ms, more for lower end devices.
|
||||
*
|
||||
* Moving this logic into a listener means we don't need to recalculate anything dynamically and the gallery
|
||||
* is much more responsive.
|
||||
*/
|
||||
|
||||
export const addGalleryImageClickedListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: galleryImageClicked,
|
||||
effect: async (action, { dispatch, getState }) => {
|
||||
const { imageDTO, shiftKey, ctrlKey, metaKey } = action.payload;
|
||||
const state = getState();
|
||||
const queryArgs = selectListImagesQueryArgs(state);
|
||||
const { data: listImagesData } =
|
||||
imagesApi.endpoints.listImages.select(queryArgs)(state);
|
||||
|
||||
if (!listImagesData) {
|
||||
// Should never happen if we have clicked a gallery image
|
||||
return;
|
||||
}
|
||||
|
||||
const imageDTOs = imagesSelectors.selectAll(listImagesData);
|
||||
const selection = state.gallery.selection;
|
||||
|
||||
if (shiftKey) {
|
||||
const rangeEndImageName = imageDTO.image_name;
|
||||
const lastSelectedImage = selection[selection.length - 1]?.image_name;
|
||||
const lastClickedIndex = imageDTOs.findIndex(
|
||||
(n) => n.image_name === lastSelectedImage
|
||||
);
|
||||
const currentClickedIndex = imageDTOs.findIndex(
|
||||
(n) => n.image_name === rangeEndImageName
|
||||
);
|
||||
if (lastClickedIndex > -1 && currentClickedIndex > -1) {
|
||||
// We have a valid range!
|
||||
const start = Math.min(lastClickedIndex, currentClickedIndex);
|
||||
const end = Math.max(lastClickedIndex, currentClickedIndex);
|
||||
const imagesToSelect = imageDTOs.slice(start, end + 1);
|
||||
dispatch(selectionChanged(selection.concat(imagesToSelect)));
|
||||
}
|
||||
} else if (ctrlKey || metaKey) {
|
||||
if (
|
||||
selection.some((i) => i.image_name === imageDTO.image_name) &&
|
||||
selection.length > 1
|
||||
) {
|
||||
dispatch(
|
||||
selectionChanged(
|
||||
selection.filter((n) => n.image_name !== imageDTO.image_name)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
dispatch(selectionChanged(selection.concat(imageDTO)));
|
||||
}
|
||||
} else {
|
||||
dispatch(selectionChanged([imageDTO]));
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import { isControlNetOrT2IAdapter } from 'features/controlAdapters/store/types';
|
||||
import { imageDeletionConfirmed } from 'features/deleteImageModal/store/actions';
|
||||
import { isModalOpenChanged } from 'features/deleteImageModal/store/slice';
|
||||
import { selectListImagesBaseQueryArgs } from 'features/gallery/store/gallerySelectors';
|
||||
import { selectListImagesQueryArgs } from 'features/gallery/store/gallerySelectors';
|
||||
import { imageSelected } from 'features/gallery/store/gallerySlice';
|
||||
import { fieldImageValueChanged } from 'features/nodes/store/nodesSlice';
|
||||
import { isImageFieldInputInstance } from 'features/nodes/types/field';
|
||||
@@ -49,7 +49,7 @@ export const addRequestedSingleImageDeletionListener = () => {
|
||||
if (imageDTO && imageDTO?.image_name === lastSelectedImage) {
|
||||
const { image_name } = imageDTO;
|
||||
|
||||
const baseQueryArgs = selectListImagesBaseQueryArgs(state);
|
||||
const baseQueryArgs = selectListImagesQueryArgs(state);
|
||||
const { data } =
|
||||
imagesApi.endpoints.listImages.select(baseQueryArgs)(state);
|
||||
|
||||
@@ -180,9 +180,9 @@ export const addRequestedMultipleImageDeletionListener = () => {
|
||||
imagesApi.endpoints.deleteImages.initiate({ imageDTOs })
|
||||
).unwrap();
|
||||
const state = getState();
|
||||
const baseQueryArgs = selectListImagesBaseQueryArgs(state);
|
||||
const queryArgs = selectListImagesQueryArgs(state);
|
||||
const { data } =
|
||||
imagesApi.endpoints.listImages.select(baseQueryArgs)(state);
|
||||
imagesApi.endpoints.listImages.select(queryArgs)(state);
|
||||
|
||||
const newSelectedImageDTO = data
|
||||
? imagesSelectors.selectAll(data)[0]
|
||||
|
||||
@@ -12,7 +12,6 @@ import type {
|
||||
} from 'features/dnd/types';
|
||||
import { imageSelected } from 'features/gallery/store/gallerySlice';
|
||||
import { fieldImageValueChanged } from 'features/nodes/store/nodesSlice';
|
||||
import { workflowExposedFieldAdded } from 'features/nodes/store/workflowSlice';
|
||||
import {
|
||||
initialImageChanged,
|
||||
selectOptimalDimension,
|
||||
@@ -35,10 +34,10 @@ export const addImageDroppedListener = () => {
|
||||
|
||||
if (activeData.payloadType === 'IMAGE_DTO') {
|
||||
log.debug({ activeData, overData }, 'Image dropped');
|
||||
} else if (activeData.payloadType === 'IMAGE_DTOS') {
|
||||
} else if (activeData.payloadType === 'GALLERY_SELECTION') {
|
||||
log.debug(
|
||||
{ activeData, overData },
|
||||
`Images (${activeData.payload.imageDTOs.length}) dropped`
|
||||
`Images (${getState().gallery.selection.length}) dropped`
|
||||
);
|
||||
} else if (activeData.payloadType === 'NODE_FIELD') {
|
||||
log.debug(
|
||||
@@ -49,19 +48,6 @@ export const addImageDroppedListener = () => {
|
||||
log.debug({ activeData, overData }, `Unknown payload dropped`);
|
||||
}
|
||||
|
||||
if (
|
||||
overData.actionType === 'ADD_FIELD_TO_LINEAR' &&
|
||||
activeData.payloadType === 'NODE_FIELD'
|
||||
) {
|
||||
const { nodeId, field } = activeData.payload;
|
||||
dispatch(
|
||||
workflowExposedFieldAdded({
|
||||
nodeId,
|
||||
fieldName: field.name,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Image dropped on current image
|
||||
*/
|
||||
@@ -207,10 +193,9 @@ export const addImageDroppedListener = () => {
|
||||
*/
|
||||
if (
|
||||
overData.actionType === 'ADD_TO_BOARD' &&
|
||||
activeData.payloadType === 'IMAGE_DTOS' &&
|
||||
activeData.payload.imageDTOs
|
||||
activeData.payloadType === 'GALLERY_SELECTION'
|
||||
) {
|
||||
const { imageDTOs } = activeData.payload;
|
||||
const imageDTOs = getState().gallery.selection;
|
||||
const { boardId } = overData.context;
|
||||
dispatch(
|
||||
imagesApi.endpoints.addImagesToBoard.initiate({
|
||||
@@ -226,10 +211,9 @@ export const addImageDroppedListener = () => {
|
||||
*/
|
||||
if (
|
||||
overData.actionType === 'REMOVE_FROM_BOARD' &&
|
||||
activeData.payloadType === 'IMAGE_DTOS' &&
|
||||
activeData.payload.imageDTOs
|
||||
activeData.payloadType === 'GALLERY_SELECTION'
|
||||
) {
|
||||
const { imageDTOs } = activeData.payload;
|
||||
const imageDTOs = getState().gallery.selection;
|
||||
dispatch(
|
||||
imagesApi.endpoints.removeImagesFromBoard.initiate({
|
||||
imageDTOs,
|
||||
|
||||
@@ -37,8 +37,10 @@ export const addModelSelectedListener = () => {
|
||||
const newModel = result.data;
|
||||
|
||||
const { base_model } = newModel;
|
||||
const didBaseModelChange =
|
||||
state.generation.model?.base_model !== base_model;
|
||||
|
||||
if (state.generation.model?.base_model !== base_model) {
|
||||
if (didBaseModelChange) {
|
||||
// we may need to reset some incompatible submodels
|
||||
let modelsCleared = 0;
|
||||
|
||||
@@ -81,7 +83,7 @@ export const addModelSelectedListener = () => {
|
||||
}
|
||||
}
|
||||
|
||||
dispatch(modelChanged(newModel));
|
||||
dispatch(modelChanged(newModel, state.generation.model));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -74,7 +74,7 @@ export const addModelsLoadedListener = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch(modelChanged(result.data));
|
||||
dispatch(modelChanged(result.data, currentModel));
|
||||
},
|
||||
});
|
||||
startAppListening({
|
||||
@@ -149,7 +149,7 @@ export const addModelsLoadedListener = () => {
|
||||
|
||||
if (!firstModel) {
|
||||
// No custom VAEs loaded at all; use the default
|
||||
dispatch(modelChanged(null));
|
||||
dispatch(vaeSelected(null));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ export const addModelsLoadedListener = () => {
|
||||
const log = logger('models');
|
||||
log.info(
|
||||
{ models: action.payload.entities },
|
||||
`ControlNet models loaded (${action.payload.ids.length})`
|
||||
`T2I Adapter models loaded (${action.payload.ids.length})`
|
||||
);
|
||||
|
||||
selectAllT2IAdapters(getState().controlAdapters).forEach((ca) => {
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
import { getShouldProcessPrompt } from 'features/dynamicPrompts/util/getShouldProcessPrompt';
|
||||
import { setPositivePrompt } from 'features/parameters/store/generationSlice';
|
||||
import { utilitiesApi } from 'services/api/endpoints/utilities';
|
||||
import { appSocketConnected } from 'services/events/actions';
|
||||
import { socketConnected } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '..';
|
||||
|
||||
@@ -20,7 +20,7 @@ const matcher = isAnyOf(
|
||||
combinatorialToggled,
|
||||
maxPromptsChanged,
|
||||
maxPromptsReset,
|
||||
appSocketConnected
|
||||
socketConnected
|
||||
);
|
||||
|
||||
export const addDynamicPromptsListener = () => {
|
||||
|
||||
@@ -1,37 +1,99 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import { isInitializedChanged } from 'features/system/store/systemSlice';
|
||||
import { size } from 'lodash-es';
|
||||
import { $baseUrl } from 'app/store/nanostores/baseUrl';
|
||||
import { isEqual, size } from 'lodash-es';
|
||||
import { atom } from 'nanostores';
|
||||
import { api } from 'services/api';
|
||||
import { queueApi, selectQueueStatus } from 'services/api/endpoints/queue';
|
||||
import { receivedOpenAPISchema } from 'services/api/thunks/schema';
|
||||
import { appSocketConnected, socketConnected } from 'services/events/actions';
|
||||
import { socketConnected } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
const $isFirstConnection = atom(true);
|
||||
|
||||
export const addSocketConnectedEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketConnected,
|
||||
effect: (action, { dispatch, getState }) => {
|
||||
const log = logger('socketio');
|
||||
|
||||
effect: async (
|
||||
action,
|
||||
{ dispatch, getState, cancelActiveListeners, delay }
|
||||
) => {
|
||||
log.debug('Connected');
|
||||
|
||||
const { nodeTemplates, config, system } = getState();
|
||||
/**
|
||||
* The rest of this listener has recovery logic for when the socket disconnects and reconnects.
|
||||
*
|
||||
* We need to re-fetch if something has changed while we were disconnected. In practice, the only
|
||||
* thing that could change while disconnected is a queue item finishes processing.
|
||||
*
|
||||
* The queue status is a proxy for this - if the queue status has changed, we need to re-fetch
|
||||
* the queries that may have changed while we were disconnected.
|
||||
*/
|
||||
|
||||
const { disabledTabs } = config;
|
||||
// Bail on the recovery logic if this is the first connection - we don't need to recover anything
|
||||
if ($isFirstConnection.get()) {
|
||||
$isFirstConnection.set(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!size(nodeTemplates.templates) && !disabledTabs.includes('nodes')) {
|
||||
// If we are in development mode, reset the whole API state. In this scenario, reconnects will
|
||||
// typically be caused by reloading the server, in which case we do want to reset the whole API.
|
||||
if (import.meta.env.MODE === 'development') {
|
||||
dispatch(api.util.resetApiState());
|
||||
}
|
||||
|
||||
// Else, we need to compare the last-known queue status with the current queue status, re-fetching
|
||||
// everything if it has changed.
|
||||
|
||||
if ($baseUrl.get()) {
|
||||
// If we have a baseUrl (e.g. not localhost), we need to debounce the re-fetch to not hammer server
|
||||
cancelActiveListeners();
|
||||
// Add artificial jitter to the debounce
|
||||
await delay(1000 + Math.random() * 1000);
|
||||
}
|
||||
|
||||
const prevQueueStatusData = selectQueueStatus(getState()).data;
|
||||
|
||||
try {
|
||||
// Fetch the queue status again
|
||||
const queueStatusRequest = dispatch(
|
||||
await queueApi.endpoints.getQueueStatus.initiate(undefined, {
|
||||
forceRefetch: true,
|
||||
})
|
||||
);
|
||||
const nextQueueStatusData = await queueStatusRequest.unwrap();
|
||||
queueStatusRequest.unsubscribe();
|
||||
|
||||
// If the queue hasn't changed, we don't need to do anything.
|
||||
if (isEqual(prevQueueStatusData?.queue, nextQueueStatusData.queue)) {
|
||||
return;
|
||||
}
|
||||
|
||||
//The queue has changed. We need to re-fetch everything that may have changed while we were
|
||||
// disconnected.
|
||||
dispatch(api.util.invalidateTags(['FetchOnReconnect']));
|
||||
} catch {
|
||||
// no-op
|
||||
log.debug('Unable to get current queue status on reconnect');
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
startAppListening({
|
||||
actionCreator: socketConnected,
|
||||
effect: async (action, { dispatch, getState }) => {
|
||||
const { nodeTemplates, config } = getState();
|
||||
// We only want to re-fetch the schema if we don't have any node templates
|
||||
if (
|
||||
!size(nodeTemplates.templates) &&
|
||||
!config.disabledTabs.includes('nodes')
|
||||
) {
|
||||
// This request is a createAsyncThunk - resetting API state as in the above listener
|
||||
// will not trigger this request, so we need to manually do it.
|
||||
dispatch(receivedOpenAPISchema());
|
||||
}
|
||||
|
||||
if (system.isInitialized) {
|
||||
// only reset the query caches if this connect event is a *reconnect* event
|
||||
dispatch(api.util.resetApiState());
|
||||
} else {
|
||||
dispatch(isInitializedChanged(true));
|
||||
}
|
||||
|
||||
// pass along the socket event as an application action
|
||||
dispatch(appSocketConnected(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketDisconnected,
|
||||
socketDisconnected,
|
||||
} from 'services/events/actions';
|
||||
import { socketDisconnected } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addSocketDisconnectedEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketDisconnected,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: () => {
|
||||
log.debug('Disconnected');
|
||||
|
||||
// pass along the socket event as an application action
|
||||
dispatch(appSocketDisconnected(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketGeneratorProgress,
|
||||
socketGeneratorProgress,
|
||||
} from 'services/events/actions';
|
||||
import { socketGeneratorProgress } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addGeneratorProgressEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketGeneratorProgress,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
|
||||
effect: (action) => {
|
||||
log.trace(action.payload, `Generator progress`);
|
||||
|
||||
dispatch(appSocketGeneratorProgress(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketGraphExecutionStateComplete,
|
||||
socketGraphExecutionStateComplete,
|
||||
} from 'services/events/actions';
|
||||
import { socketGraphExecutionStateComplete } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addGraphExecutionStateCompleteEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketGraphExecutionStateComplete,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
log.debug(action.payload, 'Session complete');
|
||||
// pass along the socket event as an application action
|
||||
dispatch(appSocketGraphExecutionStateComplete(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -15,21 +15,19 @@ import {
|
||||
import { boardsApi } from 'services/api/endpoints/boards';
|
||||
import { imagesApi } from 'services/api/endpoints/images';
|
||||
import { imagesAdapter } from 'services/api/util';
|
||||
import {
|
||||
appSocketInvocationComplete,
|
||||
socketInvocationComplete,
|
||||
} from 'services/events/actions';
|
||||
import { socketInvocationComplete } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
// These nodes output an image, but do not actually *save* an image, so we don't want to handle the gallery logic on them
|
||||
const nodeTypeDenylist = ['load_image', 'image'];
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addInvocationCompleteEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketInvocationComplete,
|
||||
effect: async (action, { dispatch, getState }) => {
|
||||
const log = logger('socketio');
|
||||
const { data } = action.payload;
|
||||
log.debug(
|
||||
{ data: parseify(data) },
|
||||
@@ -136,8 +134,6 @@ export const addInvocationCompleteEventListener = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
// pass along the socket event as an application action
|
||||
dispatch(appSocketInvocationComplete(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketInvocationError,
|
||||
socketInvocationError,
|
||||
} from 'services/events/actions';
|
||||
import { socketInvocationError } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addInvocationErrorEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketInvocationError,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
log.error(
|
||||
action.payload,
|
||||
`Invocation error (${action.payload.data.node.type})`
|
||||
);
|
||||
dispatch(appSocketInvocationError(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketInvocationRetrievalError,
|
||||
socketInvocationRetrievalError,
|
||||
} from 'services/events/actions';
|
||||
import { socketInvocationRetrievalError } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addInvocationRetrievalErrorEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketInvocationRetrievalError,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
log.error(
|
||||
action.payload,
|
||||
`Invocation retrieval error (${action.payload.data.graph_execution_state_id})`
|
||||
);
|
||||
dispatch(appSocketInvocationRetrievalError(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,23 +1,18 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketInvocationStarted,
|
||||
socketInvocationStarted,
|
||||
} from 'services/events/actions';
|
||||
import { socketInvocationStarted } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addInvocationStartedEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketInvocationStarted,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
|
||||
effect: (action) => {
|
||||
log.debug(
|
||||
action.payload,
|
||||
`Invocation started (${action.payload.data.node.type})`
|
||||
);
|
||||
|
||||
dispatch(appSocketInvocationStarted(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketModelLoadCompleted,
|
||||
appSocketModelLoadStarted,
|
||||
socketModelLoadCompleted,
|
||||
socketModelLoadStarted,
|
||||
} from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addModelLoadEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketModelLoadStarted,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
const { base_model, model_name, model_type, submodel } =
|
||||
action.payload.data;
|
||||
|
||||
@@ -23,16 +22,12 @@ export const addModelLoadEventListener = () => {
|
||||
}
|
||||
|
||||
log.debug(action.payload, message);
|
||||
|
||||
// pass along the socket event as an application action
|
||||
dispatch(appSocketModelLoadStarted(action.payload));
|
||||
},
|
||||
});
|
||||
|
||||
startAppListening({
|
||||
actionCreator: socketModelLoadCompleted,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
const { base_model, model_name, model_type, submodel } =
|
||||
action.payload.data;
|
||||
|
||||
@@ -43,8 +38,6 @@ export const addModelLoadEventListener = () => {
|
||||
}
|
||||
|
||||
log.debug(action.payload, message);
|
||||
// pass along the socket event as an application action
|
||||
dispatch(appSocketModelLoadCompleted(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import { queueApi, queueItemsAdapter } from 'services/api/endpoints/queue';
|
||||
import {
|
||||
appSocketQueueItemStatusChanged,
|
||||
socketQueueItemStatusChanged,
|
||||
} from 'services/events/actions';
|
||||
import { socketQueueItemStatusChanged } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addSocketQueueItemStatusChangedEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketQueueItemStatusChanged,
|
||||
effect: async (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
|
||||
// we've got new status for the queue item, batch and queue
|
||||
const { queue_item, batch_status, queue_status } = action.payload.data;
|
||||
|
||||
@@ -73,9 +70,6 @@ export const addSocketQueueItemStatusChangedEventListener = () => {
|
||||
'InvocationCacheStatus',
|
||||
])
|
||||
);
|
||||
|
||||
// Pass the event along
|
||||
dispatch(appSocketQueueItemStatusChanged(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketSessionRetrievalError,
|
||||
socketSessionRetrievalError,
|
||||
} from 'services/events/actions';
|
||||
import { socketSessionRetrievalError } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addSessionRetrievalErrorEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketSessionRetrievalError,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
log.error(
|
||||
action.payload,
|
||||
`Session retrieval error (${action.payload.data.graph_execution_state_id})`
|
||||
);
|
||||
dispatch(appSocketSessionRetrievalError(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketSubscribedSession,
|
||||
socketSubscribedSession,
|
||||
} from 'services/events/actions';
|
||||
import { socketSubscribedSession } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addSocketSubscribedEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketSubscribedSession,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
log.debug(action.payload, 'Subscribed');
|
||||
dispatch(appSocketSubscribedSession(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
import { logger } from 'app/logging/logger';
|
||||
import {
|
||||
appSocketUnsubscribedSession,
|
||||
socketUnsubscribedSession,
|
||||
} from 'services/events/actions';
|
||||
import { socketUnsubscribedSession } from 'services/events/actions';
|
||||
|
||||
import { startAppListening } from '../..';
|
||||
const log = logger('socketio');
|
||||
|
||||
export const addSocketUnsubscribedEventListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: socketUnsubscribedSession,
|
||||
effect: (action, { dispatch }) => {
|
||||
const log = logger('socketio');
|
||||
effect: (action) => {
|
||||
log.debug(action.payload, 'Unsubscribed');
|
||||
dispatch(appSocketUnsubscribedSession(action.payload));
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
import { modelChanged } from 'features/parameters/store/generationSlice';
|
||||
import { setActiveTab } from 'features/ui/store/uiSlice';
|
||||
import { NON_REFINER_BASE_MODELS } from 'services/api/constants';
|
||||
import {
|
||||
mainModelsAdapterSelectors,
|
||||
modelsApi,
|
||||
} from 'services/api/endpoints/models';
|
||||
|
||||
import { startAppListening } from '..';
|
||||
|
||||
export const addTabChangedListener = () => {
|
||||
startAppListening({
|
||||
actionCreator: setActiveTab,
|
||||
effect: async (action, { getState, dispatch }) => {
|
||||
const activeTabName = action.payload;
|
||||
if (activeTabName === 'unifiedCanvas') {
|
||||
const currentBaseModel = getState().generation.model?.base_model;
|
||||
|
||||
if (
|
||||
currentBaseModel &&
|
||||
['sd-1', 'sd-2', 'sdxl'].includes(currentBaseModel)
|
||||
) {
|
||||
// if we're already on a valid model, no change needed
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
// just grab fresh models
|
||||
const modelsRequest = dispatch(
|
||||
modelsApi.endpoints.getMainModels.initiate(NON_REFINER_BASE_MODELS)
|
||||
);
|
||||
const models = await modelsRequest.unwrap();
|
||||
// cancel this cache subscription
|
||||
modelsRequest.unsubscribe();
|
||||
|
||||
if (!models.ids.length) {
|
||||
// no valid canvas models
|
||||
dispatch(modelChanged(null));
|
||||
return;
|
||||
}
|
||||
|
||||
// need to filter out all the invalid canvas models (currently refiner & any)
|
||||
const validCanvasModels = mainModelsAdapterSelectors
|
||||
.selectAll(models)
|
||||
.filter((model) =>
|
||||
['sd-1', 'sd-2', 'sdxl'].includes(model.base_model)
|
||||
);
|
||||
|
||||
const firstValidCanvasModel = validCanvasModels[0];
|
||||
|
||||
if (!firstValidCanvasModel) {
|
||||
// no valid canvas models
|
||||
dispatch(modelChanged(null));
|
||||
return;
|
||||
}
|
||||
|
||||
const { base_model, model_name, model_type } = firstValidCanvasModel;
|
||||
|
||||
dispatch(modelChanged({ base_model, model_name, model_type }));
|
||||
} catch {
|
||||
// network request failed, bail
|
||||
dispatch(modelChanged(null));
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -4,40 +4,94 @@ import {
|
||||
combineReducers,
|
||||
configureStore,
|
||||
} from '@reduxjs/toolkit';
|
||||
import canvasReducer from 'features/canvas/store/canvasSlice';
|
||||
import { logger } from 'app/logging/logger';
|
||||
import { idbKeyValDriver } from 'app/store/enhancers/reduxRemember/driver';
|
||||
import { errorHandler } from 'app/store/enhancers/reduxRemember/errors';
|
||||
import { canvasPersistDenylist } from 'features/canvas/store/canvasPersistDenylist';
|
||||
import canvasReducer, {
|
||||
initialCanvasState,
|
||||
migrateCanvasState,
|
||||
} from 'features/canvas/store/canvasSlice';
|
||||
import changeBoardModalReducer from 'features/changeBoardModal/store/slice';
|
||||
import controlAdaptersReducer from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||
import { controlAdaptersPersistDenylist } from 'features/controlAdapters/store/controlAdaptersPersistDenylist';
|
||||
import controlAdaptersReducer, {
|
||||
initialControlAdaptersState,
|
||||
migrateControlAdaptersState,
|
||||
} from 'features/controlAdapters/store/controlAdaptersSlice';
|
||||
import deleteImageModalReducer from 'features/deleteImageModal/store/slice';
|
||||
import dynamicPromptsReducer from 'features/dynamicPrompts/store/dynamicPromptsSlice';
|
||||
import galleryReducer from 'features/gallery/store/gallerySlice';
|
||||
import hrfReducer from 'features/hrf/store/hrfSlice';
|
||||
import loraReducer from 'features/lora/store/loraSlice';
|
||||
import modelmanagerReducer from 'features/modelManager/store/modelManagerSlice';
|
||||
import nodesReducer from 'features/nodes/store/nodesSlice';
|
||||
import { dynamicPromptsPersistDenylist } from 'features/dynamicPrompts/store/dynamicPromptsPersistDenylist';
|
||||
import dynamicPromptsReducer, {
|
||||
initialDynamicPromptsState,
|
||||
migrateDynamicPromptsState,
|
||||
} from 'features/dynamicPrompts/store/dynamicPromptsSlice';
|
||||
import { galleryPersistDenylist } from 'features/gallery/store/galleryPersistDenylist';
|
||||
import galleryReducer, {
|
||||
initialGalleryState,
|
||||
migrateGalleryState,
|
||||
} from 'features/gallery/store/gallerySlice';
|
||||
import hrfReducer, {
|
||||
initialHRFState,
|
||||
migrateHRFState,
|
||||
} from 'features/hrf/store/hrfSlice';
|
||||
import loraReducer, {
|
||||
initialLoraState,
|
||||
migrateLoRAState,
|
||||
} from 'features/lora/store/loraSlice';
|
||||
import modelmanagerReducer, {
|
||||
initialModelManagerState,
|
||||
migrateModelManagerState,
|
||||
} from 'features/modelManager/store/modelManagerSlice';
|
||||
import { nodesPersistDenylist } from 'features/nodes/store/nodesPersistDenylist';
|
||||
import nodesReducer, {
|
||||
initialNodesState,
|
||||
migrateNodesState,
|
||||
} from 'features/nodes/store/nodesSlice';
|
||||
import nodeTemplatesReducer from 'features/nodes/store/nodeTemplatesSlice';
|
||||
import workflowReducer from 'features/nodes/store/workflowSlice';
|
||||
import generationReducer from 'features/parameters/store/generationSlice';
|
||||
import postprocessingReducer from 'features/parameters/store/postprocessingSlice';
|
||||
import workflowReducer, {
|
||||
initialWorkflowState,
|
||||
migrateWorkflowState,
|
||||
} from 'features/nodes/store/workflowSlice';
|
||||
import { generationPersistDenylist } from 'features/parameters/store/generationPersistDenylist';
|
||||
import generationReducer, {
|
||||
initialGenerationState,
|
||||
migrateGenerationState,
|
||||
} from 'features/parameters/store/generationSlice';
|
||||
import { postprocessingPersistDenylist } from 'features/parameters/store/postprocessingPersistDenylist';
|
||||
import postprocessingReducer, {
|
||||
initialPostprocessingState,
|
||||
migratePostprocessingState,
|
||||
} from 'features/parameters/store/postprocessingSlice';
|
||||
import queueReducer from 'features/queue/store/queueSlice';
|
||||
import sdxlReducer from 'features/sdxl/store/sdxlSlice';
|
||||
import sdxlReducer, {
|
||||
initialSDXLState,
|
||||
migrateSDXLState,
|
||||
} from 'features/sdxl/store/sdxlSlice';
|
||||
import configReducer from 'features/system/store/configSlice';
|
||||
import systemReducer from 'features/system/store/systemSlice';
|
||||
import uiReducer from 'features/ui/store/uiSlice';
|
||||
import { createStore as createIDBKeyValStore, get, set } from 'idb-keyval';
|
||||
import { systemPersistDenylist } from 'features/system/store/systemPersistDenylist';
|
||||
import systemReducer, {
|
||||
initialSystemState,
|
||||
migrateSystemState,
|
||||
} from 'features/system/store/systemSlice';
|
||||
import { uiPersistDenylist } from 'features/ui/store/uiPersistDenylist';
|
||||
import uiReducer, {
|
||||
initialUIState,
|
||||
migrateUIState,
|
||||
} from 'features/ui/store/uiSlice';
|
||||
import { diff } from 'jsondiffpatch';
|
||||
import { defaultsDeep, keys, omit, pick } from 'lodash-es';
|
||||
import dynamicMiddlewares from 'redux-dynamic-middlewares';
|
||||
import type { Driver } from 'redux-remember';
|
||||
import type { SerializeFunction, UnserializeFunction } from 'redux-remember';
|
||||
import { rememberEnhancer, rememberReducer } from 'redux-remember';
|
||||
import { serializeError } from 'serialize-error';
|
||||
import { api } from 'services/api';
|
||||
import { authToastMiddleware } from 'services/api/authToastMiddleware';
|
||||
import type { JsonObject } from 'type-fest';
|
||||
|
||||
import { STORAGE_PREFIX } from './constants';
|
||||
import { serialize } from './enhancers/reduxRemember/serialize';
|
||||
import { unserialize } from './enhancers/reduxRemember/unserialize';
|
||||
import { actionSanitizer } from './middleware/devtools/actionSanitizer';
|
||||
import { actionsDenylist } from './middleware/devtools/actionsDenylist';
|
||||
import { stateSanitizer } from './middleware/devtools/stateSanitizer';
|
||||
import { listenerMiddleware } from './middleware/listenerMiddleware';
|
||||
|
||||
const allReducers = {
|
||||
canvas: canvasReducer,
|
||||
gallery: galleryReducer,
|
||||
@@ -65,7 +119,7 @@ const rootReducer = combineReducers(allReducers);
|
||||
|
||||
const rememberedRootReducer = rememberReducer(rootReducer);
|
||||
|
||||
const rememberedKeys: (keyof typeof allReducers)[] = [
|
||||
const rememberedKeys = [
|
||||
'canvas',
|
||||
'gallery',
|
||||
'generation',
|
||||
@@ -80,15 +134,106 @@ const rememberedKeys: (keyof typeof allReducers)[] = [
|
||||
'lora',
|
||||
'modelmanager',
|
||||
'hrf',
|
||||
];
|
||||
] satisfies (keyof typeof allReducers)[];
|
||||
|
||||
// Create a custom idb-keyval store (just needed to customize the name)
|
||||
export const idbKeyValStore = createIDBKeyValStore('invoke', 'invoke-store');
|
||||
type SliceConfig = {
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
initialState: any;
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
migrate: (state: any) => any;
|
||||
};
|
||||
|
||||
// Create redux-remember driver, wrapping idb-keyval
|
||||
const idbKeyValDriver: Driver = {
|
||||
getItem: (key) => get(key, idbKeyValStore),
|
||||
setItem: (key, value) => set(key, value, idbKeyValStore),
|
||||
const sliceConfigs: {
|
||||
[key in (typeof rememberedKeys)[number]]: SliceConfig;
|
||||
} = {
|
||||
canvas: { initialState: initialCanvasState, migrate: migrateCanvasState },
|
||||
gallery: { initialState: initialGalleryState, migrate: migrateGalleryState },
|
||||
generation: {
|
||||
initialState: initialGenerationState,
|
||||
migrate: migrateGenerationState,
|
||||
},
|
||||
nodes: { initialState: initialNodesState, migrate: migrateNodesState },
|
||||
postprocessing: {
|
||||
initialState: initialPostprocessingState,
|
||||
migrate: migratePostprocessingState,
|
||||
},
|
||||
system: { initialState: initialSystemState, migrate: migrateSystemState },
|
||||
workflow: {
|
||||
initialState: initialWorkflowState,
|
||||
migrate: migrateWorkflowState,
|
||||
},
|
||||
ui: { initialState: initialUIState, migrate: migrateUIState },
|
||||
controlAdapters: {
|
||||
initialState: initialControlAdaptersState,
|
||||
migrate: migrateControlAdaptersState,
|
||||
},
|
||||
dynamicPrompts: {
|
||||
initialState: initialDynamicPromptsState,
|
||||
migrate: migrateDynamicPromptsState,
|
||||
},
|
||||
sdxl: { initialState: initialSDXLState, migrate: migrateSDXLState },
|
||||
lora: { initialState: initialLoraState, migrate: migrateLoRAState },
|
||||
modelmanager: {
|
||||
initialState: initialModelManagerState,
|
||||
migrate: migrateModelManagerState,
|
||||
},
|
||||
hrf: { initialState: initialHRFState, migrate: migrateHRFState },
|
||||
};
|
||||
|
||||
const unserialize: UnserializeFunction = (data, key) => {
|
||||
const log = logger('system');
|
||||
const config = sliceConfigs[key as keyof typeof sliceConfigs];
|
||||
if (!config) {
|
||||
throw new Error(`No unserialize config for slice "${key}"`);
|
||||
}
|
||||
try {
|
||||
const { initialState, migrate } = config;
|
||||
const parsed = JSON.parse(data);
|
||||
// strip out old keys
|
||||
const stripped = pick(parsed, keys(initialState));
|
||||
// run (additive) migrations
|
||||
const migrated = migrate(stripped);
|
||||
// merge in initial state as default values, covering any missing keys
|
||||
const transformed = defaultsDeep(migrated, initialState);
|
||||
|
||||
log.debug(
|
||||
{
|
||||
persistedData: parsed,
|
||||
rehydratedData: transformed,
|
||||
diff: diff(parsed, transformed) as JsonObject, // this is always serializable
|
||||
},
|
||||
`Rehydrated slice "${key}"`
|
||||
);
|
||||
return transformed;
|
||||
} catch (err) {
|
||||
log.warn(
|
||||
{ error: serializeError(err) },
|
||||
`Error rehydrating slice "${key}", falling back to default initial state`
|
||||
);
|
||||
return config.initialState;
|
||||
}
|
||||
};
|
||||
|
||||
const serializationDenylist: {
|
||||
[key in (typeof rememberedKeys)[number]]?: string[];
|
||||
} = {
|
||||
canvas: canvasPersistDenylist,
|
||||
gallery: galleryPersistDenylist,
|
||||
generation: generationPersistDenylist,
|
||||
nodes: nodesPersistDenylist,
|
||||
postprocessing: postprocessingPersistDenylist,
|
||||
system: systemPersistDenylist,
|
||||
ui: uiPersistDenylist,
|
||||
controlAdapters: controlAdaptersPersistDenylist,
|
||||
dynamicPrompts: dynamicPromptsPersistDenylist,
|
||||
};
|
||||
|
||||
export const serialize: SerializeFunction = (data, key) => {
|
||||
const result = omit(
|
||||
data,
|
||||
serializationDenylist[key as keyof typeof serializationDenylist] ?? []
|
||||
);
|
||||
return JSON.stringify(result);
|
||||
};
|
||||
|
||||
export const createStore = (uniqueStoreKey?: string, persist = true) =>
|
||||
@@ -114,6 +259,7 @@ export const createStore = (uniqueStoreKey?: string, persist = true) =>
|
||||
prefix: uniqueStoreKey
|
||||
? `${STORAGE_PREFIX}${uniqueStoreKey}-`
|
||||
: STORAGE_PREFIX,
|
||||
errorHandler,
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -124,21 +270,9 @@ export const createStore = (uniqueStoreKey?: string, persist = true) =>
|
||||
stateSanitizer,
|
||||
trace: true,
|
||||
predicate: (state, action) => {
|
||||
// TODO: hook up to the log level param in system slice
|
||||
// manually type state, cannot type the arg
|
||||
// const typedState = state as ReturnType<typeof rootReducer>;
|
||||
|
||||
// TODO: doing this breaks the rtk query devtools, commenting out for now
|
||||
// if (action.type.startsWith('api/')) {
|
||||
// // don't log api actions, with manual cache updates they are extremely noisy
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if (actionsDenylist.includes(action.type)) {
|
||||
// don't log other noisy actions
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -43,6 +43,16 @@ export type SDFeature =
|
||||
| 'vae'
|
||||
| 'hrf';
|
||||
|
||||
export type NumericalParameterConfig = {
|
||||
initial: number;
|
||||
sliderMin: number;
|
||||
sliderMax: number;
|
||||
numberInputMin: number;
|
||||
numberInputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Configuration options for the InvokeAI UI.
|
||||
* Distinct from system settings which may be changed inside the app.
|
||||
@@ -66,69 +76,32 @@ export type AppConfig = {
|
||||
defaultModel?: string;
|
||||
disabledControlNetModels: string[];
|
||||
disabledControlNetProcessors: (keyof typeof CONTROLNET_PROCESSORS)[];
|
||||
iterations: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
width: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
height: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
steps: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
guidance: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
img2imgStrength: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
hrfStrength: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
fineStep: number;
|
||||
coarseStep: number;
|
||||
};
|
||||
// Core parameters
|
||||
iterations: NumericalParameterConfig;
|
||||
width: NumericalParameterConfig; // initial value comes from model
|
||||
height: NumericalParameterConfig; // initial value comes from model
|
||||
steps: NumericalParameterConfig;
|
||||
guidance: NumericalParameterConfig;
|
||||
cfgRescaleMultiplier: NumericalParameterConfig;
|
||||
img2imgStrength: NumericalParameterConfig;
|
||||
// Canvas
|
||||
boundingBoxHeight: NumericalParameterConfig; // initial value comes from model
|
||||
boundingBoxWidth: NumericalParameterConfig; // initial value comes from model
|
||||
scaledBoundingBoxHeight: NumericalParameterConfig; // initial value comes from model
|
||||
scaledBoundingBoxWidth: NumericalParameterConfig; // initial value comes from model
|
||||
canvasCoherenceStrength: NumericalParameterConfig;
|
||||
canvasCoherenceSteps: NumericalParameterConfig;
|
||||
infillTileSize: NumericalParameterConfig;
|
||||
infillPatchmatchDownscaleSize: NumericalParameterConfig;
|
||||
// Misc advanced
|
||||
clipSkip: NumericalParameterConfig; // slider and input max are ignored for this, because the values depend on the model
|
||||
maskBlur: NumericalParameterConfig;
|
||||
hrfStrength: NumericalParameterConfig;
|
||||
dynamicPrompts: {
|
||||
maxPrompts: {
|
||||
initial: number;
|
||||
min: number;
|
||||
sliderMax: number;
|
||||
inputMax: number;
|
||||
};
|
||||
maxPrompts: NumericalParameterConfig;
|
||||
};
|
||||
ca: {
|
||||
weight: NumericalParameterConfig;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||