From 568e617e5cffcda7d3d77ec1c3cdd592a83eb0e2 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sat, 27 May 2023 19:01:37 +0200 Subject: [PATCH] Update onebuttonprompt.py small fixes regarding "automatic"mode --- scripts/onebuttonprompt.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index d40ab27..daa8bac 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -668,6 +668,8 @@ class Script(scripts.Script): print("Starting generating the prompt") preppedprompt = "" + artistcopy = artist + if(ANDtoggle == "automatic"): preppedprompt += prefixprompt + ", " if(artist != "none"): @@ -680,6 +682,10 @@ class Script(scripts.Script): preppedprompt += ", " + promptcompounderlevel + " animals" if(subject == "object"): preppedprompt += ", " + promptcompounderlevel + " objects" + #sneaky! If we are running on automatic, we don't want "artists" to show up during the rest of the prompt, so set it to none, but only temporary! + + artist = "none" + if(ANDtoggle != "none" and ANDtoggle != "automatic"): preppedprompt += prefixprompt @@ -691,10 +697,14 @@ class Script(scripts.Script): preppedprompt += " \n , " else: preppedprompt += " \n " + seperator + " " - + + #Here is where we build a "normal" prompt preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage) + # set the artist mode back when done (for automatic mode) + artist = artistcopy + # set everything ready p.prompt = preppedprompt p.negative_prompt = negativeprompt