mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
b77f34998c
17 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
Lincoln Stein
|
0f4d71ed63
|
Merge dev into main for 2.2.0 (#1642)
* Fixes inpainting + code cleanup
* Disable stage info in Inpainting Tab
* Mask Brush Preview now always at 0.5 opacity
The new mask is only visible properly at max opacity but at max opacity the brush preview becomes fully opaque blocking the view. So the mask brush preview no remains at 0.5 no matter what the Brush opacity is.
* Remove save button from Canvas Controls (cleanup)
* Implements invert mask
* Changes "Invert Mask" to "Preserve Masked Areas"
* Fixes (?) spacebar issues
* 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.
* Adds debouncing
* Fixes AttributeError: 'dict' object has no attribute 'invert_mask'
* Updates package.json to use redux-persist patches
* Attempts to fix redux-persist debounce patch
* Fixes undo/redo
* Fixes invert mask
* Debounce > 300ms
* Limits history to 256 for each of undo and redo
* Canvas styling
* Hotkeys improvement
* Add Metadata To Viewer
* Increases CFG Scale max to 200
* Fix gallery width size for Outpainting
Also fixes the canvas resizing failing n fast pushes
* Fixes disappearing canvas grid lines
* Adds staging area
* Fixes "use all" not setting variationAmount
Now sets to 0 when the image had variations.
* Builds fresh bundle
* Outpainting tab loads to empty canvas instead of upload
* Fixes wonky canvas layer ordering & compositing
* Fixes error on inpainting paste back
`TypeError: 'float' object cannot be interpreted as an integer`
* Hides staging area outline on mouseover prev/next
* Fixes inpainting not doing img2img when no mask
* Fixes bbox not resizing in outpainting if partially off screen
* Fixes crashes during iterative outpaint. Still doesn't work correctly though.
* Fix iterative outpainting by restoring original images
* 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
* Fixes: outpainting temp images show in gallery
* WIP refactor to unified canvas
* Removes console.log from redux-persist patch
* Initial unification of canvas
* Removes all references to split inpainting/outpainting canvas
* Add patchmatch and infill_method parameter to prompt2image (options are 'patchmatch' or 'tile').
* Fixes app after removing in/out-painting refs
* Rebases on dev, updates new env files w/ patchmatch
* Organises features/canvas
* Fixes bounding box ending up offscreen
* Organises features/canvas
* Stops unnecessary canvas rescales on gallery state change
* Fixes 2px layout shift on toggle canvas lock
* 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.
* Fixes reset canvas view when locked
* Fixes send to buttons
* Fixes bounding box not being rounded to 64
* Abandons "inpainting" canvas lock
* Fixes save to gallery including empty area, adds download and copy image
* Fix Current Image display background going over image bounds
* Sets status immediately when clicking Invoke
* 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.
* Updates hotkeys
* Fixes canvas showing spinner on first load
Also adds good default canvas scale and positioning when no image is on it
* Fixes possible hang on MaskCompositer
* Improves behaviour when setting init canvas image/reset view
* Resets bounding box coords/dims when no image present
* Disables canvas actions which cannot be done during processing
* 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
* Update Hotkey Info
Add missing tooltip hotkeys and update the hotkeys modal to reflect the new hotkeys for the Unified Canvas.
* Fix theme changer not displaying current theme on page refresh
* Fix tab count in hotkeys panel
* Unify Brush and Eraser Sizes
* Fix staging area display toggle not working
* Staging Area delete button is now red
So it doesnt feel blended into to the rest of them.
* Revert "Fix theme changer not displaying current theme on page refresh"
This reverts commit 903edfb803e743500242589ff093a8a8a0912726.
* Add arguments to use SSL to webserver
* Integrates #1487 - touch events
Need to add:
- Pinch zoom
- Touch-specific handling (some things aren't quite right)
* Refactors upload-related async thunks
- Now standard thunks instead of RTK createAsyncThunk()
- Adds toasts for all canvas upload-related actions
* Reorganises app file structure
* Fixes Canvas Auto Save to Gallery
* Fixes staging area outline
* Adds staging area hotkeys, disables gallery left/right when staging
* Fixes Use All Parameters
* Fix metadata viewer image url length when viewing intermediate
* Fixes intermediate images being tiny in txt2img/img2img
* Removes stale code
* Improves canvas status text and adds option to toggle debug info
* Fixes paste image to upload
* Adds model drop-down to site header
* Adds theme changer popover
* Fix missing key on ThemeChanger map
* Fixes stage position changing on zoom
* Hotkey Cleanup
- Viewer is now Z
- Canvas Move tool is V - sync with PS
- Removed some unused hotkeys
* Fix canvas resizing when both options and gallery are unpinned
* 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
* Saves thumbnails to separate thumbnails directory
* Thumbnail size = 256px
* Fix Lightbox Issues
* Disables canvas image saving functions when processing
* Fix index error on going past last image in Gallery
* WIP - Lightbox Fixes
Still need to fix the images not being centered on load when the image res changes
* Fixes another similar index error, simplifies logic
* Reworks canvas toolbar
* Fixes canvas toolbar upload button
* Cleans up IAICanvasStatusText
* Improves metadata handling, fixes #1450
- Removes model list from metadata
- Adds generation's specific model to metadata
- Displays full metadata in JSON viewer
* Gracefully handles corrupted images; fixes #1486
- App does not crash if corrupted image loaded
- Error is displayed in the UI console and CLI output if an image cannot be loaded
* 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.
* Removes stray console.log()
* Fixes bug causing gallery to close on context menu open
* 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
* Removes unused imports
* Fixes repo root .gitignore ignoring frontend things
* Builds fresh bundle
* Styling updates
* Removes reasonsWhyNotReady
The popover doesn't play well with the button being disabled, and I don't think adds any value.
* Image gallery resize/style tweaks
* Styles buttons for clearing canvas history and mask
* First pass on Canvas options panel
* Fixes bug where discarding staged images results in loss of history
* Adds Save to Gallery button to staging toolbar
* Rearrange some canvas toolbar icons
Put brush stuff together and canvas movement stuff together
* Fix gallery maxwidth on unified canvas
* Update Layer hotkey display to UI
* Adds option to crop to bounding box on save
* Masking option tweaks
* Crop to Bounding Box > Save Box Region Only
* Adds clear temp folder
* Updates mask options popover behavior
* Builds fresh bundle
* Fix styling on alert modals
* Fix input checkbox styling being incorrect on light theme
* Styling fixes
* Improves gallery resize behaviour
* Cap gallery size on canvas tab so it doesnt overflow
* Fixes bug when postprocessing image with no metadata
* Adds IAIAlertDialog component
* Moves Loopback to app settings
* Fixes metadata viewer not showing metadata after refresh
Also adds Dream-style prompt to metadata
* Adds outpainting specific options
* Linting
* Fixes gallery width on lightbox, fixes gallery button expansion
* Builds fresh bundle
* Fix Lightbox images of different res not centering
* Update feature tooltip text
* Highlight mask icon when on mask layer
* Fix gallery not resizing correctly on open and close
* Add loopback to just img2img. Remove from settings.
* Fix to gallery resizing
* Removes Advanced checkbox, cleans up options panel for unified canvas
* Minor styling fixes to new options panel layout
* Styling Updates
* Adds infill method
* Tab Styling Fixes
* memoize outpainting options
* Fix unnecessary gallery re-renders
* Isolate Cursor Pos debug text on canvas to prevent rerenders
* Fixes missing postprocessed image metadata before refresh
* Builds fresh bundle
* Fix rerenders on model select
* Floating panel re-render fix
* Simplify fullscreen hotkey selector
* Add Training WIP Tab
* Adds Training icon
* Move full screen hotkey to floating to prevent tab rerenders
* Adds single-column gallery layout
* Fixes crash on cancel with intermediates enabled, fixes #1416
* Updates npm dependencies
* Fixes img2img attempting inpaint when init image has transparency
* Fixes missing threshold and perlin parameters in metadata viewer
* Renames "Threshold" > "Noise Threshold"
* Fixes postprocessing not being disabled when clicking use all
* Builds fresh bundle
* Adds color picker
* Lints & builds fresh bundle
* Fixes iterations being disabled when seed random & variations are off
* Un-floors cursor position
* Changes color picker preview to circles
* Fixes variation params not set correctly when recalled
* Fixes invoke hotkey not working in input fields
* Simplifies Accordion
Prep for adding reset buttons for each section
* Fixes mask brush preview color
* Committing color picker color changes tool to brush
* Color picker does not overwrite user-selected alpha
* Adds brush color alpha hotkey
* Lints
* Removes force_outpaint param
* Add inpaint size options to inpaint at a larger size than the actual inpaint image, then scale back down for recombination
* Bug fix for inpaint size
* Adds inpaint size (as scale bounding box) to UI
* Adds auto-scaling for inpaint size
* Improves scaled bbox display logic
* Fixes bug with clear mask and history
* Fixes shouldShowStagingImage not resetting to true on commit
* Builds fresh bundle
* Fixes canvas failing to scale on first run
* Builds fresh bundle
* Fixes unnecessary canvas scaling
* Adds gallery drag and drop to img2img/canvas
* Builds fresh bundle
* Fix desktop mode being broken with new versions of flaskwebgui
* Fixes canvas dimensions not setting on first load
* Builds fresh bundle
* stop crash on !import_models call on model inside rootdir
- addresses bug report #1546
* prevent "!switch state gets confused if model switching fails"
- If !switch were to fail on a particular model, then generate got
confused and wouldn't try again until you switch to a different working
model and back again.
- This commit fixes and closes #1547
* Revert "make the docstring more readable and improve the list_models logic"
This reverts commit
|
||
psychedelicious
|
b8de5244b1 |
Fixes issue with intermediates size
Sorry @lstein ! |
||
Lincoln Stein
|
76249b3d4e | copy dev frontend code over again | ||
damian
|
f4576dcc2d | update frontend | ||
Lincoln Stein
|
2048a47b85 | copy frontend from dev | ||
damian0815
|
f73d5a647d |
Final WebUI build for Release 2.1
- squashed commit of 52 commits from PR #1327 don't log base64 progress images Fresh Build For WebUI [WebUI] Loopback Default False Fixes bugs/styling - Fixes missing web app state on new version: Adds stateReconciler to redux-persist. When we add more values to the state and then release the update app, they will be automatically merged in. Reseting web UI will be needed far less. 7159ec - Fixes console z-index - Moves reset web UI button to visible area Decreases gallery width on inpainting Increases workarea split padding to 1rem Adds missing tooltips to site header Changes inpainting controls settings to hover Fixes hotkeys and settings buttons not working Improves bounding box interactions - Bounding box can now be moved by dragging any of its edges - Bounding box does not affect drawing if already drawing a stroke - Can lock bounding box to draw directly on the bounding box edges - Removes spacebar-hold behaviour due to technical issues Fixes silent crash when init image too large To send the mask to the server, the UI rendered the mask onto the init image and sent the whole image. The mask was then cropped by the server. If the image was too large, the app silently failed. Maybe it exceeds the websocket size limit. Fixed by cropping the mask in the UI layer, sending only bounding-box-sized mask image data. Disabled bounding box settings when locked Styles image uploader Builds fresh bundle Improves bounding box interaction Added spacebar-hold-to-transform back. Address bounding box feedback - Adds back toggle to hide bounding box - Box quick toggle = q, normal toggle = shift + q - Styles canvas alert icons Adds hints when unable to invoke - Popover on Invoke button indicates why exactly it is disabled, e.g. prompt is empty, something else is processing, etc. - There may be more than one reason; all are displayed. Fix Inpainting Alerts Styling Preventing unnecessary re-renders across the app Code Split Inpaint Options Isolate features to their own components so they dont re-render the other stuff each time. [TESTING] Remove global isReady checking I dont believe this is need at all because the isready state is constantly updated when needed and tracked real time in the Redux store. This causes massive re-renders. @psychedelicious If this is absolutely essential for a reason that I do not see, please hit me up on Discord. Fresh Bundle Fix Bounding Box Settings re-rendering on brush stroke [Code Splitting] Bounding Box Options Isolated all bounding box components to trigger unnecessary re-renders. Still need to fix bounding box triggering re-renders on the control panel inside the canvas itself. But the options panel should be a good to go with this change. Inpainting Controls Code Spitting and Performance Codesplit the entirety of the inpainting controls. Created new selectors for each and every component to ensure there are no unnecessary re-renders. App feels a lot smoother. Fixes rerenders on ClearBrushHistory Fixes crash when requesting post-generation upscale/face restoration - Moves the inpainting paste to before the postprocessing. Removes unused isReady state Changes Report Bug icon to a bug Restores shift+q bounding box shortcut Adds alert for bounding box size to status icons Adds asCheckbox to IAIIconButton Rough draft of this. Not happy with the styling but it's clearer than having them look just like buttons. Fixes crash related to old value of progress_latents in state Styling changes and settings modal minor refactor Fixes: uploaded JPG images not loading Reworks CurrentImageButtons.tsx - Change all icons to FA iconset for consistency - Refactors IAIIconButton, IAIButton, IAIPopover to handle ref forwarding - Redesigns buttons into group Only generate 1 iteration when seed fixed & variations disabled Fixes progress images select Fixes edge case: upload over gets stuck while alt tabbing - Press esc to close it now Fixes display progress images select typing Fixes current image button rerenders Adds min width to ImageUploader Makes fast-latents in progress default Update Icon Button Checkbox Style Styling Fixes next/prev image buttons Refactor canvas buttons + more Add Save Intermediates Step Count For accurate mode only. Co-Authored-By: Richard Macarthy <richardmacarthy@protonmail.com> Restores "initial image" text Address feedback - moves mask clear button - fixes intermediates - shrinks inpainting icons by 10% Fix Loopback Styling Adds escape hotkey to close floating panels Readd Hotkey for Dual Display Updated Current Image Button Styling |
||
blessedcoolant
|
4e1b619ad7 | [WebUI] Loopback Default False | ||
psychedelicious
|
e5dcae5fff | Merges development | ||
psychedelicious
|
a127eeff20 | Fixes gallery bugs & adds gallery context menu | ||
blessedcoolant
|
3170c83d8d | [WebUI] Masonry Layout for Gallery | ||
blessedcoolant
|
40d7141a4d | Add Basic Hotkey Support | ||
Peter Baylies
|
f041510659
|
Merge branch 'development' into development | ||
blessedcoolant
|
b8e4c13746 |
Add New WebUI and Desktop Mode
Co-Authored-By: psychedelicious <4822129+psychedelicious@users.noreply.github.com> |
||
Peter Baylies
|
90d8f0af73 | Merge branch 'development' of https://github.com/lstein/stable-diffusion into development | ||
psychedelicious
|
b970ec4ce9 | Refactors metadata & types, bugfixes, organization | ||
Peter Baylies
|
f4a275d1b5 | * Tweaked frontend options; rebuilt frontend. | ||
psychedelicious
|
d1a2c4cd8c
|
React web UI with flask-socketio API (#429)
* Implements rudimentary api * Fixes blocking in API * Adds UI to monorepo > src/frontend/ * Updates frontend/README * Reverts conda env name to `ldm` * Fixes environment yamls * CORS config for testing * Fixes LogViewer position * API WID * Adds actions to image viewer * Increases vite chunkSizeWarningLimit to 1500 * Implements init image * Implements state persistence in localStorage * Improve progress data handling * Final build * Fixes mimetypes error on windows * Adds error logging * Fixes bugged img2img strength component * Adds sourcemaps to dev build * Fixes missing key * Changes connection status indicator to text * Adds ability to serve other hosts than localhost * Adding Flask API server * Removes source maps from config * Fixes prop transfer * Add missing packages and add CORS support * Adding API doc * Remove defaults from openapi doc * Adds basic error handling for server config query * Mostly working socket.io implementation. * Fixes bug preventing mask upload * Fixes bug with sampler name not written to metadata * UI Overhaul, numerous fixes Co-authored-by: Kyle Schouviller <kyle0654@hotmail.com> Co-authored-by: Lincoln Stein <lincoln.stein@gmail.com> |