Commit Graph

435 Commits

Author SHA1 Message Date
psychedelicious
7dff8ccd31 Styles buttons for clearing canvas history and mask 2022-11-27 03:35:49 +13:00
psychedelicious
3f6b275bec Image gallery resize/style tweaks 2022-11-27 03:35:49 +13:00
psychedelicious
5ed6a31b97 Removes reasonsWhyNotReady
The popover doesn't play well with the button being disabled, and I don't think adds any value.
2022-11-27 03:35:49 +13:00
psychedelicious
b72b61b790 Styling updates 2022-11-27 03:35:49 +13:00
psychedelicious
b81231823e Builds fresh bundle 2022-11-27 03:35:49 +13:00
psychedelicious
6c33d1356d Removes unused imports 2022-11-27 03:35:49 +13:00
psychedelicious
f08c78a043 Minor bugfixes
- When doing long-running canvas image exporting actions, display indeterminate progress bar
- Fix staging area image outline not displaying after committing/discarding results
2022-11-27 03:35:49 +13:00
psychedelicious
b6dd5b664c Fixes bug causing gallery to close on context menu open 2022-11-27 03:35:49 +13:00
psychedelicious
76e7e82f5e Removes stray console.log() 2022-11-27 03:35:49 +13:00
psychedelicious
d4376ed240 Adds hotkey to reset canvas interaction state
If the canvas' interaction state (e.g. isMovingBoundingBox, isDrawing, etc) get stuck somehow, user can press Escape to reset the state.
2022-11-27 03:35:49 +13:00
psychedelicious
b908f2b4bc Improves metadata handling, fixes #1450
- Removes model list from metadata
- Adds generation's specific model to metadata
- Displays full metadata in JSON viewer
2022-11-27 03:35:49 +13:00
psychedelicious
9418324030 Cleans up IAICanvasStatusText 2022-11-27 03:35:49 +13:00
psychedelicious
0f6856b719 Fixes canvas toolbar upload button 2022-11-27 03:35:49 +13:00
psychedelicious
83d8e69219 Reworks canvas toolbar 2022-11-27 03:35:49 +13:00
psychedelicious
7f999e9dfc Fixes another similar index error, simplifies logic 2022-11-27 03:35:49 +13:00
blessedcoolant
0c3ae232af WIP - Lightbox Fixes
Still need to fix the images not being centered on load when the image res changes
2022-11-27 03:35:49 +13:00
blessedcoolant
9950790f4c Fix index error on going past last image in Gallery 2022-11-27 03:35:49 +13:00
psychedelicious
b50a1eb63f Disables canvas image saving functions when processing 2022-11-27 03:35:49 +13:00
blessedcoolant
d55b1e169c Fix Lightbox Issues 2022-11-27 03:35:49 +13:00
psychedelicious
d987d0a336 Saves thumbnails to separate thumbnails directory 2022-11-27 03:35:49 +13:00
psychedelicious
50a67a7172 Implements thumbnails for gallery
- Thumbnails are saved whenever an image is saved, and when gallery requests images from server
- Thumbnails saved at original image aspect ratio with width of 128px as WEBP
- If the thumbnail property of an image is unavailable for whatever reason, the image's full size URL is used instead
2022-11-27 03:35:49 +13:00
blessedcoolant
a3308c853d Fix canvas resizing when both options and gallery are unpinned 2022-11-27 03:35:49 +13:00
blessedcoolant
cde395e02f Hotkey Cleanup
- Viewer is now Z
- Canvas Move tool is V - sync with PS
- Removed some unused hotkeys
2022-11-27 03:35:49 +13:00
psychedelicious
e7f670a5b6 Fixes stage position changing on zoom 2022-11-27 03:35:49 +13:00
blessedcoolant
917c576ddb Fix missing key on ThemeChanger map 2022-11-27 03:35:49 +13:00
psychedelicious
dfc0c587b1 Adds theme changer popover 2022-11-27 03:35:49 +13:00
psychedelicious
548bcaceb2 Adds model drop-down to site header 2022-11-27 03:35:49 +13:00
psychedelicious
5fd43fca13 Fixes paste image to upload 2022-11-27 03:35:49 +13:00
psychedelicious
37a356d377 Improves canvas status text and adds option to toggle debug info 2022-11-27 03:35:49 +13:00
psychedelicious
cccbfb12aa Removes stale code 2022-11-27 03:35:49 +13:00
psychedelicious
d018b2d7a7 Fixes intermediate images being tiny in txt2img/img2img 2022-11-27 03:35:49 +13:00
psychedelicious
e358adecdd Fix metadata viewer image url length when viewing intermediate 2022-11-27 03:35:49 +13:00
psychedelicious
cdc5f66592 Fixes Use All Parameters 2022-11-27 03:35:49 +13:00
psychedelicious
b8cebf29f2 Adds staging area hotkeys, disables gallery left/right when staging 2022-11-27 03:35:49 +13:00
psychedelicious
68aebad7ad Fixes staging area outline 2022-11-27 03:35:49 +13:00
psychedelicious
ae4a44de3e Fixes Canvas Auto Save to Gallery 2022-11-27 03:35:49 +13:00
psychedelicious
2ab868314f Reorganises app file structure 2022-11-27 03:35:49 +13:00
psychedelicious
bc46c46835 Refactors upload-related async thunks
- Now standard thunks instead of RTK createAsyncThunk()
- Adds toasts for all canvas upload-related actions
2022-11-27 03:35:49 +13:00
psychedelicious
d82a21cfb2 Integrates #1487 - touch events
Need to add:
- Pinch zoom
- Touch-specific handling (some things aren't quite right)
2022-11-27 03:35:49 +13:00
blessedcoolant
e5951ad098 Revert "Fix theme changer not displaying current theme on page refresh"
This reverts commit 903edfb803e743500242589ff093a8a8a0912726.
2022-11-27 03:35:49 +13:00
blessedcoolant
4f51680307 Staging Area delete button is now red
So it doesnt feel blended into to the rest of them.
2022-11-27 03:35:49 +13:00
blessedcoolant
d0ceabd372 Fix staging area display toggle not working 2022-11-27 03:35:49 +13:00
blessedcoolant
2bda3d6d2f Unify Brush and Eraser Sizes 2022-11-27 03:35:49 +13:00
blessedcoolant
a96af7a15d Fix tab count in hotkeys panel 2022-11-27 03:35:49 +13:00
blessedcoolant
93192b90f4 Fix theme changer not displaying current theme on page refresh 2022-11-27 03:35:49 +13:00
blessedcoolant
024acf42af Update Hotkey Info
Add missing tooltip hotkeys and update the hotkeys modal to reflect the new hotkeys for the Unified Canvas.
2022-11-27 03:35:49 +13:00
psychedelicious
04cb2d39cb Adds useToastWatcher hook
- Dispatch an `addToast` action with standard Chakra toast options object to add a toast to the toastQueue
- The hook is called in App.tsx and just useEffect's w/ toastQueue as dependency to create the toasts
- So now you can add toasts anywhere you have access to `dispatch`, which includes middleware and thunks
- Adds first usage of this for the save image buttons in canvas
2022-11-27 03:35:49 +13:00
psychedelicious
c69573e65d Disables canvas actions which cannot be done during processing 2022-11-27 03:35:49 +13:00
psychedelicious
84f702b6d0 Resets bounding box coords/dims when no image present 2022-11-27 03:35:49 +13:00
psychedelicious
bb70c32ad5 Improves behaviour when setting init canvas image/reset view 2022-11-27 03:35:49 +13:00
psychedelicious
425a1713ab Fixes possible hang on MaskCompositer 2022-11-27 03:35:49 +13:00
psychedelicious
70e67c45dd Fixes canvas showing spinner on first load
Also adds good default canvas scale and positioning when no image is on it
2022-11-27 03:35:49 +13:00
psychedelicious
07ca0876ec Updates hotkeys 2022-11-27 03:35:49 +13:00
psychedelicious
aa96a457b6 Adds hotkeys and refactors sharing of konva instances
Adds hotkeys to canvas. As part of this change, the access to konva instance objects was refactored:

Previously closure'd refs were used to indirectly get access to the konva instances outside of react components.

Now, a  getter and setter function are used to provide access directly to the konva objects.
2022-11-27 03:35:49 +13:00
psychedelicious
e28599cadb Sets status immediately when clicking Invoke 2022-11-27 03:35:49 +13:00
blessedcoolant
ae6dd219d9 Fix Current Image display background going over image bounds 2022-11-27 03:35:49 +13:00
psychedelicious
19322fc1ec Fixes save to gallery including empty area, adds download and copy image 2022-11-27 03:35:49 +13:00
psychedelicious
635e7da05d Abandons "inpainting" canvas lock 2022-11-27 03:35:49 +13:00
psychedelicious
c0005eb063 Fixes bounding box not being rounded to 64 2022-11-27 03:35:49 +13:00
psychedelicious
74485411a8 Fixes send to buttons 2022-11-27 03:35:49 +13:00
psychedelicious
ed70fc683c Fixes reset canvas view when locked 2022-11-27 03:35:49 +13:00
psychedelicious
425d3bc95d Clips lines drawn while canvas locked
When drawing with the locked canvas, if a brush stroke gets too close to the edge of the canvas and its stroke would extend past the edge of the canvas, the edge of that stroke will be seen after unlocking the canvas.

This could cause a problem if you unlock the canvas and now have a bunch of strokes just outside the init image area, which are far back in undo history and you cannot easily erase.

With this change, lines drawn while the canvas is locked get clipped to the initial image bbox, fixing this issue.

Additionally, the merge and save to gallery functions have been updated to respect the initial image bbox so they function how you'd expect.
2022-11-27 03:35:49 +13:00
psychedelicious
3994c28b77 Fixes 2px layout shift on toggle canvas lock 2022-11-27 03:35:49 +13:00
psychedelicious
0100a63b59 Stops unnecessary canvas rescales on gallery state change 2022-11-27 03:35:49 +13:00
psychedelicious
432dc704a6 Organises features/canvas 2022-11-27 03:35:49 +13:00
psychedelicious
1d540219fa Fixes bounding box ending up offscreen 2022-11-27 03:35:49 +13:00
psychedelicious
827f516baf Organises features/canvas 2022-11-27 03:35:49 +13:00
psychedelicious
48ad0c289c Rebases on dev, updates new env files w/ patchmatch 2022-11-27 03:35:49 +13:00
psychedelicious
223e0529ba Fixes app after removing in/out-painting refs 2022-11-27 03:35:49 +13:00
psychedelicious
e3efcc620c Removes all references to split inpainting/outpainting canvas 2022-11-27 03:35:49 +13:00
psychedelicious
15dd1339d2 Initial unification of canvas 2022-11-27 03:35:49 +13:00
psychedelicious
caf8f0ae35 Removes console.log from redux-persist patch 2022-11-27 03:35:49 +13:00
psychedelicious
cfb87bc116 WIP refactor to unified canvas 2022-11-27 03:35:49 +13:00
psychedelicious
c0ad1b3469 Fixes: outpainting temp images show in gallery 2022-11-27 03:35:49 +13:00
psychedelicious
4382cd0b91 Moves image uploading to HTTP
- It all seems to work fine
- A lot of cleanup is still needed
- Logging needs to be added
- May need types to be reviewed
2022-11-27 03:35:49 +13:00
psychedelicious
1bc1085542 Fixes bbox not resizing in outpainting if partially off screen 2022-11-27 03:35:49 +13:00
psychedelicious
82f6402d04 Hides staging area outline on mouseover prev/next 2022-11-27 03:35:49 +13:00
psychedelicious
0e7b735611 Fixes error on inpainting paste back
`TypeError: 'float' object cannot be interpreted as an integer`
2022-11-27 03:35:49 +13:00
psychedelicious
5304ef504c Fixes wonky canvas layer ordering & compositing 2022-11-27 03:35:49 +13:00
psychedelicious
17b295871f Outpainting tab loads to empty canvas instead of upload 2022-11-27 03:35:49 +13:00
psychedelicious
70dcfa1684 Builds fresh bundle 2022-11-27 03:35:49 +13:00
psychedelicious
5d484273ed Fixes "use all" not setting variationAmount
Now sets to 0 when the image had variations.
2022-11-27 03:35:49 +13:00
psychedelicious
179656d541 Adds staging area 2022-11-27 03:35:49 +13:00
psychedelicious
73099af6ec Fixes disappearing canvas grid lines 2022-11-27 03:35:49 +13:00
blessedcoolant
c223d93b4d Fix gallery width size for Outpainting
Also fixes the canvas resizing failing n fast pushes
2022-11-27 03:35:49 +13:00
psychedelicious
4e34194479 Increases CFG Scale max to 200 2022-11-27 03:35:49 +13:00
blessedcoolant
00e2674076 Add Metadata To Viewer 2022-11-27 03:35:49 +13:00
psychedelicious
0a2e67df1a Hotkeys improvement 2022-11-27 03:35:49 +13:00
psychedelicious
7831468304 Canvas styling 2022-11-27 03:35:49 +13:00
psychedelicious
88d02585e7 Limits history to 256 for each of undo and redo 2022-11-27 03:35:49 +13:00
psychedelicious
f82e82f1bb Debounce > 300ms 2022-11-27 03:35:49 +13:00
psychedelicious
3f1360368d Fixes undo/redo 2022-11-27 03:35:49 +13:00
psychedelicious
d5467e7db5 Attempts to fix redux-persist debounce patch 2022-11-27 03:35:49 +13:00
psychedelicious
9284983429 Updates package.json to use redux-persist patches 2022-11-27 03:35:49 +13:00
psychedelicious
bb79c78fe8 Fixes AttributeError: 'dict' object has no attribute 'invert_mask' 2022-11-27 03:35:49 +13:00
psychedelicious
e3735ebb45 Adds debouncing 2022-11-27 03:35:49 +13:00
psychedelicious
eb17dfdeaa Patches redux-persist and redux-deep-persist with debounced persists
Our app changes redux state very, very often. As our undo/redo history grows, the calls to persist state start to take in the 100ms range, due to a the deep cloning of the history. This causes very noticeable performance lag.

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

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

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

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

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

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

Patching this last release (about 3 years old at this point) directly is far simpler than attempting to fix the upstream library's master branch or figuring out an alternative to the malicious and now non-existent dependency.
2022-11-27 03:35:49 +13:00
psychedelicious
1114ac97e2 Fixes (?) spacebar issues 2022-11-27 03:35:49 +13:00
psychedelicious
c7ef41af54 Changes "Invert Mask" to "Preserve Masked Areas" 2022-11-27 03:35:49 +13:00
psychedelicious
7075a17091 Implements invert mask 2022-11-27 03:35:49 +13:00