Commit Graph

1707 Commits

Author SHA1 Message Date
blessedcoolant
b6522cf2cf fix: SDXL - Concat Prompt and Style for Style Prompt 2023-07-26 13:30:43 -04:00
Brandon Rising
861c0fe76b Correct issues caused by merging main 2023-07-26 12:25:46 -04:00
Lincoln Stein
af8fc6ff82 final polish before release candidate
- Fix issue that prevented web ui from starting if
  ROOT/databases/invokeai.db not found.

- Rebuild front end
2023-07-26 10:59:23 -04:00
Mary Hipp
f86d0d1b69 hide localization toggle 2023-07-26 10:55:38 -04:00
Brandon Rising
c16da75ac7 Merge branch 'main' into feat/onnx 2023-07-26 10:42:31 -04:00
Lincoln Stein
f060e321eb
NSFW checker and watermark nodes (#3923)
## What type of PR is this? (check all applicable)

- [ ] Refactor
- [ X] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Community Node Submission


## Have you discussed this change with the InvokeAI team?
- [ X] Yes
- [ ] No, because:

      
## Have you updated all relevant documentation?
- [X ] Yes
- [] No

## Description

This PR adds NSFW checker and invisible watermark fields. The NSFW
checker takes an image input and produces an image output. If NSFW
content is detected, the output image will be blurred and a "caution"
icon pasted into its upper left corner. A boolean `active` field
controls whether the checker is active. If turned off it simply returns
a copy of the image.

The invisible watermark node adds an invisible text to the image,
defaulting to "InvokeAI". To decode the watermark use the
`invisible-watermark` command, which is part of the
`invisible-watermark` library:

```
$ invisible-watermark -v -a decode -t bytes -m dwtDct -l 64 ./bluebird-watermark.png 
decode time ms: 14.129877090454102
InvokeAI
```

Note that the `-l` (length) argument is mandatory. It is set to 64 here
because the watermark `InvokeAI` is 8 bytes/64 bits long. The length
must match in order for the watermark to be decoded correctly.

Both nodes are now incorporated into the linear Text2Image and
Image2Image UIs, including the canvas. They are not implemented for
inpaint currently.

The nodes can be disabled with configuration options:
```
invisible_watermark: false
nsfw_checker: false
```
or at launch time with `--no-invisible_watermark` and
`--no-nsfw_checker`.
2023-07-26 10:14:10 -04:00
psychedelicious
dc8c3d8073 feat(ui): tweak menu style, increase icon size
feat(ui) use `as` for menuitem links

I had requested this be done with the chakra `Link` component, but actually using `as` is correct according to the docs. For other components, you are supposed to use `Link` but looks like `MenuItem` has this built in.

Fixed in all places where we use it.

Also:
- fix github icon
- give menu hamburger button padding
- add menu motion props so it animates the same as other menus

feat(ui): restore ColorModeButton

@maryhipp

chore(ui): lint

feat(ui): remove colormodebutton again

sry
2023-07-27 00:12:23 +10:00
psychedelicious
819136c345 chore(ui): bump chakra versions
exposes more menu theming config
2023-07-27 00:12:23 +10:00
blessedcoolant
989b68c772 fix: Remove menu tooltip and fix incorrect issues page link 2023-07-27 00:12:23 +10:00
blessedcoolant
a6347a1d3c revert: Translation strings
These needs to be done through weblate. Only en.json needs to updated via the repo
2023-07-27 00:12:23 +10:00
blessedcoolant
a00d1e87e4 fix: Update Links to Links from Menu Items 2023-07-27 00:12:23 +10:00
blessedcoolant
c7d24081e2 fix: Scheduler list in Settings not displaying labels 2023-07-27 00:12:23 +10:00
blessedcoolant
17900e5140 fix: Fix Settings dropdown menu icons being too small 2023-07-27 00:12:23 +10:00
Josh Corbett
6fa42cb10c feat: consolidated app nav to settings & dropdown 2023-07-27 00:12:23 +10:00
Lincoln Stein
4bea846199
Merge branch 'main' into feat/safety-checker-node 2023-07-26 10:04:23 -04:00
Lincoln Stein
bf0587da5f set defaults for watermark and NSFW checker to FALSE 2023-07-26 09:09:46 -04:00
Lincoln Stein
da76f6fee4 compress height needed by configure script 2023-07-26 08:00:19 -04:00
Lincoln Stein
c4f064bbf3 Merge branch 'main' into feat/controlnet-and-sdxl-convert 2023-07-26 07:30:22 -04:00
Lincoln Stein
ce7fa96dbc Merge branch 'main' into feat/safety-checker-node 2023-07-26 06:39:46 -04:00
mickr777
36455f6cac
Merge branch 'main' into nodepromptsize 2023-07-26 18:54:54 +10:00
psychedelicious
30c3b7a6fc fix(ui): fix invoke button being disabled 2023-07-26 18:40:17 +10:00
mickr777
2d0f932737
Lint Code 2023-07-26 18:35:04 +10:00
blessedcoolant
9e9dce44b4 fix: Embeddings not being sorted alphabetically 2023-07-26 20:34:14 +12:00
blessedcoolant
6fd8543e69 fix: LoRA's not being sorted alphabetically 2023-07-26 20:33:59 +12:00
psychedelicious
db48f3230b feat(ui): add nsfw & watermark to linear ui
- add `addNSFWCheckerToGraph` and `addWatermarkerToGraph` functions
- use them in all linear graph creation
- add state & toggles to settings modal to enable these
- trigger queries for app config on socket connect
- disable the nsfw/watermark booleans if we get the app config and they are not available
2023-07-26 18:20:20 +10:00
blessedcoolant
397604a094 feat: Allow LoRA weights to be more than sliders via input
Found some LoRA's that need it.
2023-07-26 19:20:42 +12:00
blessedcoolant
f5139b174a fix(ui): Rename Aspect Ratio labels to their aspect ratios 2023-07-26 18:56:52 +12:00
blessedcoolant
050e5091db feat: Enable the Conversion button for SDXL Models 2023-07-26 17:32:50 +12:00
Lincoln Stein
5beb11f4e2 tweaks in response to psychedelicious review of PR 2023-07-26 15:27:04 +10:00
Lincoln Stein
844d37c642 rebuild schema 2023-07-26 15:27:04 +10:00
Lincoln Stein
bd43751323 update linear graphs to perform safety checking and watermarking 2023-07-26 15:27:04 +10:00
Lincoln Stein
e32cd794f7 add safetychecker and watermark nodes 2023-07-26 15:26:45 +10:00
mickr777
761fc4beb8 Temp fix for is intermediate switch for l2i 2023-07-26 15:17:59 +10:00
psychedelicious
676051edb9 fix(ui): fix missing args for model queries 2023-07-26 14:56:51 +10:00
blessedcoolant
de65b82569 chore: Fix lint errors 2023-07-26 16:51:58 +12:00
blessedcoolant
934f9afd7e feat(ui): Do not show SDXL Models in Canvas 2023-07-26 14:46:38 +10:00
psychedelicious
1c01a31ee8 feat(ui): setActiveTab only works with tab names 2023-07-26 14:46:38 +10:00
psychedelicious
c5389b3298 fix(ui): fix refiner steps math again 2023-07-26 14:46:38 +10:00
psychedelicious
fdbab5ffa9 feat(ui): hide sync models button if feature is disabled 2023-07-26 14:46:38 +10:00
psychedelicious
a6e544ebd5 fix(ui): fix refiner steps calculation for edge case of start = 1 2023-07-26 14:46:38 +10:00
psychedelicious
75b0507434 feat(nodes): change denoising start/end min/max to 0/1 2023-07-26 14:46:38 +10:00
blessedcoolant
59c2556e6b feat: Move SDXL Image Denoising to own component 2023-07-26 14:46:38 +10:00
blessedcoolant
4fe889bbf8 fix: Possible fix to image to image / refiner setting sync
The main goal is to avoid noisy output no matter what the slider values are.
2023-07-26 14:46:38 +10:00
psychedelicious
cbcd416b70 fix(ui): fix refiner missing from model manager
Rolled back the earlier split of the refiner model query.

Now, when you use `useGetMainModelsQuery()`, you must provide it an array of base model types.

They are provided as constants for simplicity:
- ALL_BASE_MODELS
- NON_REFINER_BASE_MODELS
- REFINER_BASE_MODELS

Opted to just use args for the hook instead of wrapping the hook in another hook, we can tidy this up later if desired.
2023-07-26 14:46:38 +10:00
psychedelicious
6fa244a343 feat(ui): add vae precision select 2023-07-26 14:46:38 +10:00
psychedelicious
e5a660930c feat(ui): add zod schemas for precision parameters 2023-07-26 14:46:38 +10:00
psychedelicious
61291ea105 feat: sdxl metadata
- update `CoreMetadata` class & `MetadataAccumulator` with fields for SDXL-specific metadata
- update the linear UI graphs to populate this metadata
2023-07-26 14:46:38 +10:00
psychedelicious
016797c890 feat(ui): add vaePrecision setting
no UI element for it yet
2023-07-26 14:46:38 +10:00
psychedelicious
00e69d5d12 feat(ui): adjust seed param styling 2023-07-26 14:46:38 +10:00
psychedelicious
8e90f9024d feat(ui): remove isRefinerAvailable state, update refiner node
We can derive `isRefinerAvailable` from the query result (eg are there any refiner models installed). This is a piece of server state, so by using the list models response directly, we can avoid needing to manually keep the client in sync with the server.

Created a `useIsRefinerAvailable()` hook to return this boolean wherever it is needed.

Also updated the main models & refiner models endpoints to only return the appropriate models. Now we don't need to filter the data on these endpoints.
2023-07-26 14:46:38 +10:00
psychedelicious
751c4407e4 feat(ui): add node type to invocation started 2023-07-26 14:46:38 +10:00
blessedcoolant
6c46304eb8 fix: Replug Image To Latents VAE back in the Refiner graph for img2img 2023-07-26 14:46:38 +10:00
blessedcoolant
0eb31c5710 fix: Cyclic push in the graph 2023-07-26 14:46:38 +10:00
blessedcoolant
6295e56d96 feat: Add SDXL Refiner to Linear UI 2023-07-26 14:46:38 +10:00
blessedcoolant
5202610160 feat: Move SDXL Refiner to own route & set appropriate disabled statuses 2023-07-26 14:46:38 +10:00
blessedcoolant
8d1b8179af feat: Create UI for SDXL Refiner Options 2023-07-26 14:46:38 +10:00
blessedcoolant
3bdb059eb7 wip: SDXL Refiner UI Data 2023-07-26 14:46:38 +10:00
blessedcoolant
b0ebd148fa feat: Add Style Prompts to Linear UI 2023-07-26 14:46:38 +10:00
blessedcoolant
9f94d0e52a feat: Create SDXL Slice 2023-07-26 14:46:38 +10:00
blessedcoolant
9c180da58a feat: Add SDXL Image To Image to Linear UI 2023-07-26 14:46:38 +10:00
blessedcoolant
57d833035d feat: Add SDXL Base To Linear Text To Image 2023-07-26 14:46:38 +10:00
Mary Hipp
7f5a89f567 add option to disable model syncing in UI 2023-07-26 11:18:38 +10:00
Lincoln Stein
e43e198102 rework configure/install TUI to require less space 2023-07-25 11:25:26 -04:00
blessedcoolant
7ea477abef
Merge branch 'main' into feat/canvas-generation-mode 2023-07-24 20:34:25 +12:00
psychedelicious
61fa960a18 feat(ui): make generation mode calculation more granular 2023-07-24 18:16:15 +10:00
blessedcoolant
1969afd038
Merge branch 'main' into feat/fix-soft-locks 2023-07-24 20:12:10 +12:00
psychedelicious
d5a75eb833 feat: increase seed from int32 to uint32
At some point I typo'd this and set the max seed to signed int32 max. It should be *un*signed int32 max.

This restored the seed range to what it was in v2.3.
2023-07-24 16:34:50 +10:00
psychedelicious
28031ead70 feat(ui): display canvas generation mode in status text
- use the existing logic to determine if generation is txt2img, img2img, inpaint or outpaint
- technically `outpaint` and `inpaint` are the same, just display
"Inpaint" if its either
- debounce this by 1s to prevent jank
2023-07-23 23:22:59 +10:00
psychedelicious
4b334be7d0 feat(nodes,ui): fix soft locks on session/invocation retrieval
When a queue item is popped for processing, we need to retrieve its session from the DB. Pydantic serializes the graph at this stage.

It's possible for a graph to have been made invalid during the graph preparation stage (e.g. an ancestor node executes, and its output is not valid for its successor node's input field).

When this occurs, the session in the DB will fail validation, but we don't have a chance to find out until it is retrieved and parsed by pydantic.

This logic was previously not wrapped in any exception handling.

Just after retrieving a session, we retrieve the specific invocation to execute from the session. It's possible that this could also have some sort of error, though it should be impossible for it to be a pydantic validation error (that would have been caught during session validation). There was also no exception handling here.

When either of these processes fail, the processor gets soft-locked because the processor's cleanup logic is never run. (I didn't dig deeper into exactly what cleanup is not happening, because the fix is to just handle the exceptions.)

This PR adds exception handling to both the session retrieval and node retrieval and events for each: `session_retrieval_error` and `invocation_retrieval_error`.

These events are caught and displayed in the UI as toasts, along with the type of the python exception (e.g. `Validation Error`). The events are also logged to the browser console.
2023-07-23 21:41:01 +10:00
mickr777
de73e4f5b9
Merge branch 'main' into nodepromptsize 2023-07-23 18:28:25 +10:00
blessedcoolant
af4579b4d4 feat: Add more sanity checks for graph loading 2023-07-23 18:12:25 +12:00
blessedcoolant
35acb5de76 Merge branch 'main' into json-crash-fix 2023-07-23 16:50:36 +12:00
blessedcoolant
225f608556 fix: Add more sanity checks & rename buttons to Graphs 2023-07-23 16:49:52 +12:00
Alexandre Macabies
00d3cd4aed Fix 'Del' hotkey to delete current image. 2023-07-23 14:16:32 +10:00
blessedcoolant
fdc444ed61 fix: Fix app crashing when you upload an incorrect JSON to node editor 2023-07-23 15:24:04 +12:00
psychedelicious
c5147d0f57 fix(ui): fix all eslint & prettier issues 2023-07-22 23:45:24 +10:00
psychedelicious
6452d0fc28 fix(ui): fix all circular dependencies 2023-07-22 22:48:39 +10:00
psychedelicious
5468d9a9fc fix(ui): resolve all typescript issues 2023-07-22 21:38:50 +10:00
psychedelicious
75863e7181 feat(ui): logging cleanup
- simplify access to app logger
- spruce up and make consistent log format
- improve messaging
2023-07-22 21:12:51 +10:00
mickr777
0689e36390
Merge branch 'main' into nodepromptsize 2023-07-22 07:20:28 +10:00
Lincoln Stein
19cdd5a99b rebuild frontend for release 2023-07-21 07:48:30 -04:00
psychedelicious
594bf6fef1 fix(api,ui): fix canvas saved images have extra transparent regions
- add `crop_visible` param to upload image & set to true only for canvas saves
2023-07-21 07:26:12 -04:00
psychedelicious
6f2e8d5217 chore(ui): regen types 2023-07-21 07:26:12 -04:00
psychedelicious
52ae15c167 fix(ui): fix console error related to css 2023-07-21 07:26:12 -04:00
psychedelicious
2c4128d44e fix(ui): deleting board does not reset selected board/image 2023-07-21 07:26:12 -04:00
psychedelicious
01b106d939 fix(ui): fix no image selected on first load 2023-07-21 07:26:12 -04:00
psychedelicious
68f1f87c6f feat(ui): board styles 2023-07-21 07:26:12 -04:00
psychedelicious
c2c99b8650 feat(ui): fix more caching bugs 2023-07-21 07:26:12 -04:00
Lincoln Stein
fba4085939
ui: boards 2: electric boogaloo (#3869)
## What type of PR is this? (check all applicable)

- [x] Refactor
- [ ] Feature
- [ ] Bug Fix
- [ ] Optimization
- [ ] Documentation Update
- [ ] Community Node Submission


## Have you discussed this change with the InvokeAI team?
- [x] Yes
- [ ] No, because:


## Description

Revised boards logic and UI

## Related Tickets & Documents

<!--
For pull requests that relate or close an issue, please include them
below. 

For example having the text: "closes #1234" would connect the current
pull
request to issue 1234.  And when we merge the pull request, Github will
automatically close the issue.
-->

- Related Issue # discord convos
- Closes #

## QA Instructions, Screenshots, Recordings

<!-- 
Please provide steps on how to test changes, any hardware or 
software specifications as well as any other pertinent information. 
-->

## Added/updated tests?

- [ ] Yes
- [x] No : n/a

## [optional] Are there any post deployment tasks we need to perform?
2023-07-21 06:42:16 -04:00
mickr777
13e7614508
add text so string node uses textarea 2023-07-21 19:36:27 +10:00
blessedcoolant
9ce4bd1182 fix: Simplify gallery board name layout 2023-07-21 18:15:55 +12:00
blessedcoolant
39b7ace273 fix: Differentiate no boards from the user boards 2023-07-21 18:15:12 +12:00
blessedcoolant
319c56f844 fix: Make auto add icon be a tad bit smaller 2023-07-21 18:14:57 +12:00
psychedelicious
389a0d2810 feat(ui): use badge for autoadd 2023-07-21 16:01:40 +10:00
psychedelicious
fe33acedad fix(ui): fix crash when removing last image 2023-07-21 15:57:09 +10:00
psychedelicious
eab18c7385 fix(ui): fix incorrect gallery tab 2023-07-21 15:56:50 +10:00
psychedelicious
8e98085530 fix(ui): fix missing 'none' on no-board cache updates 2023-07-21 15:53:41 +10:00
psychedelicious
5396e998b3 feat(ui): simplify auto-add context menu 2023-07-21 15:47:12 +10:00
psychedelicious
fc98089960 fix(ui): debounce metadata query on context menu 2023-07-21 15:37:33 +10:00
psychedelicious
dd0b4dc744 fix(ui): fix next prev buttons 2023-07-21 15:37:20 +10:00
psychedelicious
ddeba190bc fix(ui): really fixed autoadd context menu 2023-07-21 15:18:48 +10:00
psychedelicious
3a610e1a65 fix(ui): more fixing of auto-add 2023-07-21 15:00:07 +10:00
psychedelicious
e10e22440d fix(ui): restore auto-add to board functionality 2023-07-21 14:29:42 +10:00
psychedelicious
f4e8a91bcf fix(ui): update boardIdSelected 2023-07-21 14:22:18 +10:00
psychedelicious
4da6623700 fix(ui): fix deleteboard cache changes 2023-07-21 14:16:19 +10:00
mickr777
4e1786d9ae
Remove Resize: none 2023-07-21 13:55:40 +10:00
psychedelicious
0e3ca59e49 feat(ui): refactor boards hierarchy 2023-07-21 13:48:15 +10:00
mickr777
585520d8d2
Only apply Textaera to Prompt 2023-07-21 13:17:27 +10:00
Lincoln Stein
46801c076f
Merge branch 'main' into release/invokeai-3-0-rc 2023-07-20 23:16:05 -04:00
Kent Keirsey
8e7f581065
Update FoundModelsList.tsx 2023-07-20 20:51:54 -04:00
mickr777
98b2734240
Merge branch 'main' into nodepromptsize 2023-07-21 08:07:55 +10:00
mickr777
7b428b5240
Make height smaller and allow width to change with node 2023-07-21 08:03:01 +10:00
blessedcoolant
52d56e96a5 fix: No board name being displayed if it is empty 2023-07-21 05:07:50 +12:00
Lincoln Stein
17e401cb8c rebuild frontend 2023-07-20 11:47:04 -04:00
Lincoln Stein
7deafa838b merge with main 2023-07-20 11:45:54 -04:00
psychedelicious
cd21d2f2b6 fix(ui): fix no_board cache not updating
two areas marked TODO were not TODONE!
2023-07-20 23:50:14 +10:00
Mary Hipp
9dc28373d8 use brackets 2023-07-20 23:45:49 +10:00
Mary Hipp
ffe7d5785b if updating intermediate, dont add to gallery list cache 2023-07-20 23:45:49 +10:00
blessedcoolant
e2240feae4 fix: Chevron icon styling 2023-07-21 01:21:04 +12:00
blessedcoolant
e06348bfab fix: Expand chevron icon being too small 2023-07-21 01:14:19 +12:00
blessedcoolant
8fb970d436 fix: Use layout gap to control layout instead of margin 2023-07-21 01:07:00 +12:00
blessedcoolant
15256ed3a4 fix: Layout shift on the ControlNet Panel 2023-07-21 01:04:16 +12:00
blessedcoolant
8fc20c837b Merge branch 'main' into feat/controlnet-resize-mode 2023-07-21 00:58:28 +12:00
blessedcoolant
8dfe196c4f feat: Add Image Count to Board Name 2023-07-20 22:56:52 +10:00
psychedelicious
9e27fd9b90 feat(ui): color tweak on board 2023-07-20 22:56:52 +10:00
psychedelicious
2771328853 feat(ui): reduce saturation by 8% for 1337 contrast 2023-07-20 22:56:52 +10:00
psychedelicious
a481607d3f feat(ui): boards are only punch-you-in-the-face-purple if selected 2023-07-20 22:56:52 +10:00
psychedelicious
1e3cebbf42 feat(ui): add useBoardTotal hook to get total items in board
actually not using it now, but it's there
2023-07-20 22:56:52 +10:00
blessedcoolant
d523556558 fix: Truncate board name if longer than 20 chars 2023-07-20 22:56:52 +10:00
blessedcoolant
da523fa32f fix: Editable text aligning left instead of inplace. 2023-07-20 22:56:52 +10:00
blessedcoolant
ab9b5f3b95 fix: Possible fix to the name plate getting displaced 2023-07-20 22:56:52 +10:00
blessedcoolant
f32bd5dd10 fix: Minor color tweaks to the name plate on boards 2023-07-20 22:56:52 +10:00
psychedelicious
190ba5af59 feat(ui): boards styling 2023-07-20 22:56:52 +10:00
blessedcoolant
2872ae2aab fix: Adjust layout of Resize Mode dropdown
Moved it next to ControlMode to make it more compact
2023-07-20 22:53:45 +12:00
blessedcoolant
b7cdda0781 feat: Add ControlNet Resize Mode to Linear UI 2023-07-20 22:48:35 +12:00
mickr777
f73b45bcb5
Feat: Change Input to Textbox 2023-07-20 19:11:18 +10:00
blessedcoolant
0795d8764f
Merge branch 'main' into fix/post-model-sync 2023-07-20 20:16:14 +12:00
blessedcoolant
82eb1f1075 feat: Add Sync Models to UI 2023-07-20 18:50:43 +12:00
psychedelicious
187cf906fa
ui: enhance intermediates clear, enhance board auto-add (#3851)
* feat(ui): enhance clear intermediates feature

- retrieve the # of intermediates using a new query (just uses list images endpoint w/ limit of 0)
- display the count in the UI
- add types for clearIntermediates mutation
- minor styling and verbiage changes

* feat(ui): remove unused settings option for guides

* feat(ui): use solid badge variant

consistent with the rest of the usage of badges

* feat(ui): update board ctx menu, add board auto-add

- add context menu to system boards - only open is select board. did this so that you dont think its broken when you click it
- add auto-add board. you can right click a user board to enable it for auto-add, or use the gallery settings popover to select it. the invoke button has a tooltip on a short delay to remind you that you have auto-add enabled
- made useBoardName hook, provide it a board id and it gets your the board name
- removed `boardIdToAdTo` state & logic, updated workflows to auto-switch and auto-add on image generation

* fix(ui): clear controlnet when clearing intermediates

* feat: Make Add Board icon a button

* feat(db, api): clear intermediates now clears all of them

* feat(ui): make reset webui text subtext style

* feat(ui): board name change submits on blur

---------

Co-authored-by: blessedcoolant <54517381+blessedcoolant@users.noreply.github.com>
2023-07-20 17:44:22 +12:00
blessedcoolant
6e36c275c9
feat: Add Setting Switch Component (#3847) 2023-07-20 14:17:51 +12:00
blessedcoolant
f6d5e93020
fix: Model List not scrolling through checkpoints (#3849) 2023-07-20 14:16:32 +12:00
Brandon Rising
23f4a4ea1a Fix dist 2023-07-19 18:27:51 -04:00
Brandon Rising
6aab8f16ce Fix issue from merge 2023-07-19 18:27:15 -04:00
Brandon Rising
8f61413865 Setup dist folder 2023-07-19 17:49:27 -04:00
Brandon Rising
43b6a077fb io binding seems to be massively resource intensive compared to session.run 2023-07-19 17:42:28 -04:00
Lincoln Stein
495df9fd1b bump version to 3.0.0rc1 2023-07-19 12:36:39 -04:00
Mary Hipp Rogers
0073fc8619
add toggle for isNodesEnabled in settings (#3839)
Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
2023-07-19 16:08:28 +00:00
psychedelicious
0724eb9e0a
feat(ui): another go at gallery (#3791)
* feat(ui): migrate listImages to RTK query using createEntityAdapter

- see comments in `endpoints/images.ts` for explanation of the caching
- so far, only manually updating `all` images when new image is generated. no other manual cache updates are implemented, but will be needed.
- fixed some weirdness with loading state components (like the spinners in gallery)
- added `useThumbnailFallback` for `IAIDndImage`, this displays the tiny webp thumbnail while the full-size images load
- comment out some old thunk related stuff in gallerySlice, which is no longer needed

* feat(ui): add manual cache updates for board changes (wip)

- update RTK Query caches when adding/removing single image to/from board
- work more on migrating all image-related operations to RTK Query

* update AddImagesToBoardContext so that it works when user uses context menu + modal

* handle case where no image is selected

* get assets working for main list and boards - dnd only

* feat(ui): migrate image uploads to RTK Query

- minor refactor of `ImageUploader` and `useImageUploadButton` hooks, simplify some logic
- style filesystem upload overlay to match existing UI
- replace all old `imageUploaded` thunks with `uploadImage` RTK Query calls, update associated logic including canvas related uploads
- simplify `PostUploadAction`s that only need to display user input

* feat(ui): remove `receivedPageOfImages` thunks

* feat(ui): remove `receivedImageUrls` thunk

* feat(ui): finish removing all images thunks

stuff now broken:
- image usage
- delete board images
- on first load, no image selected

* feat(ui): simplify `updateImage` cache manipulation

- we don't actually ever change categories, so we can remove a lot of logic

* feat(ui): simplify canvas autosave

- instead of using a network request to set the canvas generation as not intermediate, we can just do that in the graph

* feat(ui): simplify & handle edge cases in cache updates

* feat(db, api): support `board_id='none'` for `get_many` images queries

This allows us to get all images that are not on a board.

* chore(ui): regen types

* feat(ui): add `All Assets`, `No Board` boards

Restructure boards:
- `all images` is all images
- `all assets` is all assets
- `no board` is all images/assets without a board set
- user boards may have images and assets

Update caching logic
- much simpler without every board having sub-views of images and assets
- update drag and drop operations for all possible interactions

* chore(ui): regen types

* feat(ui): move download to top of context menu

* feat(ui): improve drop overlay styles

* fix(ui): fix image not selected on first load

- listen for first load of all images board, then select the first image

* feat(ui): refactor board deletion

api changes:
- add route to list all image names for a board. this is required to handle board + image deletion. we need to know every image in the board to determine the image usage across the app. this is fetched only when the delete board and images modal is opened so it's as efficient as it can be.
- update the delete board route to respond with a list of deleted `board_images` and `images`, as image names. this is needed to perform accurate clientside state & cache updates after deleting.

db changes:
- remove unused `board_images` service method to get paginated images dtos for a board. this is now done thru the list images endpoint & images service. needs a small logic change on `images.delete_images_on_board`

ui changes:
- simplify the delete board modal - no context, just minor prop drilling. this is feasible for boards only because the components that need to trigger and manipulate the modal are very close together in the tree
- add cache updates for `deleteBoard` & `deleteBoardAndImages` mutations
- the only thing we cannot do directly is on `deleteBoardAndImages`, update the `No Board` board. we'd need to insert image dtos that we may not have loaded. instead, i am just invalidating the tags for that `listImages` cache. so when you `deleteBoardAndImages`, the `No Board` will re-fetch the initial image limit. i think this is more efficient than e.g. fetching all image dtos to insert then inserting them.
- handle image usage for `deleteBoardAndImages`
- update all (i think/hope) the little bits and pieces in the UI to accomodate these changes

* fix(ui): fix board selection logic

* feat(ui): add delete board modal loading state

* fix(ui): use thumbnails for board cover images

* fix(ui): fix race condition with board selection

when selecting a board that doesn't have any images loaded, we need to wait until the images haveloaded before selecting the first image.

this logic is debounced to ~1000ms.

* feat(ui): name 'No Board' correctly, change icon

* fix(ui): do not cache listAllImageNames query

if we cache it, we can end up with stale image usage during deletion.

we could of course manually update the cache as we are doing elsewhere. but because this is a relatively infrequent network request, i'd like to trade increased cache mgmt complexity here for increased resource usage.

* feat(ui): reduce drag preview opacity, remove border

* fix(ui): fix incorrect queryArg used in `deleteImage` and `updateImage` cache updates

* fix(ui): fix doubled open in new tab

* fix(ui): fix new generations not getting added to 'No Board'

* fix(ui): fix board id not changing on new image when autosave enabled

* fix(ui): context menu when selection is 0

need to revise how context menu is triggered later, when we approach multi select

* fix(ui): fix deleting does not update counts for all images and all assets

* fix(ui): fix all assets board name in boards list collapse button

* fix(ui): ensure we never go under 0 for total board count

* fix(ui): fix text overflow on board names

---------

Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
2023-07-19 12:06:38 -04:00
Mary Hipp
055f5b2d4b clear canvas alongside intermediates 2023-07-19 11:39:24 -04:00
Mary Hipp Rogers
9f00e055ac
Maryhipp/clear intermediates (#3820)
* new route to clear intermediates

* UI to clear intermediates from settings modal

* cleanup

* PR feedback

---------

Co-authored-by: Mary Hipp <maryhipp@Marys-MacBook-Air.local>
2023-07-19 10:55:29 -04:00