-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels