/sdw-better-prompt

Stable Diffusion web UI extension that provides a better UI for prompt editing.

Primary LanguageJavaScriptMIT LicenseMIT

Better Prompt

English | 日本語

Better Prompt is an extension of the Stable Diffusion web UI that adds a UI to assist with prompt input and editing.

Image - Overview

Overview

Better Prompt was created to reduce the various inconveniences of traditional prompt input and editing. It allows you to set Textual Inversion and LoRA without displaying Extra networks (🎴), rearrange the order of prompts by drag and drop, and adjust the emphasis level of prompts through a GUI.

Installation

You can install it from the "Install from URL" option in the Extensions tab. Simply enter https://github.com/eideehi/sd-webui-better-prompt.git in the "URL for extension’s git repository" field and press the "Install" button.

Image - Install

Installing using Git

You can also install it by executing the following command in the directory where Stable Diffusion web UI is installed.

git clone https://github.com/eideehi/sd-webui-better-prompt.git extensions/sd-webui-better-prompt

Better Prompt is not displayed or the display is broken

By installing it using the above methods, the latest version will be installed. However, it may not work well with the version of Web UI you are using. If Better Prompt is not displayed properly, it may be possible to resolve the issue by using a different version.

Tip
You can change the version of Better Prompt from the Settings tab. For more information, refer to Version of Better Prompt.

Usage

Better Prompt adds the part enclosed by the red line in the image below. We will explain how to use this added content from now on.

Image - Components

Prompt Addition Form

Adding a prompt is done using the three elements shown in the following image.

Image - Input Component

[1] Prompt Input Field

Enter a prompt in this field and press the Enter key to add the content to the positive prompt. Alternatively, press the Shift key while pressing Enter to add the content to the negative prompt. If there are Textual Inversion, LoRA, or Danbooru tags similar to the input content, they will be displayed in a list in [3] Suggest Area.

Tip
Fuse.js is used for similarity determination, allowing various determination methods such as "exact match," "prefix/suffix," and "AND/OR/NOT" to be used. For more information, refer to the fusejs.io documentation.
Tip
Press the Tab key to move the focus to the elements in [3] Suggest Area, and press the Escape key to return the focus. The selected element can be added to the positive (negative) prompt by pressing Enter (or Shift + Enter).

[2] Suggest Filters

Only elements with a check in these filters will be displayed in [3] Suggest Area.

[3] Suggest Area

Displays a list of up to 20 elements similar to the content entered in [1] Prompt Input Field. An example of the items to be added is shown in the following image.

Image - Suggest Items

Green is Textual Inversion, blue is LoRA, and the last is Danbooru tags. Clicking (or Shift-clicking) these elements allows them to be added to the positive (negative) prompt.

Note
LoRA cannot be added to the negative prompt, so please be careful.
Tip
You can check the thumbnail by right-clicking on the elements of Textual Inversion and LoRA.

Prompt Editing

Prompt editing is done using the two elements shown in the following image.

Image - Prompt Component

[1] Positive Prompt

Prompts added using Prompt Addition Form are displayed in this area. This element is synchronized with the positive prompt input area of the web UI.

Tip
Each prompt can be reordered by drag and drop, and can be deleted by clicking while holding the Shift key.
Tip
Right-clicking on LoRA and normal prompts displays a popup for adjusting the emphasis level.
Tip
You can undo or redo your actions on the prompt with [Ctrl + Z] or [Ctrl + Y]

[2] Negative Prompt

Except for not being able to add LoRA, it is the same as [1] Positive Prompt.

Configuration

Better Prompt creates its own configuration section in the Settings tab. Here, we will explain each item.

Image - Settings

Version of Better Prompt

You can change the version of Better Prompt. Selecting a blank space will change it to the latest version at that point. If you change the settings, it is necessary to restart the Web UI. (not just reload)

Tip
The current version of Better Prompt is displayed in the console of the Web UI. Refer to the table below for the Web UI versions corresponding to each version.

Version

Web UI Version (Minimum)

Web UI Version (Maximum)

0.1.0 - 0.3.0

9e1afa9e (2023-03-25)

~

Display update notifications

If checked, it will display notifications when updates are available.

Notify of updates only once per version

If checked, it will only notify once for each version when updates are available.

Interval at which to display update notifications

Specify the interval for displaying update notifications. The unit is "days", and the default value is 1 day.

Language of Better Prompt

Specify the language used by Better Prompt. The default value is blank (English). Currently, ja_JP language is available. If you change the settings, it is necessary to reload the Web UI.

License

Better Prompt is developed and published under the MIT license. For details on the license, please refer to the link below.