From 4ee26e224096b8dcaee7d4093d1b83b45a0f79fb Mon Sep 17 00:00:00 2001 From: AIrjen Date: Tue, 20 Feb 2024 17:21:30 +0100 Subject: [PATCH] more mode stuff! --- build_dynamic_prompt.py | 90 +++++++++++++++---- csvfiles/human_activities_less_verbose.csv | 61 +++++++++++++ csvfiles/outfitvomit.csv | 2 +- .../buildaccessorie_less_verbose.csv | 1 + .../special_lists/buildface_less_verbose.csv | 5 ++ .../special_lists/buildhair_less_verbose.csv | 2 + csvfiles/special_lists/buildoutfit.csv | 4 +- .../buildoutfit_less_verbose.csv | 14 +++ csvfiles/special_lists/humanadditions.csv | 3 +- .../humanadditions_less_verbose.csv | 19 ++++ .../objectadditions_less_verbose.csv | 9 ++ main.py | 6 +- prompttester.py | 5 +- scripts/onebuttonprompt.py | 2 +- 14 files changed, 193 insertions(+), 30 deletions(-) create mode 100644 csvfiles/human_activities_less_verbose.csv create mode 100644 csvfiles/special_lists/buildaccessorie_less_verbose.csv create mode 100644 csvfiles/special_lists/buildface_less_verbose.csv create mode 100644 csvfiles/special_lists/buildhair_less_verbose.csv create mode 100644 csvfiles/special_lists/buildoutfit_less_verbose.csv create mode 100644 csvfiles/special_lists/humanadditions_less_verbose.csv create mode 100644 csvfiles/special_lists/objectadditions_less_verbose.csv diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index beddbb1..7de58f8 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -13,6 +13,7 @@ from random_functions import * def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all", imagetype = "all", onlyartists = False, antivalues = "", prefixprompt = "", suffixprompt ="",promptcompounderlevel ="1", seperator = "comma", givensubject="",smartsubject = True,giventypeofimage="", imagemodechance = 20, gender = "all", subtypeobject="all", subtypehumanoid="all", subtypeconcept="all", advancedprompting=True, hardturnoffemojis=False, seed=-1, overrideoutfit="", prompt_g_and_l = False, base_model = "SD1.5"): remove_weights = False + less_verbose = False # set seed @@ -55,8 +56,10 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all # "SD1.5" -- Standard, future: More original style prompting # "SDXL" -- Standard (for now), future: More natural language # "Stable Cascade" -- Remove weights - if base_model == "Stable Cascade": + if(base_model == "Stable Cascade"): remove_weights = True + if(base_model == "SD1.5"): + less_verbose = True # Some tricks for gender to make sure we can choose Him/Her/It etc on the right time. if(gender=="all"): @@ -103,7 +106,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all haircolorlist = csv_to_list("haircolors",antilist) hairstylelist = csv_to_list("hairstyles",antilist) hairvomitlist = csv_to_list("hairvomit",antilist,"./csvfiles/",0,"?",False,False) - humanactivitylist = csv_to_list("human_activities",antilist,"./csvfiles/",0,"?",False,False) + humanoidlist = csv_to_list("humanoids",antilist) imagetypelist = csv_to_list(csvfilename="imagetypes",antilist=antilist, insanitylevel=insanitylevel) joblist = csv_to_list(csvfilename="jobs",antilist=antilist,skipheader=True,gender=gender) @@ -187,15 +190,23 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all humanlist = fictionallist + nonfictionallist + humanoidlist objecttotallist = objectlist + buildinglist + vehiclelist + foodlist + spacelist + floralist + containerlist outfitprinttotallist = objecttotallist + locationlist + colorlist + musicgenrelist + seasonlist + animallist + patternlist - - humanactivitycheatinglist = ["OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", + if(less_verbose): + humanactivitycheatinglist = ["-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", + "-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", + "-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", + "-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", + "-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", + "-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", + "-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)"] + else: + humanactivitycheatinglist = ["OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", "OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", "OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", "OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", "OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", "OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)", "OR(;, -heshe- is;uncommon) -miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-)"] - humanactivitylist = humanactivitylist + humanactivitycheatinglist + # build artists list if artists == "wild": artists = "all (wild)" @@ -283,19 +294,34 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all backgroundtypelist = csv_to_list("backgroundtypes", antilist,"./csvfiles/special_lists/",0,"?") insideshotlist = csv_to_list("insideshots", antilist,"./csvfiles/special_lists/",0,"?") photoadditionlist = csv_to_list("photoadditions", antilist,"./csvfiles/special_lists/",0,"?") - buildhairlist = csv_to_list("buildhair", antilist,"./csvfiles/special_lists/",0,"?") - buildoutfitlist = csv_to_list("buildoutfit", antilist,"./csvfiles/special_lists/",0,"?") - objectadditionslist = csv_to_list("objectadditions", antilist,"./csvfiles/special_lists/",0,"?") - humanadditionlist = csv_to_list("humanadditions", antilist,"./csvfiles/special_lists/",0,"?") + if(less_verbose): + buildhairlist = csv_to_list("buildhair_less_verbose", antilist,"./csvfiles/special_lists/",0,"?") + buildoutfitlist = csv_to_list("buildoutfit_less_verbose", antilist,"./csvfiles/special_lists/",0,"?") + humanadditionlist = csv_to_list("humanadditions_less_verbose", antilist,"./csvfiles/special_lists/",0,"?") + objectadditionslist = csv_to_list("objectadditions_less_verbose", antilist,"./csvfiles/special_lists/",0,"?") + buildfacelist = csv_to_list("buildface_less_verbose", antilist,"./csvfiles/special_lists/",0,"?") + buildaccessorielist = csv_to_list("buildaccessorie_less_verbose", antilist,"./csvfiles/special_lists/",0,"?") + humanactivitylist = csv_to_list("human_activities_less_verbose",antilist,"./csvfiles/",0,"?",False,False) + else: + buildhairlist = csv_to_list("buildhair", antilist,"./csvfiles/special_lists/",0,"?") + buildoutfitlist = csv_to_list("buildoutfit", antilist,"./csvfiles/special_lists/",0,"?") + humanadditionlist = csv_to_list("humanadditions", antilist,"./csvfiles/special_lists/",0,"?") + objectadditionslist = csv_to_list("objectadditions", antilist,"./csvfiles/special_lists/",0,"?") + buildfacelist = csv_to_list("buildface", antilist,"./csvfiles/special_lists/",0,"?") + buildaccessorielist = csv_to_list("buildaccessorie", antilist,"./csvfiles/special_lists/",0,"?") + humanactivitylist = csv_to_list("human_activities",antilist,"./csvfiles/",0,"?",False,False) + + humanactivitylist = humanactivitylist + humanactivitycheatinglist + animaladditionlist = csv_to_list("animaladditions", antilist,"./csvfiles/special_lists/",0,"?") - buildaccessorielist = csv_to_list("buildaccessorie", antilist,"./csvfiles/special_lists/",0,"?") + minilocationadditionslist = csv_to_list("minilocationadditions", antilist,"./csvfiles/special_lists/",0,"?") overalladditionlist = csv_to_list("overalladditions", antilist,"./csvfiles/special_lists/",0,"?") imagetypemodelist = csv_to_list("imagetypemodes", antilist,"./csvfiles/special_lists/",0,"?") miniactivitylist = csv_to_list("miniactivity", antilist,"./csvfiles/special_lists/",0,"?") animalsuffixadditionlist = csv_to_list("animalsuffixadditions", antilist,"./csvfiles/special_lists/",0,"?") buildfacepartlist = csv_to_list("buildfaceparts", antilist,"./csvfiles/special_lists/",0,"?") - buildfacelist = csv_to_list("buildface", antilist,"./csvfiles/special_lists/",0,"?") + tokinatorlist = csv_to_list("tokinator", antilist,"./csvfiles/templates/",0,"?") styleslist = csv_to_list("styles", antilist,"./csvfiles/templates/",0,"?") @@ -2076,28 +2102,51 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all # Common to have 1 description, uncommon to have 2 if(chance_roll(insanitylevel, subjectdescriptor1chance) and generatedescriptors == True): if(subjectchooser in ["animal as human,","human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple", "firstname"]): - if(random.randint(0,3) > 0): + if(less_verbose): + completeprompt += ", -humandescriptor- " + elif(random.randint(0,3) > 0): completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -humandescriptor- " elif(subjectchooser == "manwomanmultiple"): completeprompt += ", the -samehumansubject- are OR(;very;rare) -humandescriptor-" else: completeprompt += ", OR(the -manwoman-;-samehumansubject-) is OR(;very;rare) -humandescriptor-" elif(mainchooser == "landscape"): - completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -locationdescriptor- " + if(less_verbose): + completeprompt += ", -locationdescriptor- " + else: + completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -locationdescriptor- " elif(mainchooser == "animal"): - completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -animaldescriptor- " + if(less_verbose): + completeprompt += ", -animaldescriptor- " + else: + completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -animaldescriptor- " else: - completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -descriptor- " + if(less_verbose): + completeprompt += ", -descriptor- " + else: + completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -descriptor- " if(chance_roll(insanitylevel, subjectdescriptor2chance) and generatedescriptors == True): if(subjectchooser in ["animal as human,","human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple","firstname"]): - completeprompt += " and -humandescriptor- " + if(less_verbose): + completeprompt += ", -humandescriptor- " + else: + completeprompt += " and -humandescriptor- " elif(mainchooser == "landscape"): - completeprompt += " and -locationdescriptor- " + if(less_verbose): + completeprompt += ", -locationdescriptor- " + else: + completeprompt += " and -locationdescriptor- " elif(mainchooser == "animal"): - completeprompt += " and -animaldescriptor- " + if(less_verbose): + completeprompt += ", -animaldescriptor- " + else: + completeprompt += " and -animaldescriptor- " else: - completeprompt += " and -descriptor- " + if(less_verbose): + completeprompt += ", -descriptor- " + else: + completeprompt += " and -descriptor- " completeprompt += ", " if(thetokinatormode == False): @@ -4094,6 +4143,8 @@ def cleanup(completeprompt, advancedprompting, insanitylevel = 5): completeprompt = re.sub(', ,', ',', completeprompt) completeprompt = re.sub(' , ', ', ', completeprompt) completeprompt = re.sub(' ,', ',', completeprompt) + completeprompt = re.sub(' ,', ',', completeprompt) + completeprompt = re.sub(' ,', ',', completeprompt) completeprompt = re.sub(',\(', ', (', completeprompt) while " " in completeprompt: @@ -4194,6 +4245,7 @@ def custom_or(values, insanitylevel = 5): return selected_value def parse_custom_functions(completeprompt, insanitylevel = 5): + print(completeprompt) # Regular expression pattern to match 'or()' function calls and their arguments ORpattern = r'OR\((.*?)\)' diff --git a/csvfiles/human_activities_less_verbose.csv b/csvfiles/human_activities_less_verbose.csv new file mode 100644 index 0000000..e35873e --- /dev/null +++ b/csvfiles/human_activities_less_verbose.csv @@ -0,0 +1,61 @@ +Walking +Running +Jumping +Laying down +Swimming +Dancing +Frolicking +OR(Painting a painting;Drawing a drawing) +Singing +Writing +Cooking +Reading +Hiking +Camping +Fishing +Hunting +Making photographs +OR(Sculpting;Knitting;Sewing;Quilting;Woodworking;Blacksmithing;Metalworking;Pottery;Glassblowing) +Playing video games +Watching OR(movies;TV shows;cinema) +Playing OR(board games;card games;chess;poker;trivia games;word games) +Doing puzzles +Collecting OR(stamps;coins;art;antiques) +OR(Playing a musical instrument;Composing music;Producing music;DJing) +Singing in a choir +Playing in a OR(band;orchestra) +OR(Blogging;Vlogging;Podcasting) +Speaking in public +OR(Stand-up;Improvisational) comedy +OR(Acting in;Directing;Producing) a OR(play;movie;TV show) +OR(Teaching;Coaching;Mentoring;Tutoring) +OR(Fundraising;Campaigning for a cause;Activism;Participating in a protest) +OR(Gardening;Landscaping) +Home improvement +Cleaning +OR(Organizing;Planning events;Hosting parties) +Attending OR(concerts;festivals;theater performances;movies;sports events) +OR(Exercising;Going to the gym;Fitnessing) +OR(Yoga;Pilates;Tai chi) +Meditating +OR(Scuba diving;Snorkeling;Kayaking;Canoeing;Rafting;Climbing;Bungee jumping;Skydiving;Paragliding;Hang gliding;Zip lining) +OR(Traveling;Exploring new places) +Playing OR(Tennis;Basketball;Soccer;Football;Golf;Baseball;Hockey;Icehockey;Volleyball;Beach Volleyball;Sports) +OR(Boxing;Wrestling;Doing Martial Arts;Gymnastics;Cycling;Surfing;Skateboarding;Snowboarding;Skiing;Figure Skating;Rowing;Sailing;Cycling;Mountain biking) +Diving +Playing +Horse-back riding +-animal--back riding +having a tea party +Lounging +Bathing in a -waterlocation- +drinking coffee in a cafe +studying in a room +doing a fashion show +fighting a War +sieging a Castle +sitting and talking +Walking up a stairs +Walking down a stairs +Walking down a OR(street;-minilocation-) +casting a -element- magic spell \ No newline at end of file diff --git a/csvfiles/outfitvomit.csv b/csvfiles/outfitvomit.csv index 3f3d471..2ff64bf 100644 --- a/csvfiles/outfitvomit.csv +++ b/csvfiles/outfitvomit.csv @@ -13,6 +13,6 @@ also has a OR(;large;flowing;rare) OR(hooded cloak;cloak;cape;coat;-season- coat rolled up sleeves is in the style of -artmovement- -outfitdescriptor- and -outfitdescriptor- --materialcombination-;-colorcombination- +OR(-materialcombination-;-colorcombination-) OR(fishnets;trinkets;bling) with a OR(asymetrical;bateau;grecian;collar;cowl;halter;illusion;jewel;keyhole;off-the-shoulder;one-shoulder;plunging;queen anne;round neck;scalloped;scoop;spaghetti strap;split crew;square;strapless;surplice;sweethearth;tie bow;turtleneck;U-shape;V-neck) neckline \ No newline at end of file diff --git a/csvfiles/special_lists/buildaccessorie_less_verbose.csv b/csvfiles/special_lists/buildaccessorie_less_verbose.csv new file mode 100644 index 0000000..548bf0f --- /dev/null +++ b/csvfiles/special_lists/buildaccessorie_less_verbose.csv @@ -0,0 +1 @@ +OR(;-descriptor-;normal) OR(;-culture-;uncommon) OR(;-color-;uncommon) -accessory- OR(; , -accessory-; , -descriptor- -accessory-;rare) OR(; and -accessory-;unique) \ No newline at end of file diff --git a/csvfiles/special_lists/buildface_less_verbose.csv b/csvfiles/special_lists/buildface_less_verbose.csv new file mode 100644 index 0000000..a4675ef --- /dev/null +++ b/csvfiles/special_lists/buildface_less_verbose.csv @@ -0,0 +1,5 @@ +combination of OR(-nonfictional-;-fictional-;legendary) OR(;, OR(-nonfictional-;-fictional-;legendary);rare) and OR(-nonfictional-;-fictional-;legendary) +-facepart- of OR(-nonfictional-;-fictional-;legendary), -facepart- of OR(-nonfictional-;-fictional-;legendary) +OR(;very;legendary) -buildfacepart- OR(; OR(,;and) -buildfacepart-;normal) OR(; and -buildfacepart-;legendary) +OR(;very;legendary) -humandescriptor- -facepart- OR(; and -humandescriptor- -facepart-;uncommon) +-facepart- of OR(-conceptsuffix-;-basicbitchdescriptor-;uncommon) OR(; and -facepart- of OR(-conceptsuffix-;-basicbitchdescriptor-;uncommon);uncommon) \ No newline at end of file diff --git a/csvfiles/special_lists/buildhair_less_verbose.csv b/csvfiles/special_lists/buildhair_less_verbose.csv new file mode 100644 index 0000000..e941070 --- /dev/null +++ b/csvfiles/special_lists/buildhair_less_verbose.csv @@ -0,0 +1,2 @@ +OR(-haircolor-;-hairdescriptor-;-culture-;uncommon) hair OR(styled as -hairstyle-;, ;rare) +OR(-haircolor-; -hairstyle-) OR(hairstyle;hair) \ No newline at end of file diff --git a/csvfiles/special_lists/buildoutfit.csv b/csvfiles/special_lists/buildoutfit.csv index 7a75f3e..8a122e3 100644 --- a/csvfiles/special_lists/buildoutfit.csv +++ b/csvfiles/special_lists/buildoutfit.csv @@ -2,13 +2,13 @@ , OR(wearing;dressed in;in;normal) OR(;OR(;a very;rare) -outfitdescriptor-;normal) OR(;-outfitdescriptor-;uncommon) OR(;-color-;uncommon) -outfit- OR(;from the OR(-age-;the -agecalculator-);rare) , OR(wearing;dressed in;in;normal) OR(;OR(;a very;rare) -outfitdescriptor-;normal) OR(;-outfitdescriptor-;uncommon) OR(;-color-;uncommon) -outfit- OR(; and OR(;-outfitdescriptor-;uncommon) OR(;-color-;uncommon) -outfit-;rare) , OR(wearing;dressed in;in;normal) OR(-job-;-rpgclass-;-season-;-animal--style) OR(-minioutfit-;-outfit-;rare) -, OR(wearing;dressed in;in;normal) OR(;OR(;a very;rare) -outfitdescriptor-;uncommon) OR(-minioutfit-;-outfit-;rare) OR(;OR(designed;made;inspired;forged) by OR(-brand-;-fashiondesigner-);uncommon) +, OR(wearing;dressed in;in;normal) OR(;OR(;a very;rare) -outfitdescriptor-;uncommon) OR(-minioutfit-;-outfit-;rare) OR(;OR(designed;made;inspired;forged) by OR(-brand-;-fashiondesigner-);rare) , wearing OR(-material-;-color-;-element-;uncommon) -overrideoutfit- , OR(wearing;dressed in;in;normal) OR(;-outfitdescriptor-;-material-;-color-;uncommon) OR(-outfit-;-minioutfit-;rare) with OR(-pattern-;-outfitprinttotal-;-material-;uncommon) -print-, , -heshe- is OR(wearing a;dressed in) OR(;-hisher-;-hisher- -outfitdescriptor-;rare) -outfit-, OR(-hisher-;The;normal) -sameoutfit- is OR(-outfitdescriptor-;-color-) OR( OR(and has;, It has) OR(-pattern-;-outfitprinttotal-;-material-;uncommon) -print- on it,; and is OR(made of;detailed with bits of) -material-;rare) OR(;, It looks OR(;very;rare) -outfitdescriptor- on -himher-,;unique) , -heshe- is OR(wearing;dressed in) OR(;-hisher-;rare) -culture- -outfit-, OR(; OR(-hisher-;The;normal) -sameoutfit- is OR(-outfitdescriptor-;-color-),;normal) OR(;, It looks OR(;very;rare) -outfitdescriptor- on -himher-,;unique) , -heshe- is OR(wearing a;dressed in a) OR(;-outfitdescriptor-;normal) OR(;-color-;uncommon) OR(;-culture-;uncommon) OR(;-material-;rare) -outfit- that was OR(designed;made;inspired;forged) by -brand-, It is OR(;very;rare) OR(-outfitdescriptor-;-color-;normal) OR(;and OR(-outfitdescriptor-;-color-;normal);normal) OR(;, The -sameoutfit- looks OR(;very;rare) -outfitdescriptor- on -himher-,;unique) , OR(wearing;dressed in;in;normal) OR(;OR(;a very;rare) -outfitdescriptor-;normal) OR(-minioutfit-;-outfit-;uncommon), OR(-hisher-;The;normal) -sameoutfit- -outfitvomit- -, -heshe- is OR(wearing a;dressed in) OR(;-hisher-;-hisher- -outfitdescriptor-;rare) -outfit-, OR(-hisher-;The;normal) -sameoutfit- OR(is tailored by -fashiondesigner- OR(; and -fashiondesigner-;uncommon);is inspired by the -charactertype- OR(;and -charactertype-;uncommon)) +, -heshe- is OR(wearing a;dressed in) OR(;-hisher-;-hisher- -outfitdescriptor-;rare) -outfit-, OR(-hisher-;The;normal) -sameoutfit- OR(is tailored by -fashiondesigner- OR(; and -fashiondesigner-;uncommon);is inspired by the -charactertype- OR(;and -charactertype-;rare)) , -heshe- is OR(wearing a;dressed in) OR(;-hisher-;-hisher- -outfitdescriptor-;rare) -artmovement- fashion style -outfit- , OR(wearing;dressed in;in;normal) OR(;OR(;a very;rare) -outfitdescriptor-;normal) -outfit- \ No newline at end of file diff --git a/csvfiles/special_lists/buildoutfit_less_verbose.csv b/csvfiles/special_lists/buildoutfit_less_verbose.csv new file mode 100644 index 0000000..b5093b4 --- /dev/null +++ b/csvfiles/special_lists/buildoutfit_less_verbose.csv @@ -0,0 +1,14 @@ +, OR(;-outfitdescriptor-;normal) OR(;-color-;uncommon) OR(;-culture-;uncommon) OR(;-material-;rare) -outfit- OR(;from the OR(-age-;the -agecalculator-);rare) +, OR(;-outfitdescriptor-;normal) OR(;-outfitdescriptor-;uncommon) OR(;-color-;uncommon) -outfit- OR(;from the OR(-age-;the -agecalculator-);rare) +, OR(;-outfitdescriptor-;normal) OR(;-outfitdescriptor-;uncommon) OR(;-color-;uncommon) -outfit- OR(; and OR(;-outfitdescriptor-;uncommon) OR(;-color-;uncommon) -outfit-;rare) +, OR(-job-;-rpgclass-;-season-;-animal--style) OR(-minioutfit-;-outfit-;rare) +, OR(;-outfitdescriptor-;uncommon) OR(-minioutfit-;-outfit-;rare) OR(;OR(designed;made;inspired;forged) by OR(-brand-;-fashiondesigner-);rare) +, OR(-material-;-color-;-element-;uncommon) -overrideoutfit- +, OR(;-outfitdescriptor-;-material-;-color-;uncommon) OR(-outfit-;-minioutfit-;rare), OR(-pattern-;-outfitprinttotal-;-material-;uncommon) -print-, +, OR(;-outfitdescriptor-;normal) -outfit-, OR(-outfitdescriptor-;-color-), OR(-pattern-;-outfitprinttotal-;-material-;uncommon) -print- OR(;-material-;rare) +, -culture- -outfit-, OR(;OR(-outfitdescriptor-;-color-),;normal) +, OR(;-outfitdescriptor-;normal) OR(;-color-;uncommon) OR(;-culture-;uncommon) OR(;-material-;rare) -outfit- that was OR(designed;made;inspired;forged) by -brand- +, OR(;-outfitdescriptor-;normal) OR(-minioutfit-;-outfit-;uncommon), -outfitvomit- +, OR(;-outfitdescriptor-;normal) -outfit-, OR(is tailored by -fashiondesigner- OR(; and -fashiondesigner-;uncommon);-charactertype- OR(;and -charactertype-;rare)) +, OR(;-outfitdescriptor-;normal) -artmovement- fashion style -outfit- +, OR(;-outfitdescriptor-;normal) -outfit- \ No newline at end of file diff --git a/csvfiles/special_lists/humanadditions.csv b/csvfiles/special_lists/humanadditions.csv index 03d112b..be048ae 100644 --- a/csvfiles/special_lists/humanadditions.csv +++ b/csvfiles/special_lists/humanadditions.csv @@ -15,4 +15,5 @@ OR(;, -heshe- is;rare) inside a -container- OR(;, -heshe- is;rare) OR(surrounded by;being looked at by) a OR(couple;group) of OR(;-descriptor-;uncommon) OR(people;-malefemale-s;animals) OR(;wearing OR(;-descriptor-;uncommon) -outfit-;rare) OR(;, -heshe- is;rare) from the OR(-age-;the -agecalculator-) OR(;, -heshe- is;uncommon) in a -setting- setting -OR(as a;OR(;, -heshe- is;uncommon) reimagined as a) -charactertype- character \ No newline at end of file +OR(as a;OR(;, -heshe- is;uncommon) reimagined as a) -charactertype- character +OR(;, -heshe- is;rare) dressed up as -fictional- character \ No newline at end of file diff --git a/csvfiles/special_lists/humanadditions_less_verbose.csv b/csvfiles/special_lists/humanadditions_less_verbose.csv new file mode 100644 index 0000000..232410d --- /dev/null +++ b/csvfiles/special_lists/humanadditions_less_verbose.csv @@ -0,0 +1,19 @@ +OR(riding;with) a -animal- +holding a OR(-objectstohold-;-object-;rare) +driving a -vehicle- +surrounded by OR(-object-s;-flora-s;-space-) +eating -food- +OR(and;holding hands with) -human- +cosplaying as -fictional- +OR(-color-;-material-) skin +-miniactivity- OR(in;at) a OR(-location-;-building-;-waterlocation-) +wearing -elaborateoutfit- +- OR(-animal-;-humanoid-) OR(;hybrid;normal) +-culture- -rpgclass- +sitting in a OR(;-descriptor-;uncommon) -chair- +inside a -container- +OR(surrounded by;being looked at by) a OR(couple;group) of OR(;-descriptor-;uncommon) OR(people;-malefemale-s;animals) OR(;wearing OR(;-descriptor-;uncommon) -outfit-;rare) +from the OR(-age-;the -agecalculator-) +-setting- +-charactertype- character +as -fictional- character \ No newline at end of file diff --git a/csvfiles/special_lists/objectadditions_less_verbose.csv b/csvfiles/special_lists/objectadditions_less_verbose.csv new file mode 100644 index 0000000..3baa0f0 --- /dev/null +++ b/csvfiles/special_lists/objectadditions_less_verbose.csv @@ -0,0 +1,9 @@ +made from OR(-material-;-space-;-flora-) +OR(detailed;engraved;rare) with OR(-material-;-color-;-outfitdescriptor-;-pattern-) OR(; and -color-; and -outfitdescriptor-;rare) OR(patterns;details) +OR(smooth;sleek) +OR(intricate;ornate;-basicbitchdescriptor-) details +OR(designed;made;inspired;forged) by -brand- +anthropomorphic OR(;with a face;as a -charactertype- character;common) +with OR(-pattern-;-color-;-descriptor-;rare) -print- +covered in -covering- +-setting- setting \ No newline at end of file diff --git a/main.py b/main.py index d7b40c0..34afcde 100644 --- a/main.py +++ b/main.py @@ -13,7 +13,7 @@ from call_extras import * from model_lists import * -def generateimages(amount = 1, size = "all",model = "currently selected model",samplingsteps = "40",cfg= "7",hiresfix = True,hiressteps ="0",denoisestrength="0.6",samplingmethod="DPM++ SDE Karras", upscaler="R-ESRGAN 4x+", hiresscale="2",apiurl="http://127.0.0.1:7860",qualitygate=False,quality="7.6",runs="5",insanitylevel="5",subject="all", artist="all", imagetype="all",silentmode=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma", img2imgbatch = "1", img2imgsamplingsteps = "20", img2imgcfg = "7", img2imgsamplingmethod = "DPM++ SDE Karras", img2imgupscaler = "R-ESRGAN 4x+", img2imgmodel = "currently selected model", img2imgactivate = False, img2imgscale = "2", img2imgpadding = "64",img2imgdenoisestrength="0.3",ultimatesdupscale=False,usdutilewidth = "512", usdutileheight = "0", usdumaskblur = "8", usduredraw ="Linear", usduSeamsfix = "None", usdusdenoise = "0.35", usduswidth = "64", usduspadding ="32", usdusmaskblur = "8",controlnetenabled=False, controlnetmodel="",img2imgdenoisestrengthmod="-0.05",enableextraupscale = False,controlnetblockymode = False,extrasupscaler1 = "all",extrasupscaler2 ="all",extrasupscaler2visiblity="0.5",extrasupscaler2gfpgan="0",extrasupscaler2codeformer="0.15",extrasupscaler2codeformerweight="0.1",extrasresize="2",onlyupscale="false",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20, gender="all", chosensubjectsubtypeobject="all", chosensubjectsubtypehumanoid="all", chosensubjectsubtypeconcept="all", increasestability = False, qualityhiresfix = False, qualitymode = "highest", qualitykeep="keep used", basesize = "512", promptvariantinsanitylevel = 0, givenoutfit = "", autonegativeprompt = True, autonegativepromptstrength = 0, autonegativepromptenhance = False): +def generateimages(amount = 1, size = "all",model = "currently selected model",samplingsteps = "40",cfg= "7",hiresfix = True,hiressteps ="0",denoisestrength="0.6",samplingmethod="DPM++ SDE Karras", upscaler="R-ESRGAN 4x+", hiresscale="2",apiurl="http://127.0.0.1:7860",qualitygate=False,quality="7.6",runs="5",insanitylevel="5",subject="all", artist="all", imagetype="all",silentmode=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma", img2imgbatch = "1", img2imgsamplingsteps = "20", img2imgcfg = "7", img2imgsamplingmethod = "DPM++ SDE Karras", img2imgupscaler = "R-ESRGAN 4x+", img2imgmodel = "currently selected model", img2imgactivate = False, img2imgscale = "2", img2imgpadding = "64",img2imgdenoisestrength="0.3",ultimatesdupscale=False,usdutilewidth = "512", usdutileheight = "0", usdumaskblur = "8", usduredraw ="Linear", usduSeamsfix = "None", usdusdenoise = "0.35", usduswidth = "64", usduspadding ="32", usdusmaskblur = "8",controlnetenabled=False, controlnetmodel="",img2imgdenoisestrengthmod="-0.05",enableextraupscale = False,controlnetblockymode = False,extrasupscaler1 = "all",extrasupscaler2 ="all",extrasupscaler2visiblity="0.5",extrasupscaler2gfpgan="0",extrasupscaler2codeformer="0.15",extrasupscaler2codeformerweight="0.1",extrasresize="2",onlyupscale="false",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20, gender="all", chosensubjectsubtypeobject="all", chosensubjectsubtypehumanoid="all", chosensubjectsubtypeconcept="all", increasestability = False, qualityhiresfix = False, qualitymode = "highest", qualitykeep="keep used", basesize = "512", promptvariantinsanitylevel = 0, givenoutfit = "", autonegativeprompt = True, autonegativepromptstrength = 0, autonegativepromptenhance = False, base_model = "SD1.5"): loops = int(amount) # amount of images to generate steps = 0 upscalefilelist=[] @@ -136,12 +136,12 @@ def generateimages(amount = 1, size = "all",model = "currently selected model",s else: - randompromptlist = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, False,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept,True,False,-1,givenoutfit, prompt_g_and_l=True) + randompromptlist = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, False,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept,True,False,-1,givenoutfit, prompt_g_and_l=True, base_model=base_model) randomprompt = randompromptlist[0] randomsubject = randompromptlist[1] if(autonegativeprompt): - negativeprompt = build_dynamic_negative(positive_prompt=randomprompt, insanitylevel=autonegativepromptstrength,enhance=autonegativepromptenhance, existing_negative_prompt=originalnegativeprompt) + negativeprompt = build_dynamic_negative(positive_prompt=randomprompt, insanitylevel=autonegativepromptstrength,enhance=autonegativepromptenhance, existing_negative_prompt=originalnegativeprompt, base_model=base_model) if(randomsubject == ""): # make the filename, from from a to the first comma diff --git a/prompttester.py b/prompttester.py index e5e2b22..f9325ae 100644 --- a/prompttester.py +++ b/prompttester.py @@ -88,14 +88,13 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im # print(result) # break - steps += 1 print("") print("All done!") -generateprompts(10,5 +generateprompts(1000,5 ,"all" # subject ,"all" # artists ,"all" # image type "only other types", "only templates mode", "art blaster mode", "quality vomit mode", "color cannon mode", "unique art mode", "massive madness mode", "photo fantasy mode", "subject only mode", "fixed styles mode" @@ -115,5 +114,5 @@ generateprompts(10,5 , 0 # seed , "" #outfit override , False #prompt_g_and_l - , "Stable Cascade" #base model + , "SD1.5" #base model ) \ No newline at end of file diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index b9ba46f..736b766 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -906,7 +906,7 @@ class Script(scripts.Script): prompt4toworkflow.click(prompttoworkflowprompt, inputs=prompt4, outputs=workprompt) prompt5toworkflow.click(prompttoworkflowprompt, inputs=prompt5, outputs=workprompt) - startmain.click(generateimages, inputs=[amountofimages,size,model,samplingsteps,cfg,hiresfix,hiressteps,denoisestrength,samplingmethod, upscaler,hiresscale, apiurl, qualitygate, quality, runs,insanitylevel,subject, artist, imagetype, silentmode, workprompt, antistring, prefixprompt, suffixprompt,negativeprompt,promptcompounderlevel, seperator, img2imgbatch, img2imgsamplingsteps, img2imgcfg, img2imgsamplingmethod, img2imgupscaler, img2imgmodel,img2imgactivate, img2imgscale, img2imgpadding,img2imgdenoisestrength,ultimatesdupscale,usdutilewidth, usdutileheight, usdumaskblur, usduredraw, usduSeamsfix, usdusdenoise, usduswidth, usduspadding, usdusmaskblur, controlnetenabled, controlnetmodel,img2imgdenoisestrengthmod,enableextraupscale,controlnetblockymode,extrasupscaler1,extrasupscaler2,extrasupscaler2visiblity,extrasupscaler2gfpgan,extrasupscaler2codeformer,extrasupscaler2codeformerweight,extrasresize,onlyupscale,givensubject,smartsubject,giventypeofimage,imagemodechance, chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept, increasestability, qualityhiresfix, qualitymode, qualitykeep, basesize, promptvariantinsanitylevel, givenoutfit, autonegativeprompt, autonegativepromptstrength, autonegativepromptenhance]) + startmain.click(generateimages, inputs=[amountofimages,size,model,samplingsteps,cfg,hiresfix,hiressteps,denoisestrength,samplingmethod, upscaler,hiresscale, apiurl, qualitygate, quality, runs,insanitylevel,subject, artist, imagetype, silentmode, workprompt, antistring, prefixprompt, suffixprompt,negativeprompt,promptcompounderlevel, seperator, img2imgbatch, img2imgsamplingsteps, img2imgcfg, img2imgsamplingmethod, img2imgupscaler, img2imgmodel,img2imgactivate, img2imgscale, img2imgpadding,img2imgdenoisestrength,ultimatesdupscale,usdutilewidth, usdutileheight, usdumaskblur, usduredraw, usduSeamsfix, usdusdenoise, usduswidth, usduspadding, usdusmaskblur, controlnetenabled, controlnetmodel,img2imgdenoisestrengthmod,enableextraupscale,controlnetblockymode,extrasupscaler1,extrasupscaler2,extrasupscaler2visiblity,extrasupscaler2gfpgan,extrasupscaler2codeformer,extrasupscaler2codeformerweight,extrasresize,onlyupscale,givensubject,smartsubject,giventypeofimage,imagemodechance, chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept, increasestability, qualityhiresfix, qualitymode, qualitykeep, basesize, promptvariantinsanitylevel, givenoutfit, autonegativeprompt, autonegativepromptstrength, autonegativepromptenhance, base_model]) interrupt.click(tryinterrupt, inputs=[apiurl]) automatedoutputsfolderbutton.click(openfolder)