From ae458e1ea385f390ba3bed1edcd809f604c3f4ae Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sun, 16 Apr 2023 07:40:56 +0200 Subject: [PATCH 01/14] temp check in --- csvfiles/moods.csv | 4 ++- scripts/onebuttonprompt.py | 65 +++++++++++++++++++++++++++++++++++--- 2 files changed, 64 insertions(+), 5 deletions(-) diff --git a/csvfiles/moods.csv b/csvfiles/moods.csv index d68cc77..f73d362 100644 --- a/csvfiles/moods.csv +++ b/csvfiles/moods.csv @@ -28,4 +28,6 @@ Horror Dark Light Relaxed -Tranquil \ No newline at end of file +Tranquil +Regret +Suffering \ No newline at end of file diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index f00da86..c1f0961 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -13,6 +13,7 @@ subjects = ["all","object","animal","humanoid", "landscape", "concept"] artists = ["all", "none"] imagetypes = ["all", "photograph", "octane render","digital art","concept art", "painting", "portait"] promptmode = ["at the back", "in the front"] +promptbleed = [1,2,3,4,5,6,7,8] class Script(scripts.Script): @@ -99,12 +100,53 @@ class Script(scripts.Script): 6. portait + + + ### Location of existing prompt + + + If you put a prompt in the prompt field, it will be added onto the generated prompt. You can determine where to put it in the front or the back of the generated prompt. + + 1. at the back + + 2. in the front + """ ) - return [insanitylevel,subject, artist, imagetype, promptlocation] + with gr.Tab("Advanced"): + with gr.Row(): + promptbleedlevel = gr.Dropdown( + promptbleed, label="decker12 mode", value=1) + with gr.Row(): + gr.Markdown( + """ + ### decker12 mode + + + Named after the original redditor, decker12, who found this bug. After each batch, it would start compounding older prompts on top of the new prompt. They would bleed into eachother. + + A question was raised by redditor drone2222, to bring this back as a toggle, since it did create interesting results. So here it is. + + This value now determines how many prompt should bleed into eachother. Keep it at 1 for normal prompting! + For a value of 3 the following happens when generating multiple batches: + + batch 1: prompt A + + batch 2: prompt B + A + + batch 3: Prompt C + B + A + + batch 4: Prompt D + C + B + + + + """ + ) + + return [insanitylevel,subject, artist, imagetype, promptlocation, promptbleedlevel] - def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation): + def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation, promptbleedlevel): images = [] infotexts = [] @@ -118,14 +160,29 @@ class Script(scripts.Script): p.n_iter = 1 p.batch_size = 1 originalprompt = p.prompt + promptlist = [] + promptlistcounter = 1 + promptbleedlevel += 1 #if its 0 we want 1, etc for i in range(batches): + # prompt bleeding + frompromptlistcounter = promptlistcounter - promptbleedlevel + if frompromptlistcounter < 0: + frompromptlistcounter = 0 + promptlist.append(build_dynamic_prompt(insanitylevel,subject,artist, imagetype)) + + preppedprompt = ', '.join(promptlist[frompromptlistcounter:promptlistcounter]) + if(promptlocation == "in the front"): - p.prompt = originalprompt + ", " + build_dynamic_prompt(insanitylevel,subject,artist, imagetype) + p.prompt = originalprompt + ", " + preppedprompt else: - p.prompt = build_dynamic_prompt(insanitylevel,subject,artist, imagetype) + ", " + originalprompt # add existing prompt to the back? + p.prompt = preppedprompt+ ", " + originalprompt # add existing prompt to the back? + + promptlistcounter += 1 + + for j in range(batchsize): processed = process_images(p) From 8f6cc554aa02f4ee8ec63835801661623bf6722a Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sun, 16 Apr 2023 09:03:30 +0200 Subject: [PATCH 02/14] Update onebuttonprompt.py prompt compounder feature implemented --- scripts/onebuttonprompt.py | 63 ++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index c1f0961..e2e6a9d 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -13,7 +13,7 @@ subjects = ["all","object","animal","humanoid", "landscape", "concept"] artists = ["all", "none"] imagetypes = ["all", "photograph", "octane render","digital art","concept art", "painting", "portait"] promptmode = ["at the back", "in the front"] -promptbleed = [1,2,3,4,5,6,7,8] +promptcompounder = [1,2,3,4,5] class Script(scripts.Script): @@ -116,37 +116,30 @@ class Script(scripts.Script): ) with gr.Tab("Advanced"): with gr.Row(): - promptbleedlevel = gr.Dropdown( - promptbleed, label="decker12 mode", value=1) + promptcompounderlevel = gr.Dropdown( + promptcompounder, label="Prompt compunder", value=1) with gr.Row(): gr.Markdown( """ - ### decker12 mode + ### Prompt compounder - Named after the original redditor, decker12, who found this bug. After each batch, it would start compounding older prompts on top of the new prompt. They would bleed into eachother. + Normally, it creates a single random prompt. With prompt compounder, it will generate multiple prompts and compound them together. + + Keep at 1 for normal behavior. + Set to different values to compound that many prompts together. My suggestion is to try 2 first. + + 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. - A question was raised by redditor drone2222, to bring this back as a toggle, since it did create interesting results. So here it is. - - This value now determines how many prompt should bleed into eachother. Keep it at 1 for normal prompting! - For a value of 3 the following happens when generating multiple batches: - - batch 1: prompt A - - batch 2: prompt B + A - - batch 3: Prompt C + B + A - - batch 4: Prompt D + C + B - """ ) - return [insanitylevel,subject, artist, imagetype, promptlocation, promptbleedlevel] + return [insanitylevel,subject, artist, imagetype, promptlocation, promptcompounderlevel] - def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation, promptbleedlevel): + def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation, promptcompounderlevel): images = [] infotexts = [] @@ -160,31 +153,33 @@ class Script(scripts.Script): p.n_iter = 1 p.batch_size = 1 originalprompt = p.prompt - promptlist = [] - promptlistcounter = 1 - promptbleedlevel += 1 #if its 0 we want 1, etc + for i in range(batches): - # prompt bleeding - frompromptlistcounter = promptlistcounter - promptbleedlevel - if frompromptlistcounter < 0: - frompromptlistcounter = 0 - promptlist.append(build_dynamic_prompt(insanitylevel,subject,artist, imagetype)) + # prompt compounding + print("Starting generating the prompt") + preppedprompt = "" + for i in range(promptcompounderlevel): + preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype) + if i + 1 != promptcompounderlevel: + preppedprompt += ", " - preppedprompt = ', '.join(promptlist[frompromptlistcounter:promptlistcounter]) - - if(promptlocation == "in the front"): + if(promptlocation == "in the front" and originalprompt != ""): p.prompt = originalprompt + ", " + preppedprompt + elif(promptlocation == "at the back" and originalprompt != ""): + p.prompt = preppedprompt + ", " + originalprompt # add existing prompt to the back? else: - p.prompt = preppedprompt+ ", " + originalprompt # add existing prompt to the back? - - promptlistcounter += 1 + p.prompt = preppedprompt # dont add anything for j in range(batchsize): + print(" ") + print("Full prompt to be processed:") + print(" ") + print(p.prompt) processed = process_images(p) images += processed.images infotexts += processed.infotexts From dd3fc731be05e1c3b8b80ad68d26c7fbd15c1c94 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sun, 16 Apr 2023 09:44:51 +0200 Subject: [PATCH 03/14] added multiple image types and other types --- build_dynamic_prompt.py | 14 ++++++++++++-- csvfiles/othertypes.csv | 5 ++++- scripts/onebuttonprompt.py | 21 +++++++++++++++------ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index 5b78977..8ff4ef8 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -19,6 +19,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all humanspecial = 0 wereanimaladded = 0 isweighted = 0 + amountofimagetypes = 0 hybridorswap = "" artistmode = "normal" @@ -129,9 +130,18 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all if artistmode in ["enhancing"]: completeprompt += " [" - if(imagetype != "all"): + if(imagetype != "all" and imagetype != "all - force multiple" and imagetype != "only other types"): completeprompt += " " + imagetype + " " - elif(normal_dist(insanitylevel)): + elif(imagetype == "all - force multiple"): + amountofimagetypes = random.randint(2,3) + elif(imagetype == "only other types"): + othertype = 1 + completeprompt = add_from_csv(completeprompt, "othertypes", 1, ""," of a ") + + if(imagetype == "all" and normal_dist(insanitylevel)): + amountofimagetypes = 1 + + for i in range(amountofimagetypes): # one in 6 images is a complex/other type if(random.randint(0,5) < 5): completeprompt = add_from_csv(completeprompt, "imagetypes", 1, "",",") diff --git a/csvfiles/othertypes.csv b/csvfiles/othertypes.csv index 3524f5b..68140ec 100644 --- a/csvfiles/othertypes.csv +++ b/csvfiles/othertypes.csv @@ -79,4 +79,7 @@ mandala zentangle Natural parks travel poster Stained glass window -Miniature diorama \ No newline at end of file +Miniature diorama +Anime key visual +Multiple layers of silhouette +Retro comic style artwork \ No newline at end of file diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index e2e6a9d..32a1ddf 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -11,7 +11,7 @@ from build_dynamic_prompt import * subjects = ["all","object","animal","humanoid", "landscape", "concept"] artists = ["all", "none"] -imagetypes = ["all", "photograph", "octane render","digital art","concept art", "painting", "portait"] +imagetypes = ["all", "all - force multiple", "photograph", "octane render","digital art","concept art", "painting", "portait", "anime key visual", "only other types"] promptmode = ["at the back", "in the front"] promptcompounder = [1,2,3,4,5] @@ -87,19 +87,28 @@ class Script(scripts.Script): There are an immense number of image types, not only paintings and photo's, but also isometric renders and funko pops. You can however, overwrite it with the most popular ones. + + + 1. all --> normally picks a image type as random. Can choose a 'other' more unique type. + + 2. all - force multiple --> idea by redditor WestWordHoeDown, it forces to choose between 2 and 3 image types - 1. photograph + 3. photograph - 2. octane render + 4. octane render - 3. digital art + 5. digital art - 4. concept art + 6. concept art - 5. painting + 7. painting 6. portait + 7. anime key visual + + 8. only other types --> Will pick only from the more unique types, such as stained glass window or a funko pop + ### Location of existing prompt From d6c62cba81b23193225f60452a87c49b3cf6693b Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sun, 16 Apr 2023 09:56:47 +0200 Subject: [PATCH 04/14] Minor list updates --- csvfiles/colors.csv | 3 ++- csvfiles/locations.csv | 3 ++- csvfiles/materials.csv | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/csvfiles/colors.csv b/csvfiles/colors.csv index eebea9a..9949db4 100644 --- a/csvfiles/colors.csv +++ b/csvfiles/colors.csv @@ -45,4 +45,5 @@ Neon Lime green Rainbow Psychedelic -Gradient \ No newline at end of file +Gradient +Pearlescent \ No newline at end of file diff --git a/csvfiles/locations.csv b/csvfiles/locations.csv index af8b7c8..8f474ab 100644 --- a/csvfiles/locations.csv +++ b/csvfiles/locations.csv @@ -669,4 +669,5 @@ The Great Barrier Reef The Terracotta Army The Moai of Easter Island -material- caverns -city of -material- \ No newline at end of file +city of -material- +-color- nebula \ No newline at end of file diff --git a/csvfiles/materials.csv b/csvfiles/materials.csv index 2bfb1e8..d455345 100644 --- a/csvfiles/materials.csv +++ b/csvfiles/materials.csv @@ -109,4 +109,8 @@ Vines Cobblestone Moss Scales -Alabaster \ No newline at end of file +Alabaster +Jelly +Pearl +Opal +Diamond \ No newline at end of file From 3e61fb5f2fddf635181c3f5bd2b673bf34c44e7a Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sun, 16 Apr 2023 10:17:20 +0200 Subject: [PATCH 05/14] Added great works of art --- build_dynamic_prompt.py | 3 +++ csvfiles/accessories.csv | 3 ++- csvfiles/buildings.csv | 4 +++- csvfiles/fictional characters.csv | 3 ++- csvfiles/greatworks.csv | 13 +++++++++++++ csvfiles/locations.csv | 4 +++- random_functions.py | 6 ++++++ 7 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 csvfiles/greatworks.csv diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index 8ff4ef8..74d793f 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -449,6 +449,9 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all if(uncommon_dist(insanitylevel)): completeprompt = add_from_csv(completeprompt, "vomit", 1, "","") + #adding a great work of art, like starry night has cool effects. But this should happen only very rarely. + if(novel_dist(insanitylevel)): + completeprompt = add_from_csv(completeprompt, "greatworks", 1, "","") # everyone loves the adding quality. The better models don't need this, but lets add it anyway if(uncommon_dist(insanitylevel)): diff --git a/csvfiles/accessories.csv b/csvfiles/accessories.csv index 6cd89d4..cc4b10f 100644 --- a/csvfiles/accessories.csv +++ b/csvfiles/accessories.csv @@ -104,4 +104,5 @@ Circlet Three-eyed Hair ribbons Fangs -Belts \ No newline at end of file +Belts +-material- helmet \ No newline at end of file diff --git a/csvfiles/buildings.csv b/csvfiles/buildings.csv index 26d8b1b..6be724b 100644 --- a/csvfiles/buildings.csv +++ b/csvfiles/buildings.csv @@ -173,4 +173,6 @@ The Sydney Opera House The Eiffel Tower The Pyramids of Teotihuacan The Burj Khalifa -The Golden Gate Bridge \ No newline at end of file +The Golden Gate Bridge +Stargate +Portal \ No newline at end of file diff --git a/csvfiles/fictional characters.csv b/csvfiles/fictional characters.csv index 531e7ef..b9ddc53 100644 --- a/csvfiles/fictional characters.csv +++ b/csvfiles/fictional characters.csv @@ -541,4 +541,5 @@ Levi Ackerman Saitama Jotaro Kujo Guts -Alucard \ No newline at end of file +Alucard +-animal- like human \ No newline at end of file diff --git a/csvfiles/greatworks.csv b/csvfiles/greatworks.csv new file mode 100644 index 0000000..a105d4f --- /dev/null +++ b/csvfiles/greatworks.csv @@ -0,0 +1,13 @@ +Starry Night +Mona Lisa +Laocoön +the david +girl with the pearl earring +the birth of venus +the last supper +the great wave +Venus of Willendorf +Bust of Nefertiti +Christ Pantocrator +The Creation of Adam +The Scream \ No newline at end of file diff --git a/csvfiles/locations.csv b/csvfiles/locations.csv index 8f474ab..d040492 100644 --- a/csvfiles/locations.csv +++ b/csvfiles/locations.csv @@ -670,4 +670,6 @@ The Terracotta Army The Moai of Easter Island -material- caverns city of -material- --color- nebula \ No newline at end of file +-color- nebula +Wormhole +Portal \ No newline at end of file diff --git a/random_functions.py b/random_functions.py index cc35dfd..4d7e00d 100644 --- a/random_functions.py +++ b/random_functions.py @@ -24,4 +24,10 @@ def unique_dist(insanitylevel): roll = (random.randint(1, 75) Date: Sun, 16 Apr 2023 10:31:55 +0200 Subject: [PATCH 06/14] Added 'from inside' logic --- build_dynamic_prompt.py | 23 +++++++++++++++++++---- csvfiles/imagetypes.csv | 2 +- scripts/onebuttonprompt.py | 4 ++-- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index 74d793f..6605c65 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -22,6 +22,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all amountofimagetypes = 0 hybridorswap = "" artistmode = "normal" + insideshot = 0 if(insanitylevel==0): insanitylevel = random.randint(1, 10) # 10 = add everything, 1 is add almost nothing @@ -150,9 +151,9 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt = add_from_csv(completeprompt, "othertypes", 1, ""," of a ") - if(mainchooser in ["object", "animal", "humanoid", "concept"] and othertype == 0 and "portait" not in completeprompt): + if(mainchooser in ["object", "animal", "humanoid", "concept"] and othertype == 0 and "portrait" not in completeprompt): completeprompt = add_from_csv(completeprompt, "shotsizes", 0, ""," of a ") - elif("portait" in completeprompt): + elif("portrait" in completeprompt): completeprompt += " ,close up of a " # Multiple subjects doesnt really work, need to think of other way to do multiple subjects. Maybe AND in the prompt? # if(subjectchooser in ["object", "animal", "humanoid"] and rare_dist(insanitylevel)): @@ -287,7 +288,14 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt += ":" + "-location-" + ":" + str(random.randint(1,5)) + "]" hybridorswap = "" - if(normal_dist(insanitylevel)): + # shots from inside can create cool effects in landscapes + if(legendary_dist(insanitylevel)): + insideshot = 1 + completeprompt += " from inside of a " + addontolocation = ["locations","buildings"] + completeprompt = add_from_csv(completeprompt, random.choice(addontolocation), 0, "","") + + if(normal_dist(insanitylevel) and insideshot == 0): completeprompt += " and " if(rare_dist(insanitylevel)): completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") @@ -296,6 +304,8 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all addontolocation = ["locations","buildings", "vehicles"] completeprompt = add_from_csv(completeprompt, random.choice(addontolocation), 0, "","") + + if(subjectchooser == "event"): completeprompt = add_from_csv(completeprompt, "events", 0, "\"","\"") @@ -387,8 +397,13 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all if(uncommon_dist(insanitylevel)): completeprompt = add_from_csv(completeprompt, "accessories", 1, "","") + if(legendary_dist(insanitylevel) and subjectchooser not in ["landscape", "concept"]): + insideshot = 1 + completeprompt += ", from inside of a " + addontolocation = ["locations","buildings"] + completeprompt = add_from_csv(completeprompt, random.choice(addontolocation), 0, "","") - if(subjectchooser not in ["landscape", "concept"] and humanspecial != 1 and normal_dist(insanitylevel)): + if(subjectchooser not in ["landscape", "concept"] and humanspecial != 1 and insideshot == 0 and normal_dist(insanitylevel)): backgroundtype = ["landscape", "buildingbackground", "insidebuilding"] match random.choice(backgroundtype): case "landscape": diff --git a/csvfiles/imagetypes.csv b/csvfiles/imagetypes.csv index 7278b2c..08b921f 100644 --- a/csvfiles/imagetypes.csv +++ b/csvfiles/imagetypes.csv @@ -31,5 +31,5 @@ Unreal Engine VRay Abstract Fractal -Portait +portrait Raw digital photo \ No newline at end of file diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index 32a1ddf..ae5d167 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -11,7 +11,7 @@ from build_dynamic_prompt import * subjects = ["all","object","animal","humanoid", "landscape", "concept"] artists = ["all", "none"] -imagetypes = ["all", "all - force multiple", "photograph", "octane render","digital art","concept art", "painting", "portait", "anime key visual", "only other types"] +imagetypes = ["all", "all - force multiple", "photograph", "octane render","digital art","concept art", "painting", "portrait", "anime key visual", "only other types"] promptmode = ["at the back", "in the front"] promptcompounder = [1,2,3,4,5] @@ -103,7 +103,7 @@ class Script(scripts.Script): 7. painting - 6. portait + 6. portrait 7. anime key visual From 0943e43f9312b9d32a449310413c5661e3576372 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sun, 16 Apr 2023 11:56:04 +0200 Subject: [PATCH 07/14] Added possiblity for multiple image types as a rare chance --- build_dynamic_prompt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index 6605c65..70f4a05 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -133,13 +133,13 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all if(imagetype != "all" and imagetype != "all - force multiple" and imagetype != "only other types"): completeprompt += " " + imagetype + " " - elif(imagetype == "all - force multiple"): + elif(imagetype == "all - force multiple" or rare_dist(insanitylevel)): amountofimagetypes = random.randint(2,3) elif(imagetype == "only other types"): othertype = 1 completeprompt = add_from_csv(completeprompt, "othertypes", 1, ""," of a ") - if(imagetype == "all" and normal_dist(insanitylevel)): + if(imagetype == "all" and normal_dist(insanitylevel) and amountofimagetypes <= 1): amountofimagetypes = 1 for i in range(amountofimagetypes): From ee2c658acdc04499e7a7e7aef1031998f33b14a8 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Sun, 16 Apr 2023 12:18:29 +0200 Subject: [PATCH 08/14] Added AND mode for prompt compounder --- csvfiles/accessories.csv | 1 + csvfiles/concept_suffix.csv | 3 ++- csvfiles/othertypes.csv | 3 ++- scripts/onebuttonprompt.py | 16 ++++++++++++---- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/csvfiles/accessories.csv b/csvfiles/accessories.csv index cc4b10f..d2946f4 100644 --- a/csvfiles/accessories.csv +++ b/csvfiles/accessories.csv @@ -102,6 +102,7 @@ Circlet -vehicle- Tattoo -building- Tattoo Three-eyed +one-eyed Hair ribbons Fangs Belts diff --git a/csvfiles/concept_suffix.csv b/csvfiles/concept_suffix.csv index 1f88e3c..440241a 100644 --- a/csvfiles/concept_suffix.csv +++ b/csvfiles/concept_suffix.csv @@ -75,4 +75,5 @@ Pain Beauty Blood Elegance -Study \ No newline at end of file +Study +Metal \ No newline at end of file diff --git a/csvfiles/othertypes.csv b/csvfiles/othertypes.csv index 68140ec..8303852 100644 --- a/csvfiles/othertypes.csv +++ b/csvfiles/othertypes.csv @@ -82,4 +82,5 @@ Stained glass window Miniature diorama Anime key visual Multiple layers of silhouette -Retro comic style artwork \ No newline at end of file +Retro comic style artwork +Metal pin \ No newline at end of file diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index ae5d167..a2e7aff 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -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. """ ) - 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 From eed743d1e90eeaa20b41f3d08547721a3ea42b59 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Tue, 18 Apr 2023 19:15:30 +0200 Subject: [PATCH 09/14] lots of list refinements --- build_dynamic_prompt.py | 6 +- csvfiles/accessories.csv | 5 +- csvfiles/animals.csv | 12 ++- csvfiles/artmovements.csv | 3 +- csvfiles/buildings.csv | 4 +- csvfiles/concept_prefix.csv | 3 +- csvfiles/concept_suffix.csv | 4 +- csvfiles/cultures.csv | 3 +- csvfiles/descriptors.csv | 6 +- csvfiles/fictional characters.csv | 151 +++++++++++------------------- csvfiles/hairstyles.csv | 3 +- csvfiles/imagetypes.csv | 3 +- csvfiles/jobs.csv | 4 +- csvfiles/locations.csv | 3 +- csvfiles/objects.csv | 3 +- csvfiles/othertypes.csv | 4 +- csvfiles/outfits.csv | 1 + csvfiles/poses.csv | 4 +- csvfiles/shotsizes.csv | 3 +- csvfiles/vomit.csv | 3 +- 20 files changed, 114 insertions(+), 114 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index 70f4a05..ba22f36 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -132,7 +132,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt += " [" if(imagetype != "all" and imagetype != "all - force multiple" and imagetype != "only other types"): - completeprompt += " " + imagetype + " " + completeprompt += " " + imagetype + ", " elif(imagetype == "all - force multiple" or rare_dist(insanitylevel)): amountofimagetypes = random.randint(2,3) elif(imagetype == "only other types"): @@ -335,6 +335,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all humanspecial = 1 speciallist = [" riding a -animal- ", "holding a -object- ", " driving a -vehicle-", " visiting a -building-", "with a -animal-", "surrounded by -object-s"] completeprompt += random.choice(speciallist) + # SD understands emoji's. Can be used to manipulate facial expressions. # emoji, legendary @@ -466,7 +467,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all #adding a great work of art, like starry night has cool effects. But this should happen only very rarely. if(novel_dist(insanitylevel)): - completeprompt = add_from_csv(completeprompt, "greatworks", 1, "","") + completeprompt = add_from_csv(completeprompt, "greatworks", 1, "in style of ","") # everyone loves the adding quality. The better models don't need this, but lets add it anyway if(uncommon_dist(insanitylevel)): @@ -611,6 +612,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt = re.sub('a The', 'The', completeprompt) completeprompt = re.sub('ss ', 's ', completeprompt) + completeprompt = re.sub('ss, ', 's, ', completeprompt) completeprompt = re.sub(' +', ' ', completeprompt[2:]) # remove first character, that is always a comma. Remove any excess spaces diff --git a/csvfiles/accessories.csv b/csvfiles/accessories.csv index d2946f4..23d3889 100644 --- a/csvfiles/accessories.csv +++ b/csvfiles/accessories.csv @@ -106,4 +106,7 @@ one-eyed Hair ribbons Fangs Belts --material- helmet \ No newline at end of file +-material- helmet +Cape +Cloak +-material- trimmings \ No newline at end of file diff --git a/csvfiles/animals.csv b/csvfiles/animals.csv index e2472b3..e2590a5 100644 --- a/csvfiles/animals.csv +++ b/csvfiles/animals.csv @@ -324,4 +324,14 @@ Brachiosaurus Allosaurus Ankylosaurus Diplodocus -Pterodactyl \ No newline at end of file +Pterodactyl +Pikachu +Charizard +Mewtwo +Bulbasaur +Squirtle +Jigglypuff +Snorlax +Eevee +Gyarados +Dragonite \ No newline at end of file diff --git a/csvfiles/artmovements.csv b/csvfiles/artmovements.csv index c60356c..0a67397 100644 --- a/csvfiles/artmovements.csv +++ b/csvfiles/artmovements.csv @@ -134,4 +134,5 @@ Minecraft MinecraftCore Orientalism Art Dieselpunk -Synthwave Art \ No newline at end of file +Synthwave Art +Emopunk \ No newline at end of file diff --git a/csvfiles/buildings.csv b/csvfiles/buildings.csv index 6be724b..36e6f73 100644 --- a/csvfiles/buildings.csv +++ b/csvfiles/buildings.csv @@ -175,4 +175,6 @@ The Pyramids of Teotihuacan The Burj Khalifa The Golden Gate Bridge Stargate -Portal \ No newline at end of file +Portal +Monolith +-color- Monoliths \ No newline at end of file diff --git a/csvfiles/concept_prefix.csv b/csvfiles/concept_prefix.csv index 2c1a4cf..3c23fb6 100644 --- a/csvfiles/concept_prefix.csv +++ b/csvfiles/concept_prefix.csv @@ -93,4 +93,5 @@ Gift Pillars Burden Dawn -Need \ No newline at end of file +Need +Shape \ No newline at end of file diff --git a/csvfiles/concept_suffix.csv b/csvfiles/concept_suffix.csv index 440241a..3da9864 100644 --- a/csvfiles/concept_suffix.csv +++ b/csvfiles/concept_suffix.csv @@ -76,4 +76,6 @@ Beauty Blood Elegance Study -Metal \ No newline at end of file +Metal +Paradise +Sea \ No newline at end of file diff --git a/csvfiles/cultures.csv b/csvfiles/cultures.csv index 420d86d..3e2612c 100644 --- a/csvfiles/cultures.csv +++ b/csvfiles/cultures.csv @@ -173,4 +173,5 @@ Georgian Regency Atomic Age Digital Age -Baroque \ No newline at end of file +Baroque +Pirate \ No newline at end of file diff --git a/csvfiles/descriptors.csv b/csvfiles/descriptors.csv index da6944a..cb9445e 100644 --- a/csvfiles/descriptors.csv +++ b/csvfiles/descriptors.csv @@ -283,4 +283,8 @@ Folded Glam Chic Zen -Rustic \ No newline at end of file +Rustic +Rich +Varied +Injured +Scrumptious \ No newline at end of file diff --git a/csvfiles/fictional characters.csv b/csvfiles/fictional characters.csv index b9ddc53..ff52af6 100644 --- a/csvfiles/fictional characters.csv +++ b/csvfiles/fictional characters.csv @@ -30,7 +30,6 @@ Tinker Bell Peter Pan Captain Hook Winnie the Pooh -Shrek Donkey from Shrek Fiona from Shrek Pinocchio @@ -58,11 +57,6 @@ Slinky Dog from Toy Story Jessie from Toy Story Rex from Toy Story Hamm from Toy Story -Nemo from Finding Nemo -Dory from Finding Nemo -Marlin from Finding Nemo -Crush from Finding Nemo -Squirt from Finding Nemo Lightning McQueen from Cars Mater from Cars Doc Hudson from Cars @@ -71,9 +65,6 @@ Sulley Randall Boggs Remy from Ratatouille Linguini from Ratatouille -Carl Fredricksen from Up -Dug from Up -Russell from Up Joy from Inside Out Sadness from Inside Out Anger from Inside Out @@ -225,12 +216,6 @@ Tauriel Thranduil Arwen Glorfindel -Beren -Luthien -Melian -Tuor -Idril -Earendil Harry Potter Hermione Granger Ron Weasley @@ -370,21 +355,18 @@ Ryu Ken Masters Chun-Li Sub-Zero -Scorpion +Scorpion from Mortal Kombat Solid Snake Big Boss Ezio Auditore Altair Ibn-La'Ahad Aloy -Joel -Ellie Geralt of Rivia Trevor Philips Michael De Santa Franklin Clinton Niko Bellic Tommy Vercetti -CJ Marcus Fenix Dom Santiago Arthur Morgan @@ -392,23 +374,12 @@ John Marston Red Dead Redemption Arthur Curry Cole MacGrath -Bugs Bunny SpongeBob SquarePants Homer Simpson -Scooby-Doo -Tom and Jerry -Pikachu -Woody Woodpecker Betty Boop -Mickey Mouse -Donald Duck -Goofy -Daffy Duck -Garfield Bart Simpson Fred Flintstone Shrek -Stewie Griffin Pink Panther Popeye Charlie Brown @@ -435,81 +406,69 @@ Kyle Broflovski Peter Griffin Brian Griffin Stewie Griffin -Bender +Bender from Futurama Fry from Futurama Leela from Futurama Roger from American Dad -Steve Smith from American Dad -Homer Simpson from The Simpsons -Walter White from Breaking Bad -Tony Soprano from The Sopranos -Don Draper from Mad Men -Ross Geller from Friends -Jerry Seinfeld from Seinfeld -Michael Scott from The Office -Carrie Bradshaw from Sex and the City -Buffy Summers from Buffy the Vampire Slayer -Tyrion Lannister from Game of Thrones -Olivia Pope from Scandal -Dexter Morgan from Dexter -Meredith Grey from Grey's Anatomy -Rachel Green from Friends -Sheldon Cooper from The Big Bang Theory -Lorelai Gilmore from Gilmore Girls -Cookie Lyon from Empire -Barney Stinson from How I Met Your Mother -Daenerys Targaryen from Game of Thrones -Sherlock Holmes from Sherlock -Leslie Knope from Parks and Recreation -Alicia Florrick from The Good Wife +Steve Smith +Walter White +Tony Soprano +Don Draper +Ross Geller +Jerry Seinfeld +Michael Scott +Carrie Bradshaw +Buffy Summers +Tyrion Lannister +Olivia Pope +Dexter Morgan +Meredith Grey +Rachel Green +Sheldon Cooper +Lorelai Gilmore +Cookie Lyon +Barney Stinson +Daenerys Targaryen +Sherlock Holmes +Leslie Knope +Alicia Florrick Eleven from Stranger Things -Carrie Mathison from Homeland -Mindy Lahiri from The Mindy Project +Carrie Mathison +Mindy Lahiri Agent Dale Cooper from Twin Peaks -Eric Cartman from South Park -Will Byers from Stranger Things -Dr. House from House -Claire Underwood from House of Cards -Rick Grimes from The Walking Dead -Carrie Brownstein from Portlandia -Abed Nadir from Community -Agent Mulder from The X-Files -Carmela Soprano from The Sopranos -Fred Flintstone from The Flintstones -Leslie Poole from Veep -Jesse Pinkman from Breaking Bad -Lorelei Lee from The Marvelous Mrs. Maisel -Tracy Jordan from 30 Rock -Omar Little from The Wire -Dwight Schrute from The Office -Tyrone Biggums from Chappelle's Show -Omarosa Manigault Newman from The Apprentice -Issa Dee from Insecure -David Brent from The Office -Betty Draper from Mad Men -Kenny Powers from Eastbound & Down -Selina Meyer from Veep -Peggy Olson from Mad Men +Eric Cartman +Will Byers +Dr. House +Claire Underwood +Rick Grimes +Carrie Brownstein +Abed Nadir +Agent Mulder +Carmela Soprano +Leslie Poole +Jesse Pinkman +Lorelei Lee +Tracy Jordan +Omar Little +Dwight Schrute +Tyrone Biggums +Omarosa Manigault Newman +Issa Dee +David Brent +Betty Draper +Kenny Powers +Selina Meyer +Peggy Olson Ash Ketchum Misty from pokemon Brock from pokemon -Gary Oak from pokemon -Professor Oak from pokemon -Nurse Joy from pokemon -Officer Jenny from pokemon +Gary Oak +Professor Oak +Nurse Joy +Officer Jenny Jessie from pokemon James from pokemon Team rocket -Pikachu -Charizard -Mewtwo -Bulbasaur -Squirtle -Jigglypuff -Snorlax -Eevee -Gyarados -Dragonite John Wick Captain -material-beard -animal-man @@ -542,4 +501,6 @@ Saitama Jotaro Kujo Guts Alucard --animal- like human \ No newline at end of file +-animal- like human +Kermit the frog +Miss piggy \ No newline at end of file diff --git a/csvfiles/hairstyles.csv b/csvfiles/hairstyles.csv index 2f99dc4..81c5548 100644 --- a/csvfiles/hairstyles.csv +++ b/csvfiles/hairstyles.csv @@ -101,4 +101,5 @@ Side-swept curls Pigtails Braided pigtails Space buns -Mermaid waves \ No newline at end of file +Mermaid waves +Balayage \ No newline at end of file diff --git a/csvfiles/imagetypes.csv b/csvfiles/imagetypes.csv index 08b921f..61925fa 100644 --- a/csvfiles/imagetypes.csv +++ b/csvfiles/imagetypes.csv @@ -32,4 +32,5 @@ VRay Abstract Fractal portrait -Raw digital photo \ No newline at end of file +Raw digital photo +Airbrush painting \ No newline at end of file diff --git a/csvfiles/jobs.csv b/csvfiles/jobs.csv index a9cbf39..a06651f 100644 --- a/csvfiles/jobs.csv +++ b/csvfiles/jobs.csv @@ -359,4 +359,6 @@ Sultan Geisha Yogi Adventurer -Royalty \ No newline at end of file +Royalty +Cowboy +Cowgirl \ No newline at end of file diff --git a/csvfiles/locations.csv b/csvfiles/locations.csv index d040492..6e2fea8 100644 --- a/csvfiles/locations.csv +++ b/csvfiles/locations.csv @@ -672,4 +672,5 @@ The Moai of Easter Island city of -material- -color- nebula Wormhole -Portal \ No newline at end of file +Portal +Bamboo Forest \ No newline at end of file diff --git a/csvfiles/objects.csv b/csvfiles/objects.csv index aa95a4d..d02d2a1 100644 --- a/csvfiles/objects.csv +++ b/csvfiles/objects.csv @@ -401,4 +401,5 @@ Baklava Strudel Beignet Scone -Bread \ No newline at end of file +Bread +Skull \ No newline at end of file diff --git a/csvfiles/othertypes.csv b/csvfiles/othertypes.csv index 8303852..15b40be 100644 --- a/csvfiles/othertypes.csv +++ b/csvfiles/othertypes.csv @@ -83,4 +83,6 @@ Miniature diorama Anime key visual Multiple layers of silhouette Retro comic style artwork -Metal pin \ No newline at end of file +Metal pin +a felt muppet +Glitch art \ No newline at end of file diff --git a/csvfiles/outfits.csv b/csvfiles/outfits.csv index 6337398..2e9f752 100644 --- a/csvfiles/outfits.csv +++ b/csvfiles/outfits.csv @@ -486,6 +486,7 @@ Field jacket Chore coat Raincoat Fur coat +Fur trimmed coat Armor Short skirt and a long jacket -material- outfit diff --git a/csvfiles/poses.csv b/csvfiles/poses.csv index bb7bc2f..6e6c07c 100644 --- a/csvfiles/poses.csv +++ b/csvfiles/poses.csv @@ -62,4 +62,6 @@ fashion modeling pose relaxing pose sleeping pose Contrapposto -Tilted head \ No newline at end of file +Tilted head +Action scene +Fluid movement \ No newline at end of file diff --git a/csvfiles/shotsizes.csv b/csvfiles/shotsizes.csv index fcdd651..6ebdfd6 100644 --- a/csvfiles/shotsizes.csv +++ b/csvfiles/shotsizes.csv @@ -36,4 +36,5 @@ cinematic shot overhead angle Sharp focus Street level shot -Fashion shot \ No newline at end of file +Fashion shot +Full length frame \ No newline at end of file diff --git a/csvfiles/vomit.csv b/csvfiles/vomit.csv index 91292ad..f85f66d 100644 --- a/csvfiles/vomit.csv +++ b/csvfiles/vomit.csv @@ -49,4 +49,5 @@ Light sparkles Complex background Plain white background Zentangle -Mandala \ No newline at end of file +Mandala +Luminous trails \ No newline at end of file From 55b7c0d66bca93f8a43964c762d06b6d8f67d878 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Tue, 18 Apr 2023 22:02:00 +0200 Subject: [PATCH 10/14] Added workflow assist tab --- csvfiles/cultures.csv | 4 +- csvfiles/lighting.csv | 3 +- csvfiles/outfits.csv | 2 +- scripts/onebuttonprompt.py | 91 +++++++++++++++++++++++++++++--------- 4 files changed, 76 insertions(+), 24 deletions(-) diff --git a/csvfiles/cultures.csv b/csvfiles/cultures.csv index 3e2612c..db224ac 100644 --- a/csvfiles/cultures.csv +++ b/csvfiles/cultures.csv @@ -174,4 +174,6 @@ Regency Atomic Age Digital Age Baroque -Pirate \ No newline at end of file +Pirate +Dark ages +Burlesque \ No newline at end of file diff --git a/csvfiles/lighting.csv b/csvfiles/lighting.csv index f257355..27d56cf 100644 --- a/csvfiles/lighting.csv +++ b/csvfiles/lighting.csv @@ -33,4 +33,5 @@ Black lighting Gel lighting -color- lighting Moonlight -Sunlight \ No newline at end of file +Sunlight +Accent lighting \ No newline at end of file diff --git a/csvfiles/outfits.csv b/csvfiles/outfits.csv index 2e9f752..3dcba64 100644 --- a/csvfiles/outfits.csv +++ b/csvfiles/outfits.csv @@ -191,7 +191,7 @@ Onesie or footed pajamas Sleep shorts and tank top Boxer shorts and t-shirt Nightshirt and leggings -Satin or silk chemise +Satin chemise Babydoll Kimono Wedding dress diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index a2e7aff..34b1173 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -24,7 +24,17 @@ class Script(scripts.Script): def show(self, is_img2img): return True + def ui(self, is_img2img): + def gen_prompt(insanitylevel, subject, artist, imagetype): + + promptlist = [] + + for i in range(5): + promptlist.append(build_dynamic_prompt(insanitylevel,subject,artist, imagetype)) + + return promptlist + with gr.Tab("Main"): with gr.Row(): insanitylevel = gr.Slider(1, 10, value=7, step=1, label="Higher levels increases complexity and randomness of generated prompt") @@ -150,15 +160,52 @@ class Script(scripts.Script): """ ) - - return [insanitylevel,subject, artist, imagetype, promptlocation, promptcompounderlevel, ANDtoggle] + with gr.Tab("Workflow assist"): + with gr.Row(): + silentmode = gr.Checkbox( + label="silent mode, turns off prompt generation") + with gr.Row(): + gr.Markdown( + """ + + Workflow assist, suggestions by redditor Woisek. + + With silent mode, you turn off the automatic generation of new prompts on generate, and can just use normal prompting. So you can work and finetune any fun prompts without turning of the script. + + Below here, you can generate a set of random prompts, and start working from there instead. + + """) + with gr.Row(): + genprom = gr.Button("Generate me some prompts!") + with gr.Row(): + prompt1 = gr.Textbox(label="prompt 1") + with gr.Row(): + prompt2 = gr.Textbox(label="prompt 2") + with gr.Row(): + prompt3 = gr.Textbox(label="prompt 3") + with gr.Row(): + prompt4 = gr.Textbox(label="prompt 4") + with gr.Row(): + prompt5 = gr.Textbox(label="prompt 5") + + + genprom.click(gen_prompt, inputs=[insanitylevel,subject, artist, imagetype], outputs=[prompt1, prompt2, prompt3,prompt4,prompt5]) + + return [insanitylevel,subject, artist, imagetype, promptlocation, promptcompounderlevel, ANDtoggle, silentmode] - def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation, promptcompounderlevel, ANDtoggle): + + + + def run(self, p, insanitylevel, subject, artist, imagetype, promptlocation, promptcompounderlevel, ANDtoggle, silentmode): images = [] infotexts = [] - if p.prompt != "": + if(silentmode and p.prompt != ""): + print("Silent mode turned on, not generating a prompt. Using current prompt.") + elif(silentmode): + print("Warning, silent mode is turned on, but no current prompt has been given.") + elif p.prompt != "": print("Prompt is not empty, adding current prompt " + promptlocation + " of the generated prompt") batches = p.n_iter @@ -172,23 +219,24 @@ class Script(scripts.Script): for i in range(batches): - # prompt compounding - print("Starting generating the prompt") - preppedprompt = "" - for i in range(promptcompounderlevel): - preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype) - if(i + 1 != promptcompounderlevel): - if(ANDtoggle): - preppedprompt += " \n AND " - else: - preppedprompt += ", " + if(silentmode == False): + # prompt compounding + print("Starting generating the prompt") + preppedprompt = "" + for i in range(promptcompounderlevel): + preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype) + if(i + 1 != promptcompounderlevel): + if(ANDtoggle): + preppedprompt += " \n AND " + else: + preppedprompt += ", " - if(promptlocation == "in the front" and originalprompt != ""): - p.prompt = originalprompt + ", " + preppedprompt - elif(promptlocation == "at the back" and originalprompt != ""): - p.prompt = preppedprompt + ", " + originalprompt # add existing prompt to the back? - else: - p.prompt = preppedprompt # dont add anything + if(promptlocation == "in the front" and originalprompt != ""): + p.prompt = originalprompt + ", " + preppedprompt + elif(promptlocation == "at the back" and originalprompt != ""): + p.prompt = preppedprompt + ", " + originalprompt # add existing prompt to the back? + else: + p.prompt = preppedprompt # dont add anything for j in range(batchsize): @@ -204,7 +252,8 @@ class Script(scripts.Script): # Only move up a seed, when there are multiple batchsizes, and we had the first one done. if(initialbatchsize != 1): p.seed += 1 - + + p.seed +=1 # just return all the things p.n_iter = 0 p.batch_size = 0 From f04871bc2ad5bb33501f0c25976def4e16b18193 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Wed, 19 Apr 2023 21:15:33 +0200 Subject: [PATCH 11/14] Made Latent Couple improvements --- build_dynamic_prompt.py | 23 +++++++++++----- scripts/onebuttonprompt.py | 55 +++++++++++++++++++++++++++----------- 2 files changed, 57 insertions(+), 21 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index ba22f36..23de0a1 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -10,7 +10,7 @@ from random_functions import * # insanity level controls randomness of propmt 0-10 # forcesubject van be used to force a certain type of subject # Set artistmode to none, to exclude artists -def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all", imagetype = "all"): +def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all", imagetype = "all", onlyartists = False): completeprompt = ", " @@ -60,7 +60,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all # possible?: think about curated artist list? artistsplacement = "front" - if(uncommon_dist(insanitylevel)): + if(uncommon_dist(insanitylevel) and onlyartists == False): artistsplacement = "back" if(artists == "all" and artistsplacement == "front"): @@ -86,9 +86,14 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all if modeselector < 5 and end - step >= 2: artistmodeslist = ["hybrid", "stopping", "adding", "switching", "enhancing"] artistmode = artistmodeslist[modeselector] - if artistmode in ["hybrid","switching"] and end - step == 1: + if (artistmode in ["hybrid","switching"] and end - step == 1): artistmode = "normal" + if(onlyartists == True and artistmode == "enhancing"): + artistmode = "normal" + if(onlyartists == True and step == end): + step = step - 1 + if artistmode in ["hybrid", "stopping", "adding","switching"]: completeprompt += " [" @@ -126,14 +131,22 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt += "]" + if(onlyartists == True): + completeprompt = completeprompt.strip(", ") + print("only generated these artists:" + completeprompt) + return completeprompt + + completeprompt = completeprompt + ", " + + if artistmode in ["enhancing"]: completeprompt += " [" if(imagetype != "all" and imagetype != "all - force multiple" and imagetype != "only other types"): completeprompt += " " + imagetype + ", " - elif(imagetype == "all - force multiple" or rare_dist(insanitylevel)): + elif(imagetype == "all - force multiple" or unique_dist(insanitylevel)): amountofimagetypes = random.randint(2,3) elif(imagetype == "only other types"): othertype = 1 @@ -611,8 +624,6 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt = re.sub(',\(', ', (', completeprompt) completeprompt = re.sub('a The', 'The', completeprompt) - completeprompt = re.sub('ss ', 's ', completeprompt) - completeprompt = re.sub('ss, ', 's, ', completeprompt) completeprompt = re.sub(' +', ' ', completeprompt[2:]) # remove first character, that is always a comma. Remove any excess spaces diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index 34b1173..e907597 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -14,6 +14,7 @@ artists = ["all", "none"] imagetypes = ["all", "all - force multiple", "photograph", "octane render","digital art","concept art", "painting", "portrait", "anime key visual", "only other types"] promptmode = ["at the back", "in the front"] promptcompounder = [1,2,3,4,5] +ANDtogglemode = ["comma", "AND", "current prompt + AND", "automatic AND"] class Script(scripts.Script): @@ -138,9 +139,8 @@ class Script(scripts.Script): promptcompounderlevel = gr.Dropdown( promptcompounder, label="Prompt compunder", value=1) with gr.Row(): - ANDtoggle = gr.Checkbox( - label="toggle AND mode" - ) + ANDtoggle = gr.Dropdown( + ANDtogglemode, label="Prompt seperator mode", value="comma") with gr.Row(): gr.Markdown( """ @@ -155,7 +155,11 @@ 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. + You can toggle the separator mode. Standardly this is a comma, but you can choose an AND and a newline. + + You can also choose for "current prompt + AND". This is best used in conjuction with the Latent Couple extension when you want some control. Set the prompt compounder to the amount of objects to generate. + + "automatic AND" is entirely build around Latent Couple. It will pass artists and the amount of people/animals/objects to generate in the prompt automatically. Set the prompt compounder to the amount of objects to generate. """ @@ -163,7 +167,7 @@ class Script(scripts.Script): with gr.Tab("Workflow assist"): with gr.Row(): silentmode = gr.Checkbox( - label="silent mode, turns off prompt generation") + label="surpressing mode, turns off prompt generation") with gr.Row(): gr.Markdown( """ @@ -172,7 +176,7 @@ class Script(scripts.Script): With silent mode, you turn off the automatic generation of new prompts on generate, and can just use normal prompting. So you can work and finetune any fun prompts without turning of the script. - Below here, you can generate a set of random prompts, and start working from there instead. + Below here, you can generate a set of random prompts, and start working from there instead. It works on the settings in the Main tab. """) with gr.Row(): @@ -223,17 +227,38 @@ class Script(scripts.Script): # prompt compounding print("Starting generating the prompt") preppedprompt = "" - for i in range(promptcompounderlevel): - preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype) - if(i + 1 != promptcompounderlevel): - if(ANDtoggle): - preppedprompt += " \n AND " - else: - preppedprompt += ", " + if(ANDtoggle == "automatic AND" and originalprompt == ""): + if(artist != "none"): + originalprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, True) + if(subject == "humanoid"): + originalprompt += ", " + str(promptcompounderlevel) + " people" + if(subject == "landscape"): + originalprompt += ", landscape" + if(subject == "animal"): + originalprompt += ", " + str(promptcompounderlevel) + " animals" + if(subject == "object"): + originalprompt += ", " + str(promptcompounderlevel) + " objects" - if(promptlocation == "in the front" and originalprompt != ""): + if(ANDtoggle != "AND" and ANDtoggle != "comma" and originalprompt != ""): + preppedprompt += originalprompt + " \n AND " + + for i in range(promptcompounderlevel): + if(ANDtoggle == "automatic AND"): + preppedprompt += originalprompt + ", " + build_dynamic_prompt(insanitylevel,subject,"none", imagetype) + elif(ANDtoggle != "AND" and ANDtoggle != "comma" and originalprompt != ""): + preppedprompt += originalprompt + ", " + build_dynamic_prompt(insanitylevel,subject,artist, imagetype) + else: + preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype) + if(i + 1 != promptcompounderlevel): + if(ANDtoggle == "comma"): + preppedprompt += ", " + else: + preppedprompt += " \n AND " + + + if(promptlocation == "in the front" and originalprompt != "" and (ANDtoggle == "AND" or ANDtoggle == "comma")): p.prompt = originalprompt + ", " + preppedprompt - elif(promptlocation == "at the back" and originalprompt != ""): + elif(promptlocation == "at the back" and originalprompt != "" and (ANDtoggle == "AND" or ANDtoggle == "comma")): p.prompt = preppedprompt + ", " + originalprompt # add existing prompt to the back? else: p.prompt = preppedprompt # dont add anything From 060e0663181a7961b3a3c7790db16f4afba9b2db Mon Sep 17 00:00:00 2001 From: AIrjen Date: Fri, 21 Apr 2023 09:44:55 +0200 Subject: [PATCH 12/14] Moved some things around Made more descriptions --- csvfiles/concept_prefix.csv | 3 +- csvfiles/descriptors.csv | 3 +- csvfiles/locations.csv | 3 +- csvfiles/othertypes.csv | 3 +- csvfiles/vomit.csv | 3 +- scripts/onebuttonprompt.py | 85 +++++++++++++++++++++++-------------- 6 files changed, 64 insertions(+), 36 deletions(-) diff --git a/csvfiles/concept_prefix.csv b/csvfiles/concept_prefix.csv index 3c23fb6..759f096 100644 --- a/csvfiles/concept_prefix.csv +++ b/csvfiles/concept_prefix.csv @@ -94,4 +94,5 @@ Pillars Burden Dawn Need -Shape \ No newline at end of file +Shape +Labyrinth \ No newline at end of file diff --git a/csvfiles/descriptors.csv b/csvfiles/descriptors.csv index cb9445e..6746db3 100644 --- a/csvfiles/descriptors.csv +++ b/csvfiles/descriptors.csv @@ -287,4 +287,5 @@ Rustic Rich Varied Injured -Scrumptious \ No newline at end of file +Scrumptious +Kintsugi \ No newline at end of file diff --git a/csvfiles/locations.csv b/csvfiles/locations.csv index 6e2fea8..b150a74 100644 --- a/csvfiles/locations.csv +++ b/csvfiles/locations.csv @@ -673,4 +673,5 @@ city of -material- -color- nebula Wormhole Portal -Bamboo Forest \ No newline at end of file +Bamboo Forest +Labyrinth \ No newline at end of file diff --git a/csvfiles/othertypes.csv b/csvfiles/othertypes.csv index 15b40be..24489a4 100644 --- a/csvfiles/othertypes.csv +++ b/csvfiles/othertypes.csv @@ -85,4 +85,5 @@ Multiple layers of silhouette Retro comic style artwork Metal pin a felt muppet -Glitch art \ No newline at end of file +Glitch art +a ceramic coffee mug \ No newline at end of file diff --git a/csvfiles/vomit.csv b/csvfiles/vomit.csv index f85f66d..acd1e3d 100644 --- a/csvfiles/vomit.csv +++ b/csvfiles/vomit.csv @@ -50,4 +50,5 @@ Complex background Plain white background Zentangle Mandala -Luminous trails \ No newline at end of file +Luminous trails +Kintsugi \ No newline at end of file diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index e907597..a3179a3 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -134,6 +134,33 @@ class Script(scripts.Script): """ ) + with gr.Tab("Workflow assist"): + with gr.Row(): + silentmode = gr.Checkbox( + label="surpressing mode, turns off prompt generation") + with gr.Row(): + gr.Markdown( + """ + + Workflow assist, suggestions by redditor Woisek. + + With surpressing mode, you turn off the automatic generation of new prompts on 'generate', and can just use normal prompting. So you can work and finetune any fun prompts without turning of the script. + + Below here, you can generate a set of random prompts, and start working from there instead. It works on the settings in the Main tab. + + """) + with gr.Row(): + genprom = gr.Button("Generate me some prompts!") + with gr.Row(): + prompt1 = gr.Textbox(label="prompt 1") + with gr.Row(): + prompt2 = gr.Textbox(label="prompt 2") + with gr.Row(): + prompt3 = gr.Textbox(label="prompt 3") + with gr.Row(): + prompt4 = gr.Textbox(label="prompt 4") + with gr.Row(): + prompt5 = gr.Textbox(label="prompt 5") with gr.Tab("Advanced"): with gr.Row(): promptcompounderlevel = gr.Dropdown( @@ -157,44 +184,40 @@ class Script(scripts.Script): You can toggle the separator mode. Standardly this is a comma, but you can choose an AND and a newline. - You can also choose for "current prompt + AND". This is best used in conjuction with the Latent Couple extension when you want some control. Set the prompt compounder to the amount of objects to generate. + You can also choose for "current prompt + AND". This is best used in conjuction with the Latent Couple extension when you want some control. Set the prompt compounder equal to the amount of areas defined in Laten Couple. + + Example flow: + + Set the Latent Couple extension to 2 area's (standard setting) + + In the main tab, set the subject to humanoids + + In the prompt field then add for example: Art by , 2 people + + Set the prompt compounder to: 2 + + "automatic AND" is entirely build around Latent Couple. It will pass artists and the amount of people/animals/objects to generate in the prompt automatically. Set the prompt compounder equal to the amount of areas defined in Laten Couple. + + Example flow: + + Set the Latent Couple extension to 2 area's (standard setting) + + In the main tab, set the subject to humanoids + + Leave the prompt field empty + + Set the prompt compounder to: 2 + - "automatic AND" is entirely build around Latent Couple. It will pass artists and the amount of people/animals/objects to generate in the prompt automatically. Set the prompt compounder to the amount of objects to generate. """ ) - with gr.Tab("Workflow assist"): - with gr.Row(): - silentmode = gr.Checkbox( - label="surpressing mode, turns off prompt generation") - with gr.Row(): - gr.Markdown( - """ - - Workflow assist, suggestions by redditor Woisek. - - With silent mode, you turn off the automatic generation of new prompts on generate, and can just use normal prompting. So you can work and finetune any fun prompts without turning of the script. - - Below here, you can generate a set of random prompts, and start working from there instead. It works on the settings in the Main tab. - - """) - with gr.Row(): - genprom = gr.Button("Generate me some prompts!") - with gr.Row(): - prompt1 = gr.Textbox(label="prompt 1") - with gr.Row(): - prompt2 = gr.Textbox(label="prompt 2") - with gr.Row(): - prompt3 = gr.Textbox(label="prompt 3") - with gr.Row(): - prompt4 = gr.Textbox(label="prompt 4") - with gr.Row(): - prompt5 = gr.Textbox(label="prompt 5") - - genprom.click(gen_prompt, inputs=[insanitylevel,subject, artist, imagetype], outputs=[prompt1, prompt2, prompt3,prompt4,prompt5]) + + + return [insanitylevel,subject, artist, imagetype, promptlocation, promptcompounderlevel, ANDtoggle, silentmode] From 0690e62af1067459711e6ce8110e715110af2a81 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Fri, 21 Apr 2023 09:48:31 +0200 Subject: [PATCH 13/14] Update onebuttonprompt.py Fixed small typo --- scripts/onebuttonprompt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index a3179a3..030af37 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -192,7 +192,7 @@ class Script(scripts.Script): In the main tab, set the subject to humanoids - In the prompt field then add for example: Art by , 2 people + In the prompt field then add for example: Art by artistname, 2 people Set the prompt compounder to: 2 From c5ff384e13e4181876fd95f1e16ac68447fd2592 Mon Sep 17 00:00:00 2001 From: AIrjen Date: Fri, 21 Apr 2023 09:51:00 +0200 Subject: [PATCH 14/14] merging fix up --- build_dynamic_prompt.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index 23de0a1..241b028 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -418,20 +418,20 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt = add_from_csv(completeprompt, random.choice(addontolocation), 0, "","") if(subjectchooser not in ["landscape", "concept"] and humanspecial != 1 and insideshot == 0 and normal_dist(insanitylevel)): - backgroundtype = ["landscape", "buildingbackground", "insidebuilding"] - match random.choice(backgroundtype): - case "landscape": - completeprompt = add_from_csv(completeprompt, "locations", 1, " background is ","") - case "buildingbackground": - completeprompt += ", background is " - if(uncommon_dist(insanitylevel)): - completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") - completeprompt = add_from_csv(completeprompt, "buildings", 0, "","") - case "insidebuilding": - completeprompt += ", inside a " - if(uncommon_dist(insanitylevel)): - completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") - completeprompt = add_from_csv(completeprompt, "buildings", 0, "","") + backgroundtypelist = ["landscape", "buildingbackground", "insidebuilding"] + backgroundtype = random.choice(backgroundtypelist) + if(backgroundtype == "landscape"): + completeprompt = add_from_csv(completeprompt, "locations", 1, " background is ","") + elif(backgroundtype == "buildingbackground"): + completeprompt += ", background is " + if(uncommon_dist(insanitylevel)): + completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") + completeprompt = add_from_csv(completeprompt, "buildings", 0, "","") + elif(backgroundtype == "insidebuilding"): + completeprompt += ", inside a " + if(uncommon_dist(insanitylevel)): + completeprompt = add_from_csv(completeprompt, "descriptors", 0, "","") + completeprompt = add_from_csv(completeprompt, "buildings", 0, "","")