Remove duplicated spaces and commas.
 
 
 
Go to file
Haoming a7991ac752 bug fix 2026-04-08 11:20:48 +08:00
javascript bug fix 2026-04-08 11:20:48 +08:00
scripts update 2026-04-07 11:18:31 +08:00
.gitignore separate & optimize logics 2024-07-11 17:13:26 +08:00
LICENSE update 2026-04-07 11:18:31 +08:00
README.md regex 2026-04-07 14:35:36 +08:00
booru.png overhaul 2025-06-04 14:21:01 +08:00
sample.png overhaul 2025-06-04 14:21:01 +08:00
style.css 2025 2025-03-14 10:55:46 +08:00

README.md

SD Webui Prompt Format

This is an Extension for the Automatic1111 Webui, which helps formatting prompts.

Compatible with Forge


Sometimes, when you type too fast or copy prompts from all over the places, you end up with duplicated spaces and commas. This simple Extension helps removing them whenever you click Generate.


Features

  • Works in both txt2img and img2img
  • Works in both Positive and Negative, as well as Hires. fix prompts
  • Remove extra spaces and commas
  • Fix misplaced brackets, commas, and periods
  • Enable Remove Duplicates to remove identical tags found in the prompts
    • Only checks within the same line
    • Only works for tag-based prompt, not sentence-based prompt
      • e.g. 1girl, solo, smile, 1girl will become 1girl, solo, smile
      • e.g. a girl smiling, a girl standing will not be changed
  • Enable Remove Underscores to replace _ with space
  • Append a comma every line break
  • Toggle between auto formatting and manual formatting
    • In Auto mode: The process is ran whenever you click Generate
    • In Manual mode: The process is only ran when you click on the Format button
  • Press Alt + Shift + F to manually trigger formatting
  • Format the text pasted from clipboard
    • Clean up unwanted texts when pasting from Booru sites

Settings

The settings are in the Prompt Format section under the System category

  • Enable / Disable the above Features
  • Exclude specific tags from Remove Underscores
  • Assign "alias" that count as duplicates

[!Tip] Click the Reload button to refresh the Exclusion, Alias, LoRA names, and Embedding names

[!Note] Some Extensions (e.g. tagcomplete) listen to the text editing event, meaning the formatting will cause them to be triggered. You can disable updating the actual prompts in the settings to prevent this.

Tag Alias

  • You can assign words to be automatically replaced with the specified tag
  • As a result, they can then be removed during Remove Duplicates if needed
  • The syntax is in the format of tag:regex
  • The pattern for alias uses Regular Expression
  • Example:
    1girl:girl|woman|lady
    
    • When you type girl, it will get converted into 1girl
    • Which will get removed if the prompt already contains 1girl

[!Note] The pattern will be wrapped in ^(regex)$