From 34cee9b2cc5955f5d0a908c9f8c0046d756dd7f2 Mon Sep 17 00:00:00 2001 From: AIrjen <130234949+AIrjen@users.noreply.github.com> Date: Sat, 23 Sep 2023 13:25:59 +0200 Subject: [PATCH] Fixes and finishing list --- build_dynamic_prompt.py | 31 +++++++++++--------- csvfiles/accessories.csv | 32 ++++----------------- csvfiles/patterns.csv | 1 + csvfiles/special_lists/buildoutfit.csv | 2 +- csvfiles/special_lists/objectadditions.csv | 20 ++++--------- csvfiles/special_lists/overalladditions.csv | 18 +++--------- csvfiles/special_lists/photoadditions.csv | 5 +++- prompttester.py | 9 ++++-- 8 files changed, 45 insertions(+), 73 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index f7bd30b..b9c088e 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -50,7 +50,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all outfitlist = csv_to_list("outfits",antilist) locationlist = csv_to_list("locations",antilist) - accessorielist = csv_to_list("accessories",antilist) + accessorielist = csv_to_list("accessories",antilist,"./csvfiles/",0,"?") artmovementlist = csv_to_list("artmovements",antilist) bodytypelist = csv_to_list("body_types",antilist) cameralist = csv_to_list("cameras",antilist) @@ -1921,20 +1921,12 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all #end of the while loop, now clean up the prompt - # first, we are going to parse any custom functions we have build in - # this is OR() - # OR() - - # OR(foo;bar;bla) --> randomly take foo, bar or bla - # OR(foo;bar;bla;uncommon) --> Take foo, unless it hits uncommon roll. Then take bar or bla - # OR(;foo) --> empty or foo - # OR(;foo;uncommon) --> empty unless it hits uncommon roll. Then take foo - # OR(;foo;bar;uncommon) --> empty unless it hits uncommon roll. Then take foo or bar + - completeprompt = parse_custom_functions(completeprompt, insanitylevel) + # completeprompt = parse_custom_functions(completeprompt, insanitylevel) @@ -2073,6 +2065,20 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all completeprompt = completeprompt.replace("-objectstrengthstart-","") completeprompt = completeprompt.replace("-objectstrengthend-","") + + # Now, we are going to parse any custom functions we have build in + # this is OR() + # OR() + + # OR(foo;bar;bla) --> randomly take foo, bar or bla + # OR(foo;bar;bla;uncommon) --> Take foo, unless it hits uncommon roll. Then take bar or bla + # OR(;foo) --> empty or foo + # OR(;foo;uncommon) --> empty unless it hits uncommon roll. Then take foo + # OR(;foo;bar;uncommon) --> empty unless it hits uncommon roll. Then take foo or bar + + + completeprompt = parse_custom_functions(completeprompt, insanitylevel) + # clean it up completeprompt = cleanup(completeprompt, advancedprompting) @@ -2113,7 +2119,7 @@ def createpromptvariant(prompt = "", insanitylevel = 5, antivalues = "" , gender outfitlist = csv_to_list("outfits",antilist) locationlist = csv_to_list("locations",antilist) - accessorielist = csv_to_list("accessories",antilist) + accessorielist = csv_to_list("accessories",antilist,"./csvfiles/",0,"?") artmovementlist = csv_to_list("artmovements",antilist) bodytypelist = csv_to_list("body_types",antilist) cameralist = csv_to_list("cameras",antilist) @@ -2692,7 +2698,6 @@ def custom_or(values, insanitylevel = 5): last_element = values[-1] first_element = values[0] - print(values) if last_element in ['always', 'common', 'normal','uncommon', 'rare', 'legendary','unique', 'extraordinary', 'novel', 'never']: # If we do not hit the change roll, then take the first element. diff --git a/csvfiles/accessories.csv b/csvfiles/accessories.csv index 4d5ef22..13ca079 100644 --- a/csvfiles/accessories.csv +++ b/csvfiles/accessories.csv @@ -89,7 +89,6 @@ Lapel Pin Body Chain Brooch Anklet -Toe Ring Nose Ring Lip Ring Belly Button Ring @@ -121,34 +120,13 @@ Buttons Tattoos Cigarette Pipe --material- trimmings -Handlebar Mustache -Full Beard +OR(-material-;-color-) trimmings +OR(;Handlebar;Horseshoe;Pencil;Large;Small;common) Mustache +OR(;Full;Stubble;Circle;Light;Large;Small;common) Beard Goatee Soul Patch Mutton Chops -Circle Beard -Horseshoe Mustache -Stubble Beard -Imperial Mustache -Pencil Mustache -Face Painting -Day of the Dead Face Paint --animal- Face Paint -Tribal Face Paint -Tribal Face Marks -Clown Face Paint -Halloween Face Paint -Fantasy Face Paint -Sports Team Face Paint -Superhero Face Paint --animal- Tattoo --object- Tattoo --vehicle- Tattoo --building- Tattoo -Body Tattoos -Face Tattoos -Tattoos -Tribal Tattoos +OR(;Day of the Dead;Tribal;Clown;Halloween;Fantasy;Sports Team;Superhero;-animal-;common) Face OR(Painting;Paint) +OR(-animal-;-objecttotal-;-pattern-;henna;-building-;body;face;tribal) Tattoo Geass Shoulder pads \ No newline at end of file diff --git a/csvfiles/patterns.csv b/csvfiles/patterns.csv index d65cca8..7860dac 100644 --- a/csvfiles/patterns.csv +++ b/csvfiles/patterns.csv @@ -2,6 +2,7 @@ stripes horizontal stripes vertical stripes diagonal stripes +racing stripes pinstripe herringbone regimental diff --git a/csvfiles/special_lists/buildoutfit.csv b/csvfiles/special_lists/buildoutfit.csv index 7706bad..f8b4ae6 100644 --- a/csvfiles/special_lists/buildoutfit.csv +++ b/csvfiles/special_lists/buildoutfit.csv @@ -1,4 +1,4 @@ -OR(;-descriptor-;normal) OR(;-color-;uncommon) OR(;-culture-;uncommon) OR (;-material-;rare) -outfit- +OR(;-descriptor-;normal) OR(;-color-;uncommon) OR(;-culture-;uncommon) OR(;-material-;rare) -outfit- OR(;-descriptor-;normal) OR(;-descriptor-;uncommon) OR(;-color-;uncommon) -outfit- OR(-job-;-rpgclass-;-season-;-animal--style) OR(-minioutfit-;-outfit-;rare) OR(;-descriptor-;uncommon) OR(-minioutfit-;-outfit-;rare) OR(;designed by -brand-;uncommon) diff --git a/csvfiles/special_lists/objectadditions.csv b/csvfiles/special_lists/objectadditions.csv index d2f5dfe..ace0ba2 100644 --- a/csvfiles/special_lists/objectadditions.csv +++ b/csvfiles/special_lists/objectadditions.csv @@ -1,16 +1,6 @@ -with a face -made from -material- -detailed with -material- patterns -detailed with -material- -descriptor- patterns --descriptor- details --color- patterns --material- patterns --descriptor- -color- patterns --material- frame -intricate details -smooth +made from OR(-material-;-space-;-flora-) +OR(detailed;engraved;rare) with OR(-material-;-color-;-descriptor-;-pattern-) OR(; and -color-; and -descriptor-;rare) OR(patterns;details) +OR(intricate details;smooth;sleek) designed by -brand- -made from -space- -made from -flora- -anthropomorphic -with -pattern- -print- \ No newline at end of file +anthropomorphic OR(;with a face;normal) +with OR(-pattern-;-color-;-descriptor-;rare) -print- \ No newline at end of file diff --git a/csvfiles/special_lists/overalladditions.csv b/csvfiles/special_lists/overalladditions.csv index 9997a1b..b75d726 100644 --- a/csvfiles/special_lists/overalladditions.csv +++ b/csvfiles/special_lists/overalladditions.csv @@ -1,30 +1,20 @@ -floating in space -floating in -space- -floating over -minilocation- -floating -flying +OR(floating;flying) OR(; in space; in -space-; over -minilocation-;normal) distant nuclear explosion de dia los muertos mechanical lord of the rings scenery landscape, -flora- between the stars surrounded by fire and ice -infused with ethereal color -surrounded by ethereal color -surrounded by ethereal shapes -surrounded by -color- electric sparks +OR(infused with;surrounded by) OR(ethereal color; ethereal shapes; -color- OR(electric;glowing;neon) sparks) -season- -color- smoke in -season- landscape pronounced -genderdescription- features -in -culture- city street +in OR(-culture-;-descriptor-) OR(city;village) OR(street;road) covered in -color- paint, dripping paint -designed by -brand- -in style of -brand- -forged by -brand- +OR(designed by;in style of; forged by) -brand- overgrown with plants and -color- flowers cyberpunk style, neo-tokyo, -color- neon highlights -designed as a -culture- rug from fiber with a portal to another world stylized geometric patterns, gems, steel and chrome soft, squishy and jelly diff --git a/csvfiles/special_lists/photoadditions.csv b/csvfiles/special_lists/photoadditions.csv index 9e21197..6a43ce2 100644 --- a/csvfiles/special_lists/photoadditions.csv +++ b/csvfiles/special_lists/photoadditions.csv @@ -1 +1,4 @@ -film grain \ No newline at end of file +film grain +bokeh +Orton effect +sharp focus \ No newline at end of file diff --git a/prompttester.py b/prompttester.py index 56446f2..bc5b95a 100644 --- a/prompttester.py +++ b/prompttester.py @@ -38,7 +38,12 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im print("") print(result) break - + + if(" OR " in result): + print("There is a mistake in a OR statement") + print("") + print(result) + break steps += 1 @@ -46,4 +51,4 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im print("") print("All done!") -generateprompts(20,8,"all","all","all",False,"","","PREFIXPROMPT" ,"OR(;-descriptor-;-culture-;-color-;lush;dense;-season-;normal) -minilocation- OR(; with -flora-; and -space- in background; and -minilocation-;rare)","",1,"","OR(;-descriptor-;normal), BLA",True,"",100, "all", "all", "all", "all", False, True) \ No newline at end of file +generateprompts(1000,5,"all","all","all",False,"","","PREFIXPROMPT" ,"SUFFIXPROMPT","",1,"","",True,"",100, "all", "all", "all", "all", False, True) \ No newline at end of file