From dba2c193ec026256b75ac02feb30d7034e908dbd Mon Sep 17 00:00:00 2001 From: AIrjen Date: Fri, 5 Apr 2024 15:22:35 +0200 Subject: [PATCH] yay for concept mixer --- OneButtonPromptNodes.py | 7 ++++- build_dynamic_prompt.py | 41 ++++++++++++++++++++----- csvfiles/config/default_config.csv | 1 + csvfiles/episodetitles.csv | 20 +++++++++++- csvfiles/greatworks.csv | 10 +++++- csvfiles/special_lists/conceptmixer.csv | 37 ++++++++++++++++++++++ presets/obp_presets.default | 18 +++++++++++ prompttester.py | 2 ++ scripts/onebuttonprompt.py | 8 +++++ 9 files changed, 133 insertions(+), 11 deletions(-) create mode 100644 csvfiles/special_lists/conceptmixer.csv diff --git a/OneButtonPromptNodes.py b/OneButtonPromptNodes.py index 6474146..b4c72b2 100644 --- a/OneButtonPromptNodes.py +++ b/OneButtonPromptNodes.py @@ -82,6 +82,7 @@ generatepoemline = True generatesongline = True generatecardname = True generateepisodetitle = True +generateconceptmixer = True for item in config: @@ -134,6 +135,8 @@ for item in config: generatecardname = False if item[0] == 'subject_episodetitle' and item[1] != 'on': generateepisodetitle = False + if item[0] == 'subject_conceptmixer' and item[1] != 'on': + generateconceptmixer = False # build up all subjects we can choose based on the loaded config file if(generatevehicle or generateobject or generatefood or generatebuilding or generatespace): @@ -144,7 +147,7 @@ if(generatemanwoman or generatemanwomanrelation or generatefictionalcharacter or subjects.append("humanoid") if(generatelandscape): subjects.append("landscape") -if(generateevent or generateconcepts or generatepoemline or generatesongline or generatecardname or generateepisodetitle): +if(generateevent or generateconcepts or generatepoemline or generatesongline or generatecardname or generateepisodetitle or generateconceptmixer): subjects.append("concept") @@ -198,6 +201,8 @@ if(generatecardname): subjectsubtypesconcept.append("names from card based games") if(generateepisodetitle): subjectsubtypesconcept.append("episode titles from tv shows") +if(generateconceptmixer): + subjectsubtypesconcept.append("concept mixer") class OneButtonPrompt: diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index c34fe6c..da10d2e 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -360,6 +360,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all 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,"?") + conceptmixerlist = csv_to_list("conceptmixer", antilist,"./csvfiles/special_lists/",0,"?") tokinatorlist = csv_to_list("tokinator", antilist,"./csvfiles/templates/",0,"?") @@ -1304,6 +1305,8 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all subjectchooser = "cardname" if(subtypeconcept == "episode titles from tv shows"): subjectchooser = "episodetitle" + if(subtypeconcept == "concept mixer"): + subjectchooser = "conceptmixer" # After we chose the subject, lets set all things ready for He/She/It etc @@ -2151,9 +2154,28 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all if(mainchooser == "concept"): # first add a wildcard that can be used to create prompt strenght completeprompt += " -objectstrengthstart- " - if(givensubject == "" or (subjectingivensubject and givensubject != "")): + if(subjectchooser == "conceptmixer"): + + chosenconceptmixerprelist = random.choice(conceptmixerlist) + chosenconceptmixerlist = chosenconceptmixerprelist.split("@") + chosenconceptmixer = ''.join([chosenconceptmixerlist[0]]) + chosenconceptmixersubject = ''.join([chosenconceptmixerlist[1]]) + + # if there is a subject override, then replace the subject with that + if(givensubject==""): + chosenconceptmixer = chosenconceptmixer.replace("-subject-",chosenconceptmixersubject ) + elif(givensubject != "" and subjectingivensubject == False): + chosenconceptmixer = chosenconceptmixer.replace("-subject-",givensubject ) + + if(overrideoutfit!="" and ("-outfit-" in chosenconceptmixer or "-minioutfit-" in chosenconceptmixer)): + chosenconceptmixer = chosenconceptmixer.replace("-outfit-",overrideoutfit ) + chosenconceptmixer = chosenconceptmixer.replace("-minioutfit-",overrideoutfit ) + outfitmode = 1 # We dont want another outfit in this case + + completeprompt += chosenconceptmixer + elif(givensubject == "" or (subjectingivensubject and givensubject != "")): if(subjectchooser == "event"): - completeprompt += " \"" + random.choice(eventlist) + "\" " + completeprompt += " \"-event-\" " if(subjectchooser == "concept"): completeprompt += " \"The -conceptprefix- of -conceptsuffix-\" " @@ -2170,6 +2192,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all if(subjectchooser == "episodetitle"): completeprompt += " \"-episodetitle-\" " + # making subject override work with X and Y concepts, much fun! elif(givensubject != "" and subjectchooser == "concept" and subjectingivensubject == False): @@ -3198,11 +3221,12 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all "-episodetitle-" in completeprompt or "-token-" in completeprompt or "-allstylessuffix-" in completeprompt or - "-fluff-" in completeprompt): + "-fluff-" in completeprompt or + "-event-" in completeprompt): allwildcardslistnohybrid = [ "-color-","-object-", "-animal-", "-fictional-","-nonfictional-","-building-","-vehicle-","-location-","-conceptprefix-","-food-","-haircolor-","-hairstyle-","-job-", "-accessory-", "-humanoid-", "-manwoman-", "-human-", "-colorscheme-", "-mood-", "-genderdescription-", "-artmovement-", "-malefemale-", "-bodytype-", "-minilocation-", "-minilocationaddition-", "-pose-", "-season-", "-minioutfit-", "-elaborateoutfit-", "-minivomit-", "-vomit-", "-rpgclass-", "-subjectfromfile-","-outfitfromfile-", "-brand-", "-space-", "-artist-", "-imagetype-", "-othertype-", "-quality-", "-lighting-", "-camera-", "-lens-","-imagetypequality-", "-poemline-", "-songline-", "-greatwork-", "-fantasyartist-", "-popularartist-", "-romanticismartist-", "-photographyartist-", "-emoji-", "-timeperiod-", "-shotsize-", "-musicgenre-", "-animaladdition-", "-addontolocationinside-", "-addontolocation-", "-objectaddition-", "-humanaddition-", "-overalladdition-", "-focus-", "-direction-", "-styletilora-", "-manwomanrelation-", "-waterlocation-", "-container-", "-firstname-", "-flora-", "-print-", "-miniactivity-", "-pattern-", "-animalsuffixaddition-", "-chair-", "-cardname-", "-covering-", "-heshe-", "-hisher-", "-himher-", "-outfitdescriptor-", "-hairdescriptor-", "-hairvomit-", "-humandescriptor-", "-manwomanmultiple-", "-facepart-", "-buildfacepart-", "-outfitvomit-", "-locationdescriptor-", "-basicbitchdescriptor-", "-animaldescriptor-", "-humanexpression-", "-humanvomit-", "-eyecolor-", "-fashiondesigner-", "-colorcombination-", "-materialcombination-", "-oppositefictional-", "-oppositenonfictional-", "-photoaddition-", "-age-", "-agecalculator-", "-gregmode-" - ,"-portraitartist-", "-characterartist-" , "-landscapeartist-", "-scifiartist-", "-graphicdesignartist-", "-digitalartist-", "-architectartist-", "-cinemaartist-", "-setting-", "-charactertype-", "-objectstohold-", "-episodetitle-", "-token-", "-allstylessuffix-", "-fluff-"] + ,"-portraitartist-", "-characterartist-" , "-landscapeartist-", "-scifiartist-", "-graphicdesignartist-", "-digitalartist-", "-architectartist-", "-cinemaartist-", "-setting-", "-charactertype-", "-objectstohold-", "-episodetitle-", "-token-", "-allstylessuffix-", "-fluff-", "-event-"] allwildcardslistnohybridlists = [colorlist, objectlist, animallist, fictionallist, nonfictionallist, buildinglist, vehiclelist, locationlist,conceptprefixlist,foodlist,haircolorlist, hairstylelist,joblist, accessorielist, humanoidlist, manwomanlist, humanlist, colorschemelist, moodlist, genderdescriptionlist, artmovementlist, malefemalelist, bodytypelist, minilocationlist, minilocationadditionslist, poselist, seasonlist, minioutfitlist, elaborateoutfitlist, minivomitlist, vomitlist, rpgclasslist, customsubjectslist, customoutfitslist, brandlist, spacelist, artistlist, imagetypelist, othertypelist, qualitylist, lightinglist, cameralist, lenslist, imagetypequalitylist, poemlinelist, songlinelist, greatworklist, fantasyartistlist, popularartistlist, romanticismartistlist, photographyartistlist, emojilist, timeperiodlist, shotsizelist, musicgenrelist, animaladditionlist, addontolocationinsidelist, addontolocationlist, objectadditionslist, humanadditionlist, overalladditionlist, focuslist, directionlist, stylestiloralist, manwomanrelationlist, waterlocationlist, containerlist, firstnamelist, floralist, printlist, miniactivitylist, patternlist, animalsuffixadditionlist, chairlist, cardnamelist, coveringlist, heshelist, hisherlist, himherlist, outfitdescriptorlist, hairdescriptorlist, hairvomitlist, humandescriptorlist, manwomanmultiplelist, facepartlist, buildfacepartlist, outfitvomitlist, locationdescriptorlist, basicbitchdescriptorlist, animaldescriptorlist, humanexpressionlist, humanvomitlist, eyecolorlist, fashiondesignerlist, colorcombinationlist, materialcombinationlist, oppositefictionallist, oppositenonfictionallist, photoadditionlist, agelist, agecalculatorlist, gregmodelist - , portraitartistlist, characterartistlist, landscapeartistlist, scifiartistlist, graphicdesignartistlist, digitalartistlist, architectartistlist, cinemaartistlist, settinglist, charactertypelist, objectstoholdlist, episodetitlelist, tokenlist, allstylessuffixlist, flufferlist] + , portraitartistlist, characterartistlist, landscapeartistlist, scifiartistlist, graphicdesignartistlist, digitalartistlist, architectartistlist, cinemaartistlist, settinglist, charactertypelist, objectstoholdlist, episodetitlelist, tokenlist, allstylessuffixlist, flufferlist, eventlist] allwildcardslistwithhybrid = ["-material-", "-descriptor-", "-outfit-", "-conceptsuffix-","-culture-", "-objecttotal-", "-outfitprinttotal-", "-element-"] allwildcardslistwithhybridlists = [materiallist, descriptorlist,outfitlist,conceptsuffixlist,culturelist, objecttotallist, outfitprinttotallist, elementlist] @@ -3969,12 +3993,13 @@ def createpromptvariant(prompt = "", insanitylevel = 5, antivalues = "" , gender "-objectstohold-" in completeprompt or "-episodetitle-" in completeprompt or "-allstylessuffix-" in completeprompt or - "-fluff-" in completeprompt + "-fluff-" in completeprompt or + "-event-" in completeprompt ): allwildcardslistnohybrid = [ "-color-","-object-", "-animal-", "-fictional-","-nonfictional-","-building-","-vehicle-","-location-","-conceptprefix-","-food-","-haircolor-","-hairstyle-","-job-", "-accessory-", "-humanoid-", "-manwoman-", "-human-", "-colorscheme-", "-mood-", "-genderdescription-", "-artmovement-", "-malefemale-", "-bodytype-", "-minilocation-", "-minilocationaddition-", "-pose-", "-season-", "-minioutfit-", "-elaborateoutfit-", "-minivomit-", "-vomit-", "-rpgclass-", "-subjectfromfile-", "-outfitfromfile-", "-brand-", "-space-", "-artist-", "-imagetype-", "-othertype-", "-quality-", "-lighting-", "-camera-", "-lens-","-imagetypequality-", "-poemline-", "-songline-", "-greatwork-", "-fantasyartist-", "-popularartist-", "-romanticismartist-", "-photographyartist-", "-emoji-", "-timeperiod-", "-shotsize-", "-musicgenre-", "-animaladdition-", "-objectaddition-", "-humanaddition-", "-overalladdition-", "-focus-", "-direction-", "-styletilora-", "-manwomanrelation-", "-waterlocation-", "-container-", "-firstname-", "-flora-", "-print-", "-miniactivity-", "-pattern-", "-chair-", "-cardname-", "-covering-", "-outfitdescriptor-", "-hairdescriptor-", "-hairvomit-", "-humandescriptor-", "-manwomanmultiple-", "-facepart-", "-locationdescriptor-", "-basicbitchdescriptor-", "-animaldescriptor-", "-humanexpression-", "-humanvomit-", "-eyecolor-", "-fashiondesigner-", "-colorcombination-", "-materialcombination-", "-photoaddition-", "-age-", "agecalculator-", "-gregmode-" - ,"-portraitartist-", "-characterartist-" , "-landscapeartist-", "-scifiartist-", "-graphicdesignartist-", "-digitalartist-", "-architectartist-", "-cinemaartist-", "-setting-", "-charactertype-", "-objectstohold-", "-episodetitle-", "-allstylessuffix-", "-fluff-"] + ,"-portraitartist-", "-characterartist-" , "-landscapeartist-", "-scifiartist-", "-graphicdesignartist-", "-digitalartist-", "-architectartist-", "-cinemaartist-", "-setting-", "-charactertype-", "-objectstohold-", "-episodetitle-", "-allstylessuffix-", "-fluff-", "-event-"] allwildcardslistnohybridlists = [colorlist, objectlist, animallist, fictionallist, nonfictionallist, buildinglist, vehiclelist, locationlist,conceptprefixlist,foodlist,haircolorlist, hairstylelist,joblist, accessorielist, humanoidlist, manwomanlist, humanlist, colorschemelist, moodlist, genderdescriptionlist, artmovementlist, malefemalelist, bodytypelist, minilocationlist, minilocationadditionslist, poselist, seasonlist, minioutfitlist, elaborateoutfitlist, minivomitlist, vomitlist, rpgclasslist, customsubjectslist, customoutfitslist, brandlist, spacelist, artistlist, imagetypelist, othertypelist, qualitylist, lightinglist, cameralist, lenslist, imagetypequalitylist, poemlinelist, songlinelist, greatworklist, fantasyartistlist, popularartistlist, romanticismartistlist, photographyartistlist, emojilist, timeperiodlist, shotsizelist, musicgenrelist, animaladditionlist, objectadditionslist, humanadditionlist, overalladditionlist, focuslist, directionlist, stylestiloralist, manwomanrelationlist, waterlocationlist, containerlist, firstnamelist, floralist, printlist, miniactivitylist, patternlist, chairlist, cardnamelist, coveringlist, outfitdescriptorlist, hairdescriptorlist, hairvomitlist, humandescriptorlist, manwomanmultiplelist, facepartlist, locationdescriptorlist, basicbitchdescriptorlist, animaldescriptorlist, humanexpressionlist, humanvomitlist, eyecolorlist, fashiondesignerlist, colorcombinationlist, materialcombinationlist, photoadditionlist, agelist, agecalculatorlist, gregmodelist - , portraitartistlist, characterartistlist, landscapeartistlist, scifiartistlist, graphicdesignartistlist, digitalartistlist, architectartistlist, cinemaartistlist, settinglist, charactertypelist, objectstoholdlist, episodetitlelist, allstylessuffixlist, flufferlist] + , portraitartistlist, characterartistlist, landscapeartistlist, scifiartistlist, graphicdesignartistlist, digitalartistlist, architectartistlist, cinemaartistlist, settinglist, charactertypelist, objectstoholdlist, episodetitlelist, allstylessuffixlist, flufferlist, eventlist] allwildcardslistwithhybrid = ["-material-", "-descriptor-", "-outfit-", "-conceptsuffix-","-culture-", "-objecttotal-", "-outfitprinttotal-", "-element-"] allwildcardslistwithhybridlists = [materiallist, descriptorlist,outfitlist,conceptsuffixlist,culturelist, objecttotallist, outfitprinttotallist, elementlist] diff --git a/csvfiles/config/default_config.csv b/csvfiles/config/default_config.csv index a55a9fc..ff0ca45 100644 --- a/csvfiles/config/default_config.csv +++ b/csvfiles/config/default_config.csv @@ -31,6 +31,7 @@ subject_poemline;on subject_songline;on subject_cardname;on subject_episodetitle;on +subject_conceptmixer;on #----; # other main lists, in order of appearance; # setting the random chance, for normal generation; diff --git a/csvfiles/episodetitles.csv b/csvfiles/episodetitles.csv index 83c25ca..e6a861b 100644 --- a/csvfiles/episodetitles.csv +++ b/csvfiles/episodetitles.csv @@ -6092,4 +6092,22 @@ Small Potatoes;X-files Zero Sum;X-files Elegy;X-files Demons;X-files -Gethsemane;X-files \ No newline at end of file +Gethsemane;X-files +Countdown;3 body problem +Red Coast;3 body problem +Destroyer of Worlds;3 body problem +Our Lord;3 body problem +Judgment Day;3 body problem +The Stars Our Destination;3 body problem +Only Advance;3 body problem +Wallfacer;3 body problem +Anjin;Shogun +Servants of Two Masters;Shogun +Tomorrow Is Tomorrow;Shogun +The Eightfold Fence;Shogun +Broken to the Fist;Shogun +Ladies of the Willow World;Shogun +A Stick of Time;Shogun +The Abyss of Life;Shogun +Crimson Sky;Shogun +A Dream of a Dream;Shogun \ No newline at end of file diff --git a/csvfiles/greatworks.csv b/csvfiles/greatworks.csv index ad947d3..17a39cd 100644 --- a/csvfiles/greatworks.csv +++ b/csvfiles/greatworks.csv @@ -12,4 +12,12 @@ Christ Pantocrator The Creation of Adam The Scream Star Wars --brand- \ No newline at end of file +-brand- +Gearnica +The Arnolfini Portrait +The Garden of Earthly Delights +A Sunday Afternoon on the Island of La Grande Jatte +Composition with Red Blue and Yellow +Nighthawks +The thinker +Perseus with the Head of Medusa \ No newline at end of file diff --git a/csvfiles/special_lists/conceptmixer.csv b/csvfiles/special_lists/conceptmixer.csv new file mode 100644 index 0000000..b55c0a9 --- /dev/null +++ b/csvfiles/special_lists/conceptmixer.csv @@ -0,0 +1,37 @@ +anthropomorphic -food---subject-@OR(person;animal;bird) +-subject--o-saurus@-food- +-subject- wearing OR(-animal-;-element-)-style -outfit-@-manwoman- +anthropomorphic, -subject- with the head of an -animal-@-manwoman- +-subject- shaped as a -food-@-objecttotal- +-subject- shaped as a -object-@-food- +-subject---animal- hybrid@OR(-humanoid-;-animal-) +-subject- as a -charactertype- character@OR(-nonfictional-;-fictional-;-animal-) +-subject---fictional- hybrid person@-fictional- +the personification of -subject-@-conceptsuffix- +-subject- made by -brand-@-objecttotal- +-subject- turned -job-@-job- +-subject---building- hybrid@-building- +-subject---location- hybrid@-location- +-subject---vehicle- hybrid@-vehicle- +-element--style -subject-@-rpgclass- +-subject---humanoid- hybrid@-humanoid- +displaying the words "-subject-"@-cardname- +-subject- inside a -container-@-objecttotal- +-subject- adorned with -flora-, -flora-, -flora- and -flora-@landscape +-subject- with -pattern- print@-animal- +-musicgenre--style -subject-@-objecttotal- +the -subject- of the -animal-s@-job- +-basicbitchdescriptor- -subject- as a -rpgclass-@-animal- +-subject- made out of -materialcombination-@OR(-objecttotal-;-animal-) +"-cardname-"-inspired -subject-@OR(-manwoman-;-animal-;-objecttotal-) +the -subject- from -charactertype-@OR(-job-;-humanoid-;-animal-;-objecttotal-) +-accessory-, -accessory-, -subject-@-manwoman- +a -accessory- wearing -subject-@-manwoman- +the -job- -subject- of -conceptsuffix-@-animal- +the -subject- -job- of -conceptsuffix-@-malefemale- +-subject- capturing the essence of "-poemline-"@OR(-malefemale-;-animal-) +-subject- based on "-episodetitle-"@OR(-malefemale-;-animal-) +-charactertype- inspired -subject-@-objecttotal- +-subject- set in a -setting- setting@OR(-manwoman-;-animal) +-greatwork- but with -subject-@OR(-nonfictional-;-fictional-;-animal-) +the -event- reenacted by -subject-@OR(-nonfictional-;-fictional-;-animal-) \ No newline at end of file diff --git a/presets/obp_presets.default b/presets/obp_presets.default index e0d23b1..48a7a19 100644 --- a/presets/obp_presets.default +++ b/presets/obp_presets.default @@ -233,6 +233,24 @@ "giventypeofimage": "wallpaper art, in the center is an image", "antistring": "" }, + "The Cauldron": { + "insanitylevel": 5, + "subject": "concept", + "artist": "all", + "chosensubjectsubtypeobject": "all", + "chosensubjectsubtypehumanoid": "all", + "chosensubjectsubtypeconcept": "concept mixer", + "chosengender": "all", + "imagetype": "subject only mode", + "imagemodechance": "20", + "givensubject": "", + "smartsubject": true, + "givenoutfit": "", + "prefixprompt": "", + "suffixprompt": "-quality-, -fluff-, -fluff-, -quality-, -fluff-", + "giventypeofimage": "", + "antistring": "" + }, "The Connaisseur": { "insanitylevel": 5, "subject": "concept", diff --git a/prompttester.py b/prompttester.py index f489749..1ecf5e3 100644 --- a/prompttester.py +++ b/prompttester.py @@ -82,6 +82,8 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im resultnew = resultnew.replace("-da-", " da ") resultnew = resultnew.replace("-doo-", " doo ") resultnew = resultnew.replace("-and-", " and ") + resultnew = resultnew.replace("-o-", " o ") + resultnew = resultnew.replace("-horse-", " horse ") matches = re.findall(r'-\w+-', resultnew) # Filter out matches with commas and spaces diff --git a/scripts/onebuttonprompt.py b/scripts/onebuttonprompt.py index e051335..1f769d6 100644 --- a/scripts/onebuttonprompt.py +++ b/scripts/onebuttonprompt.py @@ -108,6 +108,7 @@ generatepoemline = True generatesongline = True generatecardname = True generateepisodetitle = True +generateconceptmixer = True for item in config: @@ -160,6 +161,8 @@ for item in config: generatecardname = False if item[0] == 'subject_episodetitle' and item[1] != 'on': generateepisodetitle = False + if item[0] == 'subject_conceptmixer' and item[1] != 'on': + generateconceptmixer = False # build up all subjects we can choose based on the loaded config file if(generatevehicle or generateobject or generatefood or generatebuilding or generatespace): @@ -225,6 +228,8 @@ if(generatecardname): subjectsubtypesconcept.append("names from card based games") if(generateepisodetitle): subjectsubtypesconcept.append("episode titles from tv shows") +if(generateconceptmixer): + subjectsubtypesconcept.append("concept mixer") @@ -466,6 +471,9 @@ class Script(scripts.Script): 6. names from card based games - Picks a card name from various card games, such as magic the gathering, yugioh and many others. + 7. episode titles from tv shows - Picks a episode title from a popular tv series, such as Star Trek, Simpsons, game of Thrones, etc. + + 6. concept mixer - A mixer of different keywords and concepts. For example animal hybrids, objects shaped as other objects or other unusual combinations. ### 🎨 Artists