Skip to content

v3.9.3 release (Prompt Weighting!)

Compare
Choose a tag to compare
@Teriks Teriks released this 14 Jul 08:56
· 566 commits to master since this release

v3.9.3 release with Windows installer.

Due to the size of the packaged python environment, the installer is within a multi-part zip file.

The multipart zip can be extracted using 7-Zip: https://www.7-zip.org/

Download both dgenerate_installer.zip.001 and dgenerate_installer.zip.002 to a folder.

Unzip dgenerate_installer.zip.001 to a directory (Right click, 7-Zip -> Extract to "dgenerate_installer") and then run dgenerate_installer\dgenerate.msi to install.

dgenerate will be installed under C:\Program Files\dgenerate by default with an isolated python environment provided.

The install directory will be added to PATH, and dgenerate will be available from the command line.

Portable Install

A portable install is provided via dgenerate_portable.zip.001 and dgenerate_portable.zip.002, these contain
nothing but the dgenerate executable and a frozen python environment which can be placed anywhere.

3.9.3 Patch Fix

Fix unquoted $HF_TOKEN value in Stable Diffusion 3 and DeepFloyd console UI recipe templates, causing issues
with the \setp directive used in the template. Needed to have quotes around $HF_TOKEN in the template due
to changes in how and when the template renderer decides to automatically shell quote a form value.

Fix syntax highlighter failing to immediately re-highlight after Undo/Redo, Cut/Paste, Delete operations
preformed from the UI menus without using hotkeys. Syntax highlighting would not resume until the next
keypress, temporarily displaying unhighlighted text.

Documentation typo fix for letterbox image processor.

3.9.0 Features & Fixes

1.) Prompt weighting

Stable Diffusion Web UI / CivitAI / ComfyUI / InvokeAI style prompt weighting syntax is now implemented
through the argument --prompt-weighter and a new plugin class PromptWeighter.

This argument allows selecting a specific prompt weighter plugin to preform prompt parsing, token weighting, and prompt embed generation.

Prompt weighters circumvent restrictions on prompt length, which is typically 77 tokens.

Currently there are two prompt weighters implemented, compel and sd-embed.

Their documentation can be seen with: dgenerate --prompt-weighter-help compel sd-embed

The compel prompt weighter plugin uses the compel library to support InvokeAI style prompt weighting syntax, and also supports automatically translating your prompt from Stable Diffusion Web UI syntax into compel syntax via the plugin argument syntax=sdwui.

The compel prompt weighter supports Stable Diffusion 1/2, and Stable Diffusion XL model types:

  • --model-type torch
  • --model-type torch-pix2pix
  • --model-type torch-upscaler-x4
  • --model-type torch-sdxl
  • --model-type torch-sdxl-pix2pix

The sd-embed prompt weighter uses the sd_embed library to support Stable Diffusion Web UI / CivitAI / ComfyUI prompt weighting syntax. This prompt weighter is currently using code from a fork I have VRAM optimized, found here

The sd-embed prompt weighter supports Stable Diffusion 1/2, Stable Diffusion XL, and Stable Diffusion 3 model types:

  • --model-type torch
  • --model-type torch-pix2pix
  • --model-type torch-upscaler-x4
  • --model-type torch-sdxl
  • --model-type torch-sdxl-pix2pix
  • --model-type torch-sd3

For more information about prompt weighting with dgenerate, see: Prompt Weighting and Enhancement in the readme.

2.) Prompt length warnings

Warn the user about prompt truncation when not using a --prompt-weighter implementation, this will warn you when your prompt is too long for the models tokenizer max sequence length. If you get this warning you should select a --prompt-weighter implementation, or reduce the length of your prompt.

3.) New image processors & image processor fixes

Implemented new image processors:

  • anyline (MistoLine Control Any Line preprocessor, see: https://huggingface.co/TheMistoAI/MistoLine)
  • lineart-standard (Basic non model based variant of lineart / lineart-anime)
  • teed (TEED tiny efficient edge detector)
  • zoe (ZoeDepth depth detector)

Fixed an issue with the detect-resolution argument of various image processors not returning the image to its original size
after detection was preformed.

4.) Improved extensibility

All plugin types implemented by dgenerate can now be loaded through --plugin-modules, and \import_plugins inside config scripts.

Previously only image processors, config directives, and config template functions supported external extensibility, in a hard coded manner internally. Now sub-commands and prompt weighters can be written as external plugins as well.

An architecture change has been made so that going forward any plugin loader class can automatically discover classes through --plugin-modules and \import_plugins without any extra work having to be done internally to support it.

New plugin code examples for sub-commands and prompt weighters can be found in the writing_plugins examples folder

5.) Improved argument validation

Better argument validation when using plugin help arguments such as --image-processor-help etc.. this corrects the problem
of the CLI allowing you to mistype something such as dgenerate --plugin-paths plugin.py --image-processor-help my-processor, resulting in your plugin not being listed because the correct command is infact:

dgenerate --plugin-modules plugin.py --image-processor-help my-processor

Previously the only validated argument was the plugin help argument, with all unknown arguments being ignored. Now when one of these arguments is encountered, the other arguments are validated, meaning it will raise an error on --plugin-paths for example as that is not a valid argument name.

6.) New template functions for image dimension manipulation

Added config template functions align_size, pow2_size, size_is_aligned, and size_is_pow2 for checking and adjusting the alignment of image dimension values inside of config scripts.

See: dgenerate --functions-help align_size pow2_size size_is_aligned size_is_pow2 for their documentation.

Or: \functions_help align_size pow2_size size_is_aligned size_is_pow2 if you are working with a config file or the Console UI.

7.) Console UI, insert recipe form overhaul

The insert recipe form now scrolls to support more form fields, and now supports selecting image processor implementations by name where applicable.

Image processor selection includes dynamic form controls for specifying image processor argument values, and a help button that you can click to show the documentation for the selected image processor.

The insert recipe form can now be used to select dgenerate argument values for --post-processors, --seed-image-processors, --control-image-processors, and --mask-image-processors using this new feature.

Two new recipes named Generic Image Process and Generic Image Process (to directory) have been added which make use of this feature to build an \image_process directive that can be inserted into your config.

There have been many other changes to the insert recipe form, including additional fields / access to more options, toggles, drastically improved input validation, and the ability to select a file OR directory for applicable model arguments.

8.) Console UI, new insert / build URI options

Two new URI insertion features have been added to the Console UI.

Using Edit -> Insert Image Seed URI will allow you to use a form with file select dialogs to build an --image-seeds URI, you can specify each component of the URI (seed image, inpaint mask, control image) and a URI with proper syntax will be formatted for you and inserted into the config. You may also specify the per image-seed resize & and aspect correct resize argument values (the default value for aspect correct resizing is True)

Using Edit -> Insert Image Processor URI will allow you to insert an image processor URI in a similar fashion to inserting a Karras Scheduler URI (a previously existing feature).

A form is generated based on the selected image processors arguments.

Inserting with this form will insert an Image Processor URI formatted with all the provided arguments.

9.) Console UI, version info / latest version check

The Console UI now shows the current software version next to the Help -> Homepage menu item.

If you are connected to the internet upon launch and github is reachable, a check for the latest release will occur,
if there is a newer release, a link to it will be added to the bottom section of the Help menu.

It will be in the format Newer Release Available! (vX.X.X), and clicking it will open your web browser to the page
for the latest release on github.

This way you can check if there is a software update available from the UI.

10.) Image generation improvements.

Stable Cascade can now produce images with output dimensions aligned to 128 instead of only power of 2 images.

Stable Diffusion 3 can now preform VAE tiling --vae-tiling on images with output dimensions aligned to 16 instead of only power of 2 images.

11.) Bugfix model loading from directories

Fix bug in determining diffusers model loading method, which caused loading diffusers models out of directories to stop working.

12.) Dependency updates

Diffusers: 0.29.2

controlnet_aux: 0.0.9

No longer vendoring most of controlnet_aux, only vendoring the PidiNet detector for a bugfix which allows it to run on
other GPUs besides GPU 0. See: huggingface/controlnet_aux#109

Known Issues

Diffusers

When auto downloading a ControlNet model using a https://huggingface.co/ model slug, such as diffusers/controlnet-zoe-depth-sdxl-1.0 for example, no progress bar will be displayed while it downloads to the cache.

This is a diffusers library issue, see: huggingface/diffusers#8847

For now, just wait patiently for any ControlNet models you have specified to download if they are not already cached,
they can be large and the program may appear hung while they are being downloaded. :)