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.
- Works in both
txt2img
andimg2img
- Works in both
Positive
andNegative
, as well asHires. fix
prompts - Remove extra spaces and commas
- Fix misplaced brackets and commas
- Enable
Remove Duplicates
to remove identical tags found in the prompts- Note: Only works for tag-based prompt, not sentence-based prompt
- e.g.
1girl, solo, smile, 1girl
will become1girl, solo, smile
- e.g.
a girl smiling, a girl standing
will not be changed
- e.g.
- Note: Only works for tag-based prompt, not sentence-based prompt
- Enable
Remove Underscores
to replace_
withspace
- Respect line breaks
Remove Duplicates
only checks within the same line
- Append a comma every line break
- Toggle between auto formatting and manual formatting
- In
Auto
mode: The process is ran whenever you click on Generate - In
Manual
mode: The process is only ran when you click the Format button
- In
- Pressing
Alt
+Shift
+F
can also manually trigger formatting - Format the text pasted from clipboard
- Toggle whether the above features are enabled / disabled by default in the
Prompt Format
section under the System category of the Settings tab - Exclude specific tags from
Remove Underscores
- Assign "alias" that counts as duplicates for the specified tags
- Click
Reload
to refresh the 2 settings above
Note
Some Extensions (eg. 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.
Booru
-
You can assign other tags that count as the same as the main tag, which then get removed during
Remove Duplicates
-
The syntax is in the format of
main tag: alias1, alias2, alias3
- example:
1girl: girl, woman, lady
- If you type
girl
, it will get converted into1girl
, which will get removed if the prompt already contains1girl
- If you type
- example:
-
The pattern for alias uses Regular Expression, so certain symbols (e.g.
(
,)
) will need to be escaped (i.e.\(
,\)
)- Comma is not supported, as it is used to separate multiple patterns