Added AND mode for prompt compounder

This commit is contained in:
AIrjen
2023-04-16 12:18:29 +02:00
parent 0943e43f93
commit ee2c658acd
4 changed files with 17 additions and 6 deletions
+1
View File
@@ -102,6 +102,7 @@ Circlet
-vehicle- Tattoo
-building- Tattoo
Three-eyed
one-eyed
Hair ribbons
Fangs
Belts
1 Glasses
102 -vehicle- Tattoo
103 -building- Tattoo
104 Three-eyed
105 one-eyed
106 Hair ribbons
107 Fangs
108 Belts
+2 -1
View File
@@ -75,4 +75,5 @@ Pain
Beauty
Blood
Elegance
Study
Study
Metal
1 Infinity
75 Beauty
76 Blood
77 Elegance
78 Study
79 Metal
+2 -1
View File
@@ -82,4 +82,5 @@ Stained glass window
Miniature diorama
Anime key visual
Multiple layers of silhouette
Retro comic style artwork
Retro comic style artwork
Metal pin
1 Concept sheet
82 Miniature diorama
83 Anime key visual
84 Multiple layers of silhouette
85 Retro comic style artwork
86 Metal pin
+12 -4
View File
@@ -127,6 +127,10 @@ class Script(scripts.Script):
with gr.Row():
promptcompounderlevel = gr.Dropdown(
promptcompounder, label="Prompt compunder", value=1)
with gr.Row():
ANDtoggle = gr.Checkbox(
label="toggle AND mode"
)
with gr.Row():
gr.Markdown(
"""
@@ -141,14 +145,15 @@ class Script(scripts.Script):
This was originally a bug in the first release when using multiple batches, now brought back as a feature.
Raised by redditor drone2222, to bring this back as a toggle, since it did create interesting results. So here it is.
You can toggle "AND mode". This will seperate the prompts with an AND and a newline. This can than be used in conjuction with the Latent Couple extension.
</font>
"""
)
return [insanitylevel,subject, artist, imagetype, promptlocation, promptcompounderlevel]
return [insanitylevel,subject, artist, imagetype, promptlocation, promptcompounderlevel, ANDtoggle]
def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation, promptcompounderlevel):
def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation, promptcompounderlevel, ANDtoggle):
images = []
infotexts = []
@@ -172,8 +177,11 @@ class Script(scripts.Script):
preppedprompt = ""
for i in range(promptcompounderlevel):
preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype)
if i + 1 != promptcompounderlevel:
preppedprompt += ", "
if(i + 1 != promptcompounderlevel):
if(ANDtoggle):
preppedprompt += " \n AND "
else:
preppedprompt += ", "
if(promptlocation == "in the front" and originalprompt != ""):
p.prompt = originalprompt + ", " + preppedprompt