0f4d71ed63
* 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
|
||
---|---|---|
.dev_scripts | ||
.github | ||
assets | ||
backend | ||
configs | ||
docker-build | ||
docs | ||
environments-and-requirements | ||
frontend | ||
installer | ||
ldm | ||
notebooks | ||
scripts | ||
server | ||
source_installer | ||
static | ||
tests | ||
.dockerignore | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
.prettierrc.yaml | ||
CODE_OF_CONDUCT.md | ||
InvokeAI_Statement_of_Values.md | ||
LICENSE | ||
LICENSE-ModelWeights.txt | ||
main.py | ||
mkdocs.yml | ||
README.md | ||
setup.py | ||
shell.nix | ||
Stable_Diffusion_v1_Model_Card.md |
This is a fork of CompVis/stable-diffusion, the open source text-to-image generator. It provides a streamlined process with various new features and options to aid the image generation process. It runs on Windows, Mac and Linux machines, with GPU cards with as little as 4 GB of RAM. It provides both a polished Web interface (see below), and an easy-to-use command-line interface.
Quick links: [Discord Server] [Documentation and Tutorials] [Code and Downloads] [Bug Reports] [Discussion, Ideas & Q&A]
Note: This fork is rapidly evolving. Please use the Issues tab to report bugs and make feature requests. Be sure to use the provided templates. They will help aid diagnose issues faster.
Table of Contents
- Installation
- Hardware Requirements
- Features
- Latest Changes
- Troubleshooting
- Contributing
- Contributors
- Support
- Further Reading
Installation
This fork is supported across Linux, Windows and Macintosh. Linux users can use either an Nvidia-based card (with CUDA support) or an AMD card (using the ROCm driver). For full installation and upgrade instructions, please see: InvokeAI Installation Overview
Hardware Requirements
System
You wil need one of the following:
- An NVIDIA-based graphics card with 4 GB or more VRAM memory.
- An Apple computer with an M1 chip.
Memory
- At least 12 GB Main Memory RAM.
Disk
- At least 12 GB of free disk space for the machine learning model, Python, and all its dependencies.
Note
If you have a Nvidia 10xx series card (e.g. the 1080ti), please run the dream script in full-precision mode as shown below.
Similarly, specify full-precision mode on Apple M1 hardware.
Precision is auto configured based on the device. If however you encounter
errors like 'expected type Float but found Half' or 'not implemented for Half'
you can try starting invoke.py
with the --precision=float32
flag:
(invokeai) ~/InvokeAI$ python scripts/invoke.py --precision=float32
Features
Major Features
- Web Server
- Interactive Command Line Interface
- Image To Image
- Inpainting Support
- Outpainting Support
- Upscaling, face-restoration and outpainting
- Reading Prompts From File
- Prompt Blending
- Thresholding and Perlin Noise Initialization Options
- Negative/Unconditioned Prompts
- Variations
- Personalizing Text-to-Image Generation
- Simplified API for text to image generation
Other Features
Latest Changes
-
v2.0.1 (13 October 2022)
- fix noisy images at high step count when using k* samplers
- dream.py script now calls invoke.py module directly rather than via a new python process (which could break the environment)
-
v2.0.0 (9 October 2022)
dream.py
script renamedinvoke.py
. Adream.py
script wrapper remains for backward compatibility.- Completely new WebGUI - launch with
python3 scripts/invoke.py --web
- Support for inpainting and outpainting
- img2img runs on all k* samplers
- Support for negative prompts
- Support for CodeFormer face reconstruction
- Support for Textual Inversion on Macintoshes
- Support in both WebGUI and CLI for post-processing of previously-generated images
using facial reconstruction, ESRGAN upscaling, outcropping (similar to DALL-E infinite canvas),
and "embiggen" upscaling. See the
!fix
command. - New
--hires
option oninvoke>
line allows larger images to be created without duplicating elements, at the cost of some performance. - New
--perlin
and--threshold
options allow you to add and control variation during image generation (see Thresholding and Perlin Noise Initialization - Extensive metadata now written into PNG files, allowing reliable regeneration of images and tweaking of previous settings.
- Command-line completion in
invoke.py
now works on Windows, Linux and Mac platforms. - Improved command-line completion behavior.
New commands added:
- List command-line history with
!history
- Search command-line history with
!search
- Clear history with
!clear
- List command-line history with
- Deprecated
--full_precision
/-F
. Simply omit it andinvoke.py
will auto configure. To switch away from auto use the new flag like--precision=float32
.
For older changelogs, please visit the CHANGELOG.
Troubleshooting
Please check out our Q&A to get solutions for common installation problems and other issues.
Contributing
Anyone who wishes to contribute to this project, whether documentation, features, bug fixes, code cleanup, testing, or code reviews, is very much encouraged to do so. To join, just raise your hand on the InvokeAI Discord server or discussion board.
If you are unfamiliar with how to contribute to GitHub projects, here is a Getting Started Guide. A full set of contribution guidelines, along with templates, are in progress, but for now the most important thing is to make your pull request against the "development" branch, and not against "main". This will help keep public breakage to a minimum and will allow you to propose more radical changes.
We hope you enjoy using our software as much as we enjoy creating it, and we hope that some of those of you who are reading this will elect to become part of our community.
Welcome to InvokeAI!
Contributors
This fork is a combined effort of various people from across the world. Check out the list of all these amazing people. We thank them for their time, hard work and effort.
Support
For support, please use this repository's GitHub Issues tracking service. Feel free to send me an email if you use and like the script.
Original portions of the software are Copyright (c) 2020 Lincoln D. Stein
Further Reading
Please see the original README for more information on this software and underlying algorithm, located in the file README-CompViz.md.