Skip to content

InvokeAI Version 2.3.0

Compare
Choose a tag to compare
@lstein lstein released this 03 Feb 03:26
· 12166 commits to main since this release
f5d1fbd

We are pleased to announce a features and performance update to InvokeAI with the release of version 2.3.0.

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 a diffusers 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-named diffusers model, optionally deleting the original checkpoint file.
  • !import_model -- Take the local path of either a checkpoint file or a diffusers 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.

A Negative Prompt Box in the WebUI

There is now a separate text input box for negative prompts in the WebUI. This is convenient for stashing frequently-used negative prompts ("mangled limbs, bad anatomy"). The [negative prompt] syntax continues to work in the main prompt box as well.

To see exactly how your prompts are being parsed, launch invokeai with the --log_tokenization option. The console window will then display the tokenization process for both positive and negative prompts.

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.

Installation

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.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".

Developers and power users can upgrade to the current version by activating the InvokeAI environment and then using pip install --use-pep517 --upgrade InvokeAI . You may specify a particular version by adding the version number to the command, as in InvokeAI==2.3.1. You can see which versions are available by going to The PyPI InvokeAI Project Page

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 client
  • invokeai --web -- Web GUI
  • invokeai-merge --gui -- Model merging script with graphical front end
  • invokeai-ti --gui -- Textual inversion script with graphical front end
  • invokeai-configure -- Configuration tool for initializing the invokeai 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.

Known Bugs in RC7

These are known bugs that will not be fixed prior to the release.

  1. The Ancestral DPMSolverMultistepScheduler (k_dpmpp_2a) sampler is not yet implemented for diffusers models and will disappear from the WebUI Sampler menu when a diffusers model is selected. Support will be added in the next diffusers library release.
  2. Metadata will not at first be retrieved when uploading an image into the WebGUI. The metadata will appear when the WebUI is reset and the page reloaded.
  3. The noise and threshold values are not loaded into the WebUI when the "*" (reuse all values) button is selected.
  4. The k_heun and k_dpm_2 schedulers will appear to perform twice as many sampling steps than were requested. This is an artifact of the fact that these schedulers perform two samplings per step and is a cosmetic issue only.
  5. When launching the Textual Inversion console-based GUI, if the command window is too small, the GUI will crash with an obscure error message. Make the window larger and relaunch.

Help

Please see the InvokeAI Issues Board or the InvokeAI Discord for assistance from the development team.

Contributors

InvokeAI is the product of the loving attention of a large number of Contributors. For this release in particular, we'd like to recognize the combined efforts of Kevin Turner (@keturn), who got the diffusers port past the finish line, Eugene Brodsky (@ebr), for his work on the new installer, and Matthias Wild (@mauwii), for his many significant improvements to the testing pipeline and for setting up the system that uploads releases to the PyPi Python module repository.

We'd also like to call out Jonathon Pollack (@JPPhoto) for tirelessly testing each release candidate, @blessedcoolant and @psychedelicious for their work on the Web UI Model Manager and other UI features, and Kent Keirsey (@hipsterusername) for his amazing videos, outreach and team management.

What's Changed

New Contributors

Full Changelog: v2.2.4...v2.3.0-rc5

Acknowledgements:

  • This release was supported in part by compute capacity provided by Mahdi Chaker's "GPU Garden" cluster
  • A thousand thanks to @gogurtenjoyer and @whosawhatsis for their tireless work supporting users on the Discord server, as well as their contributions to bug finding and fixing.