We are pleased to announce a features and performance update to InvokeAI with the release of version 2.3.0.
- What's New
- Installation
- Upgrading to 2.3.0
- Getting Help
- Known Bugs
- Detailed Change Log
What's New in 2.3.0
There are multiple internal and external changes in this version of InvokeAI which greatly enhance the developer and user experiences respectively.
Migration to Stable Diffusion diffusers
models
Previous versions of InvokeAI supported the original model file format introduced with Stable Diffusion 1.4. In the original format, known variously as "checkpoint", or "legacy" format, there is a single large weights file ending with .ckpt
or .safetensors
. Though this format has served the community well, it has a number of disadvantages, including file size, slow loading times, and a variety of non-standard variants that require special-case code to handle. In addition, because checkpoint files are actually a bundle of multiple machine learning sub-models, it is hard to swap different sub-models in and out, or to share common sub-models. A new format, introduced by the StabilityAI company in collaboration with HuggingFace, is called diffusers
and consists of a directory of individual models. The most immediate benefit of diffusers
is that they load from disk very quickly. A longer term benefit is that in the near future diffusers
models will be able to share common sub-models, dramatically reducing disk space when you have multiple fine-tune models derived from the same base.
When you perform a new install of version 2.3.0, you will be offered the option to install the diffusers
versions of a number of popular SD models, including Stable Diffusion versions 1.5 and 2.1 (including the 768x768 pixel version of 2.1). These will act and work just like the checkpoint versions. Do not be concerned if you already have a lot of ".ckpt" or ".safetensors" models on disk! InvokeAI 2.3.0 can still load these and generate images from them without any extra intervention on your part.
To take advantage of the optimized loading times of diffusers
models, InvokeAI offers options to convert legacy checkpoint models into optimized diffusers
models. If you use the invokeai
command line interface, the relevant commands are:
!convert_model
-- Take the path to a local checkpoint file or a URL that is pointing to one, convert it into adiffusers
model, and import it into InvokeAI's models registry file.!optimize_model
-- If you already have a checkpoint model in your InvokeAI models file, this command will accept its short name and convert it into a like-nameddiffusers
model, optionally deleting the original checkpoint file.!import_model
-- Take the local path of either a checkpoint file or adiffusers
model directory and import it into InvokeAI's registry file. You may also provide the ID of any diffusers model that has been published on the HuggingFace models repository and it will be downloaded and installed automatically.
The WebGUI offers similar functionality for model management.
For advanced users, new command-line options provide additional functionality. Launching invokeai
with the argument --autoconvert <path to directory>
takes the path to a directory of checkpoint files, automatically converts them into diffusers
models and imports them. Each time the script is launched, the directory will be scanned for new checkpoint files to be loaded. Alternatively, the --ckpt_convert
argument will cause any checkpoint or safetensors model that is already registered with InvokeAI to be converted into a diffusers
model on the fly, allowing you to take advantage of future diffusers-only features without explicitly converting the model and saving it to disk.
Please see INSTALLING MODELS for more information on model management in both the command-line and Web interfaces.
Support for the XFormers
Memory-Efficient Crossattention Package
On CUDA (Nvidia) systems, version 2.3.0 supports the XFormers
library. Once installed, thexformers
package dramatically reduces the memory footprint of loaded Stable Diffusion models files and modestly increases image generation speed. xformers
will be installed and activated automatically if you specify a CUDA system at install time.
The caveat with using xformers
is that it introduces slightly non-deterministic behavior, and images generated using the same seed and other settings will be subtly different between invocations. Generally the changes are unnoticeable unless you rapidly shift back and forth between images, but to disable xformers
and restore fully deterministic behavior, you may launch InvokeAI using the --no-xformers
option. This is most conveniently done by opening the file invokeai/invokeai.init
with a text editor, and adding the line --no-xformers
at the bottom.
Model Merging
Version 2.3.0 offers an intuitive user interface for merging up to three Stable Diffusion models using an intuitive user interface. Model merging allows you to mix the behavior of models to achieve very interesting effects. To use this, each of the models must already be imported into InvokeAI and saved in diffusers
format, then launch the merger using a new menu item in the InvokeAI launcher script (invoke.sh
, invoke.bat
) or directly from the command line with invokeai-merge --gui
. You will be prompted to select the models to merge, the proportions in which to mix them, and the mixing algorithm. The script will create a new merged diffusers
model and import it into InvokeAI for your use.
See MODEL MERGING for more details.
Textual Inversion Training
Textual Inversion (TI) is a technique for training a Stable Diffusion model to emit a particular subject or style when triggered by a keyword phrase. You can perform TI training by placing a small number of images of the subject or style in a directory, and choosing a distinctive trigger phrase, such as "pointillist-style". After successful training, The subject or style will be activated by including <pointillist-style>
in your prompt.
Previous versions of InvokeAI were able to perform TI, but it required using a command-line script with dozens of obscure command-line arguments. Version 2.3.0 features an intuitive TI frontend that will build a TI model on top of any diffusers
model. To access training you can launch from a new item in the launcher script or from the command line using invokeai-ti --gui
.
See TEXTUAL INVERSION for further details.
A New Installer Experience
The InvokeAI installer has been upgraded in order to provide a smoother and hopefully more glitch-free experience. In addition, InvokeAI is now packaged as a PyPi project, allowing developers and power-users to install InvokeAI with the command pip install InvokeAI --use-pep517
. Please see Installation for details.
Developers should be aware that the pip
installation procedure has been simplified and that the conda
method is no longer supported at all. Accordingly, the environments_and_requirements
directory has been deleted from the repository.
Command-line name changes
All of InvokeAI's functionality, including the WebUI, command-line interface, textual inversion training and model merging, can all be accessed from the invoke.sh
and invoke.bat
launcher scripts. The menu of options has been expanded to add the new functionality. For the convenience of developers and power users, we have normalized the names of the InvokeAI command-line scripts:
invokeai
-- Command-line clientinvokeai --web
-- Web GUIinvokeai-merge --gui
-- Model merging script with graphical front endinvokeai-ti --gui
-- Textual inversion script with graphical front endinvokeai-configure
-- Configuration tool for initializing theinvokeai
directory and selecting popular starter models.
For backward compatibility, the old command names are also recognized, including invoke.py
and configure-invokeai.py
. However, these are deprecated and will eventually be removed.
Developers should be aware that the locations of the script's source code has been moved. The new locations are:
invokeai
=>ldm/invoke/CLI.py
invokeai-configure
=>ldm/invoke/config/configure_invokeai.py
invokeai-ti
=>ldm/invoke/training/textual_inversion.py
invokeai-merge
=>ldm/invoke/merge_diffusers
Developers are strongly encouraged to perform an "editable" install of InvokeAI using pip install -e . --use-pep517
in the Git repository, and then to call the scripts using their 2.3.0 names, rather than executing the scripts directly. Developers should also be aware that the several important data files have been relocated into a new directory named invokeai
. This includes the WebGUI's frontend
and backend
directories, and the INITIAL_MODELS.yaml
files used by the installer to select starter models. Eventually all InvokeAI modules will be in subdirectories of invokeai
.
Full Changelog: v2.2.4...v2.3.0-rc1
Installation
The same procedure is used to install or upgrade to InvokeAI 2.3.0. Please download the zip file below, unpack it, and then double-click to launch the script install.sh
(Macintosh, Linux) or install.bat
(Windows). Alternatively, you can open a command-line window and execute the installation script directly.
InvokeAI-installer-v2.3.0-rc3.zip
If you are upgrading from an earlier version of InvokeAI, all you have to do is to run the installer for your platform. When the installer asks you to confirm the location of the invokeai
directory, type in the path to the directory you are already using, if not the same as the one selected automatically by the installer. When the installer asks you to confirm that you want to install into an existing directory, simply indicate "yes". You may wish to delete or rename the invokeai/.venv
directory in order to ensure that you get the most recent versions of all required modules.
Developers and power users can upgrade to the current version using pip install --upgrade InvokeAI
(prerelease note: once the release is published)
Known Bugs
As of 4 February 2023, testing of the pre-release candidate RC3 has revealed a number of bugs:
(no bugs reported so far; check back here for updates)
Help
Please see the InvokeAI Issues Board or the InvokeAI Discord for assistance from the development team.
Full Change Log
- update installers for v2.2.4 tag by @lstein in #1936
- Fix the mistake of not importing the gc by @rmagur1203 in #1939
- Load model in inpaint when using free_gpu_mem option by @rmagur1203 in #1938
- Improves configure_invokeai.py postscript by @psychedelicious in #1935
- add --karras_max option to invoke.py command line by @lstein in #1762
- add logic for finding the root (runtime) directory by @lstein in #1948
- Make Dockerfile cloud ready (tested on runpod) by @mauwii in #1950
- [WebUI 2.2.5] Unified Canvas Alternate UI Beta by @blessedcoolant in #1951
- Fix crash when upscaling with CLI by @lstein in #1962
- Possible fix for crash introduced in #1948 by @blessedcoolant in #1963
- Lstein installer improvements by @lstein in #1954
- [WebUI 2.2.5] Hotkeys Update by @blessedcoolant in #1965
- Potential fix for segfault on macOS in homebrew-provided Python by @ebr in #1969
- Typo fix in INSTALL_AUTOMATED.md by @limonspb in #1968
- remove redundant tests, only do 20 steps by @mauwii in #1972
- add concurrency to test actions by @mauwii in #1975
- re-enable wheel install in
test-invoke-pip.yml
by @mauwii in #1971 - Fix: define path as None before usage by @limonspb in #1974
- Permit usage of GPUs in docker script by @xrd in #1985
- fix attention maps crash by properly restricting token sequence length by @damian0815 in #1999
- fix manual install documentation by @lstein in #1957
- update Contributors directive to merge to main by @hipsterusername in #1984
- better error reporting when root directory not found by @lstein in #2001
- update requirements and environment files for patchmatch 0.1.5 by @lstein in #2000
- build: GitHub Action to lint python files with pyflakes by @keturn in #1332
- Correct timestep for img2img initial noise addition by @wfng92 in #1946
- Remove circular dependencies from frontend by @kasbah in #1995
- Reduce frontend eslint warnings to 0 by @kasbah in #2008
- Fix intitial theme setting by @kasbah in #2025
- Replace latest link by @zeptofine in #2020
- (docs) update index and changelog by @mauwii in #2017
- improve installation documentation by @lstein in #2026
- Add Embedding Parsing by @blessedcoolant in #1973
- Fix --config arg not being recognized by @blessedcoolant in #2028
- Delete old 'server' package and the dependency_injector requirement by @ebr in #2032
- update (docker-)build scripts,
.dockerignore
and add patchmatch by @mauwii in #1970 - Auto-format frontend by @kasbah in #2009
- add an argument that lets user specify folders to scan for weights by @lstein in #1977
- avoid leaking data to HuggingFace by @lstein in #2021
- Fix broken embedding variants by @blessedcoolant in #2037
- Updated to pull threshold from an existing image even if 0 by @JPPhoto in #2051
- Added compiled TS changes by @JPPhoto in #2060
- Accept --root_dir in addition to --root in configure_ivokeai.py to be… by @shapor in #2057
- Add redirects for moved pages by @ebr in #2063
- Relax Huggingface login requirement during setup by @ebr in #2046
- Don't crash CLI on exceptions by @damian0815 in #2066
- set workflow PR triggers to filter PR-types by @mauwii in #2065
- Install documentation updates by @ebr in #2071
- remove redundant code line by @lstein in #2068
- Global replace [ \t]+$, add "GB" by @thinkyhead in #1751
- Revert "Don't crash CLI on exceptions" by @damian0815 in #2078
- optimize
Dockerfile
by @mauwii in #2036 - Fix the configure script crash when no TTY is allocated (e.g. a container) by @ebr in #2080
- add --version to invoke.py arguments by @lstein in #2038
- Correct asset link by @hipsterusername in #2081
- defer patchmatch loading by @lstein in #2039
- Add @ebr to Contributors by @ebr in #2095
- correct a crash in img2img under particular circumstances by @lstein in #2088
- Update 020_INSTALL_MANUAL.md by @tomosuto in #2092
- [docs] Provide an example of reading prompts from a script by @lstein in #2087
- Fix of Hires Fix on Img2Img tab by @hipsterusername in #2096
- [docker] use
uname -m
instead ofarch
by @mauwii in #2110 - [WebUI] Localization Support by @blessedcoolant in #2050
- Update 020_INSTALL_MANUAL.md by @netsvetaev in #2114
- Update 020_INSTALL_MANUAL.md by @tomosuto in #2093
- Update README.md by @netsvetaev in #2115
- [WebUI] Model Manager by @blessedcoolant in #2127
- i18n: simplified chinese translations for model manager by @ryanccn in #2165
- Update WEBUIHOTKEYS.md by @Yorzaren in #2148
- [WebUI] Localize tooltips by @prvdph in #2136
- attempt to address memory issues when loading ckpt models by @lstein in #2128
- I18n es by @dreglad in #2150
- [WebUI] 2.2.5 Bug Fixes by @blessedcoolant in #2180
- Update WEBUIHOTKEYS.md - Key Display by @Yorzaren in #2190
- Lstein release candidate 2.2.5 by @lstein in #2137
- update version number by @lstein in #2199
- Fix patchmatch-docs by @mauwii in #2111
- fixing a typo in invoke.py by @mauwii in #2204
- Explicitly call python found in system by @CodeZombie in #2203
- fix spelling mistake in readme by @NamesCode in #2207
- Local embeddings support (CLI autocomplete) by @pythonlearner1025 in #2211
- fix facexlib weights being downloaded to .venv by @lstein in #2221
- Allow multiple CORS origins by @xrd in #2031
- Require huggingface-hub version 0.11.1 by @williamchong in #2222
- update python requirements by @mauwii in #2251
- tweak install instructions by @lstein in #2227
- enhance the .bat installer by @lstein in #2299
- update Readme by @hipsterusername in #2278
- Consolidate version numbers by @lstein in #2201
- use 🧨diffusers model by @keturn in #1583
- adjust initial model defaults by @lstein in #2322
- Pin dnspython version by @anveo in #2327
- Improve readability of the manual installation documentation by @addianto in #2296
- upgrade requirements to CUDA 11.7, torch 1.13 by @lstein in #2331
- Fix
percent_through
calculation for cross-attention control by @damian0815 in #2342 - [Enhancement] add --default_only arg to configure_invokeai.py, for CI use by @lstein in #2355
- tip fix by @younyokel in #2281
- do not use autocast for diffusers by @lstein in #2349
- further improvements to initial load by @lstein in #2330
- Update automated install doc - link to MS C libs by @gogurtenjoyer in #2306
- Store & load 🤗 models at XDG_CACHE_HOME if HF_HOME is not set by @addianto in #2359
- [bugfix] suppress extraneous warning messages generated by diffusers by @lstein in #2374
- [feat] Provide option to disable xformers from command line by @lstein in #2373
- Save HFToken only if it is present by @wasabigeek in #2370
- [enhancement] Reorganize form for textual inversion training by @lstein in #2375
- Add instructions for installing xFormers on linux by @lstein in #2360
- Update index.md by @michaelk71 in #2377
- fix long prompt weighting bug in ckpt codepath by @damian0815 in #2382
- fix: use pad_token for padding by @keturn in #2381
- [bugfix] ckpt conversion script respects cache in ~/invokeai/models by @lstein in #2395
- [Feature] Add interactive diffusers model merger by @lstein in #2388
- add Japanese Translation by @Katsuyuki-Karasawa in #2397
- Make sure --free_gpu_mem still works when using CKPT-based diffuser model by @addianto in #2367
- [enhancement] import .safetensors ckpt files directly by @lstein in #2353
- [feat] Better status reporting when loading embeds and concepts by @lstein in #2372
- improve UI of textual inversion frontend by @lstein in #2333
- [Enhancements] Allow user to specify VAE with !import_model and delete underlying model with !del_model by @lstein in #2369
- replace legacy setup.py with pyproject.toml by @mauwii in #2350
- Dutch localization by @dvanzoerlandt in #2409
- Remove dependency on original clipseg library for text masking by @lstein in #2425
- dev: update to diffusers 0.12, transformers 4.26 by @keturn in #2420
- Fix Sliders unable to take typed input by @blessedcoolant in #2407
- [enhancement] Improve organization & behavior of model merging and textual inversion scripts by @lstein in #2427
- Improve configuration of initial Waifu models by @lstein in #2426
- [WebUI] Diffusers Model Manager Fixes by @blessedcoolant in #2432
- Fix download button styling by @psychedelicious in #2435
- adds double-click to reset view to 100% by @psychedelicious in #2436
- removed defunct textual inversion script by @lstein in #2433
- Update --hires_fix by @JPPhoto in #2414
- fix documentation of huggingface cache location by @lstein in #2430
- Implement
.swap()
against diffusers 0.12 by @damian0815 in #2385 - fix dimension errors when inpainting model is used with hires-fix by @keturn in #2440
- fix(inpainting model): blank areas to be repainted in the masked image by @keturn in #2447
- feat(inpaint): add solid infill for use with inpainting model by @keturn in #2441
- fix broken Dockerfile by @mauwii in #2445
- fix img2img on mps by working around pytorch bug by @damian0815 in #2458
- [enhancement] Print status message at startup when xformers is available by @lstein in #2461
- Prevent actions from running on draft PRs by @psychedelicious in #2457
- requirements: add xformers for CUDA platforms by @keturn in #2465
- add workflow to clean caches after PR gets closed by @mauwii in #2450
- Remove Inpaint Replace by @hipsterusername in #2466
New Contributors
- @limonspb made their first contribution in #1968
- @xrd made their first contribution in #1985
- @kasbah made their first contribution in #1995
- @zeptofine made their first contribution in #2020
- @shapor made their first contribution in #2057
- @thinkyhead made their first contribution in #1751
- @tomosuto made their first contribution in #2092
- @ryanccn made their first contribution in #2165
- @Yorzaren made their first contribution in #2148
- @prvdph made their first contribution in #2136
- @dreglad made their first contribution in #2150
- @CodeZombie made their first contribution in #2203
- @NamesCode made their first contribution in #2207
- @pythonlearner1025 made their first contribution in #2211
- @williamchong made their first contribution in #2222
- @anveo made their first contribution in #2327
- @younyokel made their first contribution in #2281
- @gogurtenjoyer made their first contribution in #2306
- @wasabigeek made their first contribution in #2370
- @michaelk71 made their first contribution in #2377
- @Katsuyuki-Karasawa made their first contribution in #2397
- @dvanzoerlandt made their first contribution in #2409