dreambooth-template
dreambooth-template copied to clipboard
support for "prompt attention"
To fully customize prompts, there is a "hack" that popular versions of stable diffusion use to allow you to increase/decrease the strength of each token using parens/square brakets
lpw_stable_diffusion.py is an implementation for this within diffusers
.
def parse_prompt_attention(text):
"""
Parses a string with attention tokens and returns a list of pairs: text and its associated weight.
Accepted tokens are:
(abc) - increases attention to abc by a multiplier of 1.1
(abc:3.12) - increases attention to abc by a multiplier of 3.12
[abc] - decreases attention to abc by a multiplier of 1.1
\( - literal character '('
\[ - literal character '['
\) - literal character ')'
\] - literal character ']'
\\ - literal character '\'
anything else - just text
This might be fairly straightforward to add to the default template
looks like the code mentioned in #26 also supports this ... it might be a good combo