|
|
import random
|
|
|
import re
|
|
|
from csv_reader import *
|
|
|
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):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(seed > 0):
|
|
|
random.seed(seed)
|
|
|
|
|
|
|
|
|
if(advancedprompting != False and random.randint(0,max(0, insanitylevel - 2)) <= 0):
|
|
|
advancedprompting == False
|
|
|
|
|
|
originalartistchoice = artists
|
|
|
doartistnormal = True
|
|
|
|
|
|
config = load_config_csv()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
emptylist = []
|
|
|
antilist = csv_to_list("antilist",emptylist , "./userfiles/",1)
|
|
|
|
|
|
antivaluelist = antivalues.split(",")
|
|
|
|
|
|
antilist += antivaluelist
|
|
|
|
|
|
|
|
|
antilist = [s.strip().lower() for s in antilist]
|
|
|
|
|
|
|
|
|
if(gender=="all"):
|
|
|
genderchoicelist = ["male", "female"]
|
|
|
gender = random.choice(genderchoicelist)
|
|
|
heshelist = ["it"]
|
|
|
hisherlist = ["its"]
|
|
|
himherlist = ["it"]
|
|
|
|
|
|
oppositegender = "male"
|
|
|
if(gender=="male"):
|
|
|
oppositegender = "female"
|
|
|
|
|
|
|
|
|
|
|
|
colorlist = csv_to_list("colors",antilist)
|
|
|
animallist = csv_to_list("animals",antilist)
|
|
|
materiallist = csv_to_list("materials",antilist)
|
|
|
objectlist = csv_to_list("objects",antilist)
|
|
|
fictionallist = csv_to_list(csvfilename="fictional characters",antilist=antilist,skipheader=True,gender=gender)
|
|
|
nonfictionallist = csv_to_list(csvfilename="nonfictional characters",antilist=antilist,skipheader=True,gender=gender)
|
|
|
oppositefictionallist = csv_to_list(csvfilename="fictional characters",antilist=antilist,skipheader=True,gender=oppositegender)
|
|
|
oppositenonfictionallist = csv_to_list(csvfilename="nonfictional characters",antilist=antilist,skipheader=True,gender=oppositegender)
|
|
|
conceptsuffixlist = csv_to_list("concept_suffix",antilist)
|
|
|
buildinglist = csv_to_list("buildings",antilist)
|
|
|
vehiclelist = csv_to_list("vehicles",antilist)
|
|
|
outfitlist = csv_to_list("outfits",antilist)
|
|
|
locationlist = csv_to_list("locations",antilist)
|
|
|
|
|
|
accessorielist = csv_to_list("accessories",antilist,"./csvfiles/",0,"?",False,False,gender)
|
|
|
artmovementlist = csv_to_list("artmovements",antilist)
|
|
|
bodytypelist = csv_to_list("body_types",antilist=antilist,skipheader=True,gender=gender)
|
|
|
cameralist = csv_to_list("cameras",antilist)
|
|
|
colorschemelist = csv_to_list("colorscheme",antilist)
|
|
|
conceptprefixlist = csv_to_list("concept_prefix",antilist)
|
|
|
culturelist = csv_to_list("cultures",antilist)
|
|
|
descriptorlist = csv_to_list("descriptors",antilist)
|
|
|
devmessagelist = csv_to_list("devmessages",antilist)
|
|
|
directionlist = csv_to_list(csvfilename="directions",antilist=antilist,insanitylevel=insanitylevel)
|
|
|
emojilist = csv_to_list("emojis",antilist)
|
|
|
eventlist = csv_to_list("events",antilist)
|
|
|
focuslist = csv_to_list(csvfilename="focus",antilist=antilist, insanitylevel=insanitylevel)
|
|
|
greatworklist = csv_to_list("greatworks",antilist)
|
|
|
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)
|
|
|
lenslist = csv_to_list(csvfilename="lenses",antilist=antilist, insanitylevel=insanitylevel)
|
|
|
lightinglist = csv_to_list(csvfilename="lighting",antilist=antilist, insanitylevel=insanitylevel)
|
|
|
malefemalelist = csv_to_list(csvfilename="malefemale",antilist=antilist,skipheader=True,gender=gender)
|
|
|
manwomanlist = csv_to_list(csvfilename="manwoman",antilist=antilist,skipheader=True,gender=gender)
|
|
|
moodlist = csv_to_list(csvfilename="moods",antilist=antilist, insanitylevel=insanitylevel)
|
|
|
othertypelist = csv_to_list("othertypes",antilist)
|
|
|
poselist = csv_to_list("poses",antilist)
|
|
|
qualitylist = csv_to_list("quality",antilist)
|
|
|
shotsizelist = csv_to_list(csvfilename="shotsizes",antilist=antilist, insanitylevel=insanitylevel)
|
|
|
timeperiodlist = csv_to_list("timeperiods",antilist)
|
|
|
vomitlist = csv_to_list(csvfilename="vomit",antilist=antilist, insanitylevel=insanitylevel)
|
|
|
foodlist = csv_to_list("foods", antilist)
|
|
|
genderdescriptionlist = csv_to_list(csvfilename="genderdescription",antilist=antilist,skipheader=True,gender=gender)
|
|
|
minilocationlist = csv_to_list("minilocations", antilist)
|
|
|
minioutfitlist = csv_to_list("minioutfits",antilist,"./csvfiles/",0,"?",False,False,gender)
|
|
|
seasonlist = csv_to_list("seasons", antilist)
|
|
|
elaborateoutfitlist = csv_to_list("elaborateoutfits", antilist)
|
|
|
minivomitlist = csv_to_list("minivomit", antilist)
|
|
|
imagetypequalitylist = csv_to_list("imagetypequality", antilist)
|
|
|
rpgclasslist = csv_to_list("rpgclasses", antilist)
|
|
|
brandlist = csv_to_list("brands", antilist)
|
|
|
spacelist = csv_to_list("space", antilist)
|
|
|
poemlinelist = csv_to_list("poemlines", antilist)
|
|
|
songlinelist = csv_to_list("songlines", antilist)
|
|
|
musicgenrelist = csv_to_list("musicgenres", antilist)
|
|
|
manwomanrelationlist = csv_to_list(csvfilename="manwomanrelations",antilist=antilist,skipheader=True,gender=gender)
|
|
|
manwomanmultiplelist = csv_to_list(csvfilename="manwomanmultiples",antilist=antilist,skipheader=True,gender=gender,delimiter="?")
|
|
|
waterlocationlist = csv_to_list("waterlocations", antilist)
|
|
|
containerlist = csv_to_list("containers", antilist)
|
|
|
firstnamelist = csv_to_list(csvfilename="firstnames",antilist=antilist,skipheader=True,gender=gender)
|
|
|
floralist = csv_to_list("flora", antilist)
|
|
|
printlist = csv_to_list("prints", antilist)
|
|
|
patternlist = csv_to_list("patterns", antilist)
|
|
|
chairlist = csv_to_list("chairs", antilist)
|
|
|
cardnamelist = csv_to_list("card_names", antilist)
|
|
|
coveringlist = csv_to_list("coverings", antilist)
|
|
|
facepartlist = csv_to_list("faceparts", antilist)
|
|
|
outfitvomitlist = csv_to_list(csvfilename="outfitvomit",antilist=antilist,delimiter="?")
|
|
|
humanexpressionlist = csv_to_list(csvfilename="humanexpressions",antilist=antilist,delimiter="?")
|
|
|
humanvomitlist = csv_to_list("humanvomit", antilist)
|
|
|
eyecolorlist = csv_to_list("eyecolors", antilist)
|
|
|
fashiondesignerlist = csv_to_list("fashiondesigners", antilist)
|
|
|
colorcombinationlist = csv_to_list("colorcombinations", antilist)
|
|
|
materialcombinationlist = csv_to_list("materialcombinations", antilist)
|
|
|
agelist = csv_to_list("ages", antilist)
|
|
|
agecalculatorlist = csv_to_list("agecalculator", antilist)
|
|
|
elementlist = csv_to_list("elements", antilist)
|
|
|
settinglist = csv_to_list("settings", antilist)
|
|
|
charactertypelist = csv_to_list("charactertypes", antilist)
|
|
|
objectstoholdlist = csv_to_list("objectstohold", antilist)
|
|
|
episodetitlelist = csv_to_list(csvfilename="episodetitles",antilist=antilist,skipheader=True)
|
|
|
|
|
|
|
|
|
|
|
|
outfitdescriptorlist = csv_to_list("outfitdescriptors",antilist)
|
|
|
hairdescriptorlist = csv_to_list("hairdescriptors",antilist)
|
|
|
humandescriptorlist = csv_to_list("humandescriptors",antilist)
|
|
|
locationdescriptorlist = csv_to_list("locationdescriptors",antilist)
|
|
|
basicbitchdescriptorlist = csv_to_list("basicbitchdescriptors",antilist)
|
|
|
animaldescriptorlist = csv_to_list("animaldescriptors",antilist)
|
|
|
|
|
|
|
|
|
descriptortotallist = descriptorlist + outfitdescriptorlist + hairdescriptorlist + humandescriptorlist + locationdescriptorlist + basicbitchdescriptorlist + animaldescriptorlist
|
|
|
|
|
|
descriptorlist = []
|
|
|
seen_items = set()
|
|
|
|
|
|
for item in descriptortotallist:
|
|
|
|
|
|
item_lower = item.lower()
|
|
|
|
|
|
if item_lower not in seen_items:
|
|
|
seen_items.add(item_lower)
|
|
|
descriptorlist.append(item)
|
|
|
|
|
|
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-)",
|
|
|
"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
|
|
|
|
|
|
if artists == "wild":
|
|
|
artists = "all (wild)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(artists == "all" and rare_dist(insanitylevel)):
|
|
|
artists = "all (wild)"
|
|
|
originalartistchoice = artists
|
|
|
|
|
|
artisttypes = ["popular", "3D", "abstract", "angular", "anime" ,"architecture", "art nouveau", "art deco", "baroque", "bauhaus", "cartoon", "character", "children's illustration", "cityscape", "cinema", "clean", "cloudscape", "collage", "colorful", "comics", "cubism", "dark", "detailed", "digital", "expressionism", "fantasy", "fashion", "fauvism", "figurativism", "graffiti", "graphic design", "high contrast", "horror", "impressionism", "installation", "landscape", "light", "line drawing", "low contrast", "luminism", "magical realism", "manga", "melanin", "messy", "monochromatic", "nature", "photography", "pop art", "portrait", "primitivism", "psychedelic", "realism", "renaissance", "romanticism", "scene", "sci-fi", "sculpture", "seascape", "space", "stained glass", "still life", "storybook realism", "street art", "streetscape", "surrealism", "symbolism", "textile", "ukiyo-e", "vibrant", "watercolor", "whimsical"]
|
|
|
artiststyleselector = ""
|
|
|
artiststyleselectormode = "normal"
|
|
|
if(artists == "all" and normal_dist(insanitylevel + 1)):
|
|
|
artiststyleselector = random.choice(artisttypes)
|
|
|
artists = artiststyleselector
|
|
|
elif(artists == "all"):
|
|
|
artiststyleselectormode = "custom"
|
|
|
|
|
|
if(random.randint(0,6) == 0 and onlyartists == False):
|
|
|
generateartist = False
|
|
|
|
|
|
elif(common_dist(max(3,insanitylevel))):
|
|
|
artists = "popular"
|
|
|
|
|
|
elif(insanitylevel < 6):
|
|
|
artists = "greg mode"
|
|
|
else:
|
|
|
artists = "popular"
|
|
|
|
|
|
|
|
|
else:
|
|
|
artiststyleselectormode = "custom"
|
|
|
|
|
|
|
|
|
|
|
|
artistlist = []
|
|
|
|
|
|
if(artists != "all (wild)" and artists != "all" and artists != "none" and artists.startswith("personal_artists") == False and artists.startswith("personal artists") == False and artists in artisttypes):
|
|
|
artistlist = artist_category_csv_to_list("artists_and_category",artists)
|
|
|
elif(artists.startswith("personal_artists") == True or artists.startswith("personal artists") == True):
|
|
|
artists = artists.replace(" ","_",-1)
|
|
|
artistlist = csv_to_list(artists,antilist,"./userfiles/")
|
|
|
elif(artists != "none"):
|
|
|
artistlist = csv_to_list("artists",antilist)
|
|
|
|
|
|
|
|
|
fantasyartistlist = artist_category_csv_to_list("artists_and_category","fantasy")
|
|
|
popularartistlist = artist_category_csv_to_list("artists_and_category","popular")
|
|
|
romanticismartistlist = artist_category_csv_to_list("artists_and_category","romanticism")
|
|
|
photographyartistlist = artist_category_csv_to_list("artists_and_category","photography")
|
|
|
portraitartistlist = artist_category_csv_to_list("artists_and_category","portrait")
|
|
|
characterartistlist = artist_category_csv_to_list("artists_and_category","character")
|
|
|
landscapeartistlist = artist_category_csv_to_list("artists_and_category","landscape")
|
|
|
scifiartistlist = artist_category_csv_to_list("artists_and_category","sci-fi")
|
|
|
graphicdesignartistlist = artist_category_csv_to_list("artists_and_category","graphic design")
|
|
|
digitalartistlist = artist_category_csv_to_list("artists_and_category","digital")
|
|
|
architectartistlist = artist_category_csv_to_list("artists_and_category","architecture")
|
|
|
cinemaartistlist = artist_category_csv_to_list("artists_and_category","cinema")
|
|
|
gregmodelist = csv_to_list("gregmode", antilist)
|
|
|
|
|
|
|
|
|
|
|
|
stylestiloralist = csv_to_list("styles_ti_lora",antilist,"./userfiles/")
|
|
|
generatestyle = bool(stylestiloralist)
|
|
|
|
|
|
custominputprefixlist = csv_to_list("custom_input_prefix",antilist,"./userfiles/")
|
|
|
generatecustominputprefix = bool(custominputprefixlist)
|
|
|
|
|
|
custominputmidlist = csv_to_list("custom_input_mid",antilist,"./userfiles/")
|
|
|
generatecustominputmid = bool(custominputmidlist)
|
|
|
|
|
|
custominputsuffixlist = csv_to_list("custom_input_suffix",antilist,"./userfiles/")
|
|
|
generatecustominputsuffix = bool(custominputsuffixlist)
|
|
|
|
|
|
customsubjectslist = csv_to_list("custom_subjects",antilist,"./userfiles/")
|
|
|
customoutfitslist = csv_to_list("custom_outfits",antilist,"./userfiles/")
|
|
|
|
|
|
|
|
|
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,"?")
|
|
|
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,"?")
|
|
|
|
|
|
styleslist = csv_to_list("styles", antilist,"./csvfiles/templates/",0,"?")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainchooserlist = []
|
|
|
objectwildcardlist = []
|
|
|
hybridlist = []
|
|
|
hybridhumanlist = []
|
|
|
humanoidsubjectchooserlist = []
|
|
|
eventsubjectchooserlist = []
|
|
|
addontolocationinsidelist = []
|
|
|
addontolocationlist = []
|
|
|
|
|
|
|
|
|
generatevehicle = True
|
|
|
generateobject = True
|
|
|
generatefood = True
|
|
|
generatebuilding = True
|
|
|
generatespace = True
|
|
|
generateflora = True
|
|
|
generateanimal = True
|
|
|
generatemanwoman = True
|
|
|
generatemanwomanrelation = True
|
|
|
generatemanwomanmultiple = True
|
|
|
generatefictionalcharacter = True
|
|
|
generatenonfictionalcharacter = True
|
|
|
generatehumanoids = True
|
|
|
generatejob = True
|
|
|
generatefirstnames = True
|
|
|
generatelandscape = True
|
|
|
generateevent = True
|
|
|
generateconcepts = True
|
|
|
generatepoemline = True
|
|
|
generatesongline = True
|
|
|
generatecardname = True
|
|
|
generateepisodetitle = True
|
|
|
|
|
|
custominputprefixrepeats = 2
|
|
|
custominputprefixchance = 'uncommon'
|
|
|
|
|
|
imagetypechance = 'normal'
|
|
|
generateimagetype = True
|
|
|
imagetypequalitychance = 'rare'
|
|
|
generateimagetypequality = True
|
|
|
generateminilocationaddition = True
|
|
|
minilocationadditionchance = 'unique'
|
|
|
artmovementprefixchance = 'unique'
|
|
|
minivomitprefix1chance = 'rare'
|
|
|
minivomitprefix2chance = 'unique'
|
|
|
shotsizechance = 'uncommon'
|
|
|
|
|
|
subjectdescriptor1chance = 'common'
|
|
|
subjectdescriptor2chance = 'uncommon'
|
|
|
subjectbodytypechance = 'normal'
|
|
|
subjectculturechance = 'normal'
|
|
|
subjectconceptsuffixchance = 'unique'
|
|
|
|
|
|
subjectlandscapeinsideshotchance = 'unique'
|
|
|
subjectlandscapeaddonlocationchance = 'normal'
|
|
|
subjectlandscapeaddonlocationdescriptorchance = 'rare'
|
|
|
subjectlandscapeaddonlocationculturechance = 'rare'
|
|
|
|
|
|
objectadditionsrepeats = 2
|
|
|
objectadditionschance = 'uncommon'
|
|
|
humanadditionchance = 'rare'
|
|
|
overalladditionchance = 'extraordinary'
|
|
|
|
|
|
emojichance = 'legendary'
|
|
|
buildfacechance = 'legendary'
|
|
|
humanexpressionchance = 'rare'
|
|
|
joboractivitychance = 'normal'
|
|
|
humanvomitchance = 'rare'
|
|
|
|
|
|
custominputmidrepeats = 2
|
|
|
custominputmidchance = 'uncommon'
|
|
|
minivomitmidchance = 'unique'
|
|
|
|
|
|
outfitchance = 'normal'
|
|
|
posechance = 'uncommon'
|
|
|
hairchance = 'normal'
|
|
|
accessorychance = 'normal'
|
|
|
humanoidinsideshotchance = 'legendary'
|
|
|
humanoidbackgroundchance = 'uncommon'
|
|
|
|
|
|
landscapeminilocationchance = 'uncommon'
|
|
|
generalminilocationchance = 'rare'
|
|
|
|
|
|
timperiodchance = 'normal'
|
|
|
focuschance = 'normal'
|
|
|
directionchance = 'normal'
|
|
|
moodchance = 'normal'
|
|
|
minivomitsuffixchance = 'unique'
|
|
|
artmovementchance = 'normal'
|
|
|
lightingchance = 'normal'
|
|
|
photoadditionchance = 'common'
|
|
|
lenschance = 'normal'
|
|
|
colorschemechance = 'normal'
|
|
|
vomit1chance = 'uncommon'
|
|
|
vomit2chance= 'uncommon'
|
|
|
greatworkchance = 'novel'
|
|
|
poemlinechance = 'novel'
|
|
|
songlinechance = 'novel'
|
|
|
quality1chance = 'uncommon'
|
|
|
quality2chance = 'uncommon'
|
|
|
|
|
|
customstyle1chance = 'uncommon'
|
|
|
customstyle2chance = 'uncommon'
|
|
|
|
|
|
custominputsuffixrepeats = 2
|
|
|
custominputsuffixchance = 'uncommon'
|
|
|
|
|
|
artistsatbackchance = 'uncommon'
|
|
|
|
|
|
for item in config:
|
|
|
|
|
|
if item[0] == 'subject_vehicle' and item[1] != 'on':
|
|
|
generatevehicle = False
|
|
|
if item[0] == 'subject_object' and item[1] != 'on':
|
|
|
generateobject = False
|
|
|
if item[0] == 'subject_food' and item[1] != 'on':
|
|
|
generatefood = False
|
|
|
if item[0] == 'subject_building' and item[1] != 'on':
|
|
|
generatebuilding = False
|
|
|
if item[0] == 'subject_space' and item[1] != 'on':
|
|
|
generatespace = False
|
|
|
if item[0] == 'subject_flora' and item[1] != 'on':
|
|
|
generateflora = False
|
|
|
|
|
|
if item[0] == 'subject_animal' and item[1] != 'on':
|
|
|
generateanimal = False
|
|
|
|
|
|
if item[0] == 'subject_manwoman' and item[1] != 'on':
|
|
|
generatemanwoman = False
|
|
|
if item[0] == 'subject_manwomanrelation' and item[1] != 'on':
|
|
|
generatemanwomanrelation = False
|
|
|
if item[0] == 'subject_manwomanmultiple' and item[1] != 'on':
|
|
|
generatemanwomanmultiple = False
|
|
|
if item[0] == 'subject_fictional' and item[1] != 'on':
|
|
|
generatefictionalcharacter = False
|
|
|
if item[0] == 'subject_nonfictional' and item[1] != 'on':
|
|
|
generatenonfictionalcharacter = False
|
|
|
if item[0] == 'subject_humanoid' and item[1] != 'on':
|
|
|
generatehumanoids = False
|
|
|
if item[0] == 'subject_job' and item[1] != 'on':
|
|
|
generatejob = False
|
|
|
if item[0] == 'subject_firstnames' and item[1] != 'on':
|
|
|
generatefirstnames = False
|
|
|
|
|
|
if item[0] == 'subject_landscape' and item[1] != 'on':
|
|
|
generatelandscape = False
|
|
|
|
|
|
if item[0] == 'subject_event' and item[1] != 'on':
|
|
|
generateevent = False
|
|
|
if item[0] == 'subject_concept' and item[1] != 'on':
|
|
|
generateconcepts = False
|
|
|
if item[0] == 'subject_poemline' and item[1] != 'on':
|
|
|
generatepoemline = False
|
|
|
if item[0] == 'subject_songline' and item[1] != 'on':
|
|
|
generatesongline = False
|
|
|
if item[0] == 'subject_cardname' and item[1] != 'on':
|
|
|
generatecardname = False
|
|
|
if item[0] == 'subject_episodetitle' and item[1] != 'on':
|
|
|
generateepisodetitle = False
|
|
|
|
|
|
|
|
|
if item[0] == 'custominputprefixrepeats':
|
|
|
custominputprefixrepeats = int(item[1])
|
|
|
if item[0] == 'custominputprefixchance':
|
|
|
custominputprefixchance = item[1]
|
|
|
if(custominputprefixchance == 'never'):
|
|
|
generatecustominputprefix = False
|
|
|
if item[0] == 'imagetypechance':
|
|
|
imagetypechance = item[1]
|
|
|
if(imagetypechance == 'never'):
|
|
|
generateimagetype = False
|
|
|
if item[0] == 'imagetypequalitychance':
|
|
|
imagetypequalitychance = item[1]
|
|
|
if(imagetypequalitychance == 'never'):
|
|
|
generateimagetypequality = False
|
|
|
if item[0] == 'minilocationadditionchance':
|
|
|
minilocationadditionchance = item[1]
|
|
|
if item[0] == 'artmovementprefixchance':
|
|
|
artmovementprefixchance = item[1]
|
|
|
if item[0] == 'minivomitprefix1chance':
|
|
|
minivomitprefix1chance = item[1]
|
|
|
if item[0] == 'minivomitprefix2chance':
|
|
|
minivomitprefix2chance = item[1]
|
|
|
|
|
|
if item[0] == 'shotsizechance':
|
|
|
shotsizechance = item[1]
|
|
|
|
|
|
if item[0] == 'subjectdescriptor1chance':
|
|
|
subjectdescriptor1chance = item[1]
|
|
|
if item[0] == 'subjectdescriptor2chance':
|
|
|
subjectdescriptor2chance = item[1]
|
|
|
if item[0] == 'subjectbodytypechance':
|
|
|
subjectbodytypechance = item[1]
|
|
|
if item[0] == 'subjectculturechance':
|
|
|
subjectculturechance = item[1]
|
|
|
if item[0] == 'subjectconceptsuffixchance':
|
|
|
subjectconceptsuffixchance = item[1]
|
|
|
|
|
|
if item[0] == 'subjectlandscapeinsideshotchance':
|
|
|
subjectlandscapeinsideshotchance = item[1]
|
|
|
if item[0] == 'subjectlandscapeaddonlocationchance':
|
|
|
subjectlandscapeaddonlocationchance = item[1]
|
|
|
if item[0] == 'subjectlandscapeaddonlocationdescriptorchance':
|
|
|
subjectlandscapeaddonlocationdescriptorchance = item[1]
|
|
|
if item[0] == 'subjectlandscapeaddonlocationculturechance':
|
|
|
subjectlandscapeaddonlocationculturechance = item[1]
|
|
|
|
|
|
if item[0] == 'objectadditionsrepeats':
|
|
|
objectadditionsrepeats = int(item[1])
|
|
|
if item[0] == 'objectadditionschance':
|
|
|
objectadditionschance = item[1]
|
|
|
if item[0] == 'humanadditionchance':
|
|
|
humanadditionchance = item[1]
|
|
|
if item[0] == 'overalladditionchance':
|
|
|
overalladditionchance = item[1]
|
|
|
|
|
|
if item[0] == 'emojichance':
|
|
|
emojichance = item[1]
|
|
|
if(hardturnoffemojis==True):
|
|
|
emojichance='never'
|
|
|
if item[0] == 'buildfacechance':
|
|
|
buildfacechance = item[1]
|
|
|
if item[0] == 'humanexpressionchance':
|
|
|
humanexpressionchance = item[1]
|
|
|
if item[0] == 'humanvomitchance':
|
|
|
humanvomitchance = item[1]
|
|
|
if item[0] == 'joboractivitychance':
|
|
|
joboractivitychance = item[1]
|
|
|
|
|
|
if item[0] == 'custominputmidrepeats':
|
|
|
custominputmidrepeats = int(item[1])
|
|
|
if item[0] == 'custominputmidchance':
|
|
|
custominputmidchance = item[1]
|
|
|
if item[0] == 'minivomitmidchance':
|
|
|
minivomitmidchance = item[1]
|
|
|
|
|
|
if item[0] == 'outfitchance':
|
|
|
outfitchance = item[1]
|
|
|
if item[0] == 'posechance':
|
|
|
posechance = item[1]
|
|
|
if item[0] == 'hairchance':
|
|
|
hairchance = item[1]
|
|
|
if item[0] == 'accessorychance':
|
|
|
accessorychance = item[1]
|
|
|
if item[0] == 'humanoidinsideshotchance':
|
|
|
humanoidinsideshotchance = item[1]
|
|
|
if item[0] == 'humanoidbackgroundchance':
|
|
|
humanoidbackgroundchance = item[1]
|
|
|
|
|
|
if item[0] == 'landscapeminilocationchance':
|
|
|
landscapeminilocationchance = item[1]
|
|
|
if item[0] == 'generalminilocationchance':
|
|
|
generalminilocationchance = item[1]
|
|
|
|
|
|
if item[0] == 'timperiodchance':
|
|
|
timperiodchance = item[1]
|
|
|
if item[0] == 'focuschance':
|
|
|
focuschance = item[1]
|
|
|
if item[0] == 'directionchance':
|
|
|
directionchance = item[1]
|
|
|
if item[0] == 'moodchance':
|
|
|
moodchance = item[1]
|
|
|
if item[0] == 'minivomitsuffixchance':
|
|
|
minivomitsuffixchance = item[1]
|
|
|
if item[0] == 'artmovementchance':
|
|
|
artmovementchance = item[1]
|
|
|
if item[0] == 'lightingchance':
|
|
|
lightingchance = item[1]
|
|
|
if item[0] == 'photoadditionchance':
|
|
|
photoadditionchance = item[1]
|
|
|
if item[0] == 'lenschance':
|
|
|
lenschance = item[1]
|
|
|
if item[0] == 'colorschemechance':
|
|
|
colorschemechance = item[1]
|
|
|
if item[0] == 'vomit1chance':
|
|
|
vomit1chance = item[1]
|
|
|
if item[0] == 'vomit2chance':
|
|
|
vomit2chance = item[1]
|
|
|
if item[0] == 'greatworkchance':
|
|
|
greatworkchance = item[1]
|
|
|
if item[0] == 'poemlinechance':
|
|
|
poemlinechance = item[1]
|
|
|
if item[0] == 'songlinechance':
|
|
|
songlinechance = item[1]
|
|
|
if item[0] == 'quality1chance':
|
|
|
quality1chance = item[1]
|
|
|
if item[0] == 'quality2chance':
|
|
|
quality2chance = item[1]
|
|
|
|
|
|
if item[0] == 'customstyle1chance':
|
|
|
customstyle1chance = item[1]
|
|
|
if item[0] == 'customstyle2chance':
|
|
|
customstyle2chance = item[1]
|
|
|
|
|
|
if item[0] == 'custominputsuffixrepeats':
|
|
|
custominputsuffixrepeats = int(item[1])
|
|
|
if item[0] == 'custominputsuffixchance':
|
|
|
custominputsuffixchance = item[1]
|
|
|
|
|
|
if item[0] == 'artistsatbackchance':
|
|
|
artistsatbackchance = item[1]
|
|
|
|
|
|
|
|
|
generatevehicle = bool(vehiclelist) and generatevehicle
|
|
|
generateobject = bool(objectlist) and generateobject
|
|
|
generatefood = bool(foodlist) and generatefood
|
|
|
generatebuilding = bool(buildinglist) and generatebuilding
|
|
|
generatespace = bool(spacelist) and generatespace
|
|
|
generateflora = bool(floralist) and generateflora
|
|
|
generateobject = generatevehicle or generateobject or generatefood or generatebuilding or generatespace or generateflora
|
|
|
|
|
|
|
|
|
if(generatevehicle):
|
|
|
objectwildcardlist.append("-vehicle-")
|
|
|
hybridlist.append("-vehicle-")
|
|
|
addontolocationlist.append("-vehicle-")
|
|
|
|
|
|
if(generateobject):
|
|
|
objectwildcardlist.append("-object-")
|
|
|
hybridlist.append("-object-")
|
|
|
|
|
|
if(generatefood):
|
|
|
objectwildcardlist.append("-food-")
|
|
|
hybridlist.append("-food-")
|
|
|
|
|
|
if(generatespace):
|
|
|
objectwildcardlist.append("-space-")
|
|
|
hybridlist.append("-space-")
|
|
|
addontolocationlist.append("-space-")
|
|
|
|
|
|
if(generatebuilding):
|
|
|
objectwildcardlist.append("-building-")
|
|
|
hybridlist.append("-building-")
|
|
|
addontolocationlist.append("-building-")
|
|
|
addontolocationinsidelist.append("-building-")
|
|
|
|
|
|
if(generateflora):
|
|
|
objectwildcardlist.append("-flora-")
|
|
|
hybridlist.append("-flora-")
|
|
|
addontolocationlist.append("-flora-")
|
|
|
|
|
|
if(generateobject):
|
|
|
mainchooserlist.append("object")
|
|
|
|
|
|
generatefictionalcharacter = bool(fictionallist) and generatefictionalcharacter
|
|
|
generatenonfictionalcharacter = bool(nonfictionallist) and generatenonfictionalcharacter
|
|
|
generatehumanoids = bool(humanoidlist) and generatehumanoids
|
|
|
generatemanwoman = bool(manwomanlist) and generatemanwoman
|
|
|
generatemanwomanrelation = bool(manwomanrelationlist) and generatemanwomanrelation
|
|
|
generatemanwomanmultiple = bool(manwomanmultiplelist) and generatemanwomanmultiple
|
|
|
generatejob = bool(joblist) and generatejob
|
|
|
generatefirstnames = bool(firstnamelist) and generatefirstnames
|
|
|
generatehumanoid = generatefictionalcharacter or generatenonfictionalcharacter or generatehumanoids or generatemanwoman or generatejob or generatemanwomanrelation or generatefirstnames or generatemanwomanmultiple
|
|
|
|
|
|
|
|
|
if(generatefictionalcharacter):
|
|
|
humanoidsubjectchooserlist.append("fictional")
|
|
|
hybridlist.append("-fictional-")
|
|
|
hybridhumanlist.append("-fictional-")
|
|
|
|
|
|
if(generatefictionalcharacter):
|
|
|
humanoidsubjectchooserlist.append("non fictional")
|
|
|
hybridlist.append("-nonfictional-")
|
|
|
hybridhumanlist.append("-nonfictional-")
|
|
|
|
|
|
if(generatehumanoids):
|
|
|
humanoidsubjectchooserlist.append("humanoid")
|
|
|
hybridlist.append("-humanoid-")
|
|
|
hybridhumanlist.append("-humanoid-")
|
|
|
|
|
|
if(generatemanwoman):
|
|
|
humanoidsubjectchooserlist.append("human")
|
|
|
|
|
|
if(generatemanwomanrelation):
|
|
|
humanoidsubjectchooserlist.append("manwomanrelation")
|
|
|
|
|
|
if(generatemanwomanmultiple):
|
|
|
humanoidsubjectchooserlist.append("manwomanmultiple")
|
|
|
|
|
|
if(generatejob):
|
|
|
humanoidsubjectchooserlist.append("job")
|
|
|
|
|
|
if(generatehumanoid):
|
|
|
mainchooserlist.append("humanoid")
|
|
|
|
|
|
if(generatefirstnames):
|
|
|
humanoidsubjectchooserlist.append("firstname")
|
|
|
|
|
|
|
|
|
generateanimal = bool(animallist) and generateanimal
|
|
|
|
|
|
if(generateanimal):
|
|
|
mainchooserlist.append("animal")
|
|
|
hybridlist.append("-animal-")
|
|
|
|
|
|
generatelandscape = bool(locationlist) and generatelandscape
|
|
|
|
|
|
if(generatelandscape):
|
|
|
mainchooserlist.append("landscape")
|
|
|
addontolocationlist.append("-location-")
|
|
|
addontolocationinsidelist.append("-location-")
|
|
|
|
|
|
generateevent = bool(eventlist) and generateevent
|
|
|
generateconcepts = bool(conceptprefixlist) and bool(conceptsuffixlist) and generateconcepts
|
|
|
generatepoemline = bool(poemlinelist) and generatepoemline
|
|
|
generatesongline = bool(songlinelist) and generatesongline
|
|
|
generatecardname = bool(cardnamelist) and generatecardname
|
|
|
generateepisodetitle = bool(episodetitlelist) and generateepisodetitle
|
|
|
|
|
|
|
|
|
|
|
|
generateconcept = generateevent or generateconcepts or generatepoemline or generatesongline
|
|
|
|
|
|
if(generateevent):
|
|
|
eventsubjectchooserlist.append("event")
|
|
|
|
|
|
if(generateconcepts):
|
|
|
eventsubjectchooserlist.append("concept")
|
|
|
|
|
|
if(generatepoemline):
|
|
|
eventsubjectchooserlist.append("poemline")
|
|
|
|
|
|
if(generatesongline):
|
|
|
eventsubjectchooserlist.append("songline")
|
|
|
|
|
|
if(generatecardname):
|
|
|
eventsubjectchooserlist.append("cardname")
|
|
|
|
|
|
if(generateepisodetitle):
|
|
|
eventsubjectchooserlist.append("episodetitle")
|
|
|
|
|
|
if(generateconcept):
|
|
|
mainchooserlist.append("concept")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(random.randint(1,int(imagemodechance)) == 1 and imagetype == "all" and giventypeofimage == "" and onlyartists == False):
|
|
|
imagetype = random.choice(imagetypemodelist)
|
|
|
|
|
|
|
|
|
specialmode = False
|
|
|
templatemode = False
|
|
|
artblastermode = False
|
|
|
qualityvomitmode = False
|
|
|
uniqueartmode = False
|
|
|
colorcannonmode = False
|
|
|
photofantasymode = False
|
|
|
massivemadnessmode = False
|
|
|
onlysubjectmode = False
|
|
|
stylesmode = False
|
|
|
|
|
|
|
|
|
if(imagetype == "only templates mode"):
|
|
|
specialmode = True
|
|
|
templatemode = True
|
|
|
print("Running with a randomized template instead of a randomized prompt")
|
|
|
|
|
|
if(imagetype == "art blaster mode"):
|
|
|
specialmode = True
|
|
|
artblastermode = True
|
|
|
print("Running in art blaster mode")
|
|
|
|
|
|
if(imagetype == "unique art mode"):
|
|
|
specialmode = True
|
|
|
uniqueartmode = True
|
|
|
print("Running in unique art mode")
|
|
|
|
|
|
if(imagetype == "quality vomit mode"):
|
|
|
specialmode = True
|
|
|
qualityvomitmode = True
|
|
|
print("Running in quality vomit mode")
|
|
|
|
|
|
if(imagetype == "color cannon mode"):
|
|
|
specialmode = True
|
|
|
colorcannonmode = True
|
|
|
print("Running in color cannon mode")
|
|
|
|
|
|
if(imagetype == "photo fantasy mode"):
|
|
|
specialmode = True
|
|
|
photofantasymode = True
|
|
|
print("Running in photo fantasy mode")
|
|
|
|
|
|
if(imagetype == "massive madness mode"):
|
|
|
specialmode = True
|
|
|
massivemadnessmode = True
|
|
|
print("Running in massive madness mode")
|
|
|
print("Are you ready for this?")
|
|
|
|
|
|
if(imagetype == "subject only mode"):
|
|
|
specialmode = True
|
|
|
onlysubjectmode = True
|
|
|
print("Running in only subject mode")
|
|
|
|
|
|
if(imagetype == "fixed styles mode"):
|
|
|
specialmode = True
|
|
|
stylesmode = True
|
|
|
print("Running with a randomized style instead of a randomized prompt")
|
|
|
|
|
|
|
|
|
|
|
|
generatetype = not specialmode
|
|
|
generatesubject = not templatemode
|
|
|
|
|
|
|
|
|
generateartist = bool(artistlist) and not specialmode
|
|
|
generateoutfit = bool(outfitlist) and not templatemode
|
|
|
generatebodytype = bool(bodytypelist) and not templatemode
|
|
|
generateaccessorie = bool(accessorielist) and not specialmode
|
|
|
generateartmovement = bool(artmovementlist) and not specialmode
|
|
|
generatecamera = bool(cameralist) and not specialmode
|
|
|
generatecolorscheme = bool(colorschemelist) and not specialmode
|
|
|
generatedescriptors = bool(descriptorlist) and not templatemode
|
|
|
generatedirection = bool(directionlist) and not specialmode
|
|
|
generatefocus = bool(focuslist) and not specialmode
|
|
|
generatehairstyle = bool(hairstylelist) and not templatemode
|
|
|
generatelens = bool(lenslist) and not specialmode
|
|
|
generatelighting = bool(lightinglist) and not specialmode
|
|
|
generatemood = bool(moodlist) and not specialmode
|
|
|
generatepose = bool(poselist) and not templatemode
|
|
|
generatevomit = bool(vomitlist) and not specialmode
|
|
|
generatequality = bool(qualitylist) and not specialmode
|
|
|
generateshot = bool(shotsizelist) and not specialmode
|
|
|
generatetimeperiod = bool(timeperiodlist) and not specialmode
|
|
|
generateemoji = bool(emojilist) and not templatemode
|
|
|
generateface = bool(buildfacelist) and not specialmode
|
|
|
generatehumanexpression = bool(humanexpressionlist) and not specialmode
|
|
|
generatehumanvomit = bool(humanvomitlist) and not specialmode
|
|
|
|
|
|
|
|
|
generatebackground = bool(backgroundtypelist) and not specialmode
|
|
|
generateinsideshot = bool(insideshotlist) and not specialmode
|
|
|
generatephotoaddition = bool(photoadditionlist) and not specialmode
|
|
|
generatehairstyle = bool(buildhairlist) and not templatemode
|
|
|
generateoutfit = bool(buildoutfitlist) and not templatemode
|
|
|
generateobjectaddition = bool(objectadditionslist) and not templatemode
|
|
|
generatehumanaddition = bool(humanadditionlist) and not templatemode
|
|
|
generateanimaladdition = bool(animaladditionlist) and not templatemode
|
|
|
generateaccessories = bool(buildaccessorielist) and not templatemode
|
|
|
generategreatwork = bool(greatworklist) and not specialmode
|
|
|
generatepoemline = bool(poemlinelist) and not specialmode
|
|
|
generatesongline = bool(songlinelist) and not specialmode
|
|
|
generatecardname = bool(cardnamelist) and not specialmode
|
|
|
generateepisodetitle = bool(episodetitlelist) and not specialmode
|
|
|
|
|
|
generateminilocationaddition = bool(minilocationadditionslist) and not specialmode
|
|
|
generateminivomit = bool(minivomitlist) and not specialmode
|
|
|
generateimagetypequality = bool(imagetypequalitylist) and not specialmode and generateimagetypequality
|
|
|
generateoveralladdition = bool(overalladditionlist) and not specialmode
|
|
|
generateimagetype = bool(imagetypelist) and not specialmode and generateimagetype
|
|
|
|
|
|
|
|
|
|
|
|
givensubjectlist = []
|
|
|
|
|
|
if(givensubject != "" and smartsubject == True):
|
|
|
givensubject = givensubject.lower()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
givensubjectlist = split_prompt_to_words(givensubject)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in outfitlist] for word in givensubjectlist)
|
|
|
keywordslist = ["wearing","outfit", "dressed"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generateoutfit = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in bodytypelist] for word in givensubjectlist)
|
|
|
keywordslist = ["bodytype","body type","model"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generatebodytype = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in hairstylelist] for word in givensubjectlist)
|
|
|
keywordslist = ["hair","hairstyle"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generatehairstyle = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in descriptorlist] for word in givensubjectlist)
|
|
|
foundinlist2 = any(word.lower() in [item.lower() for item in culturelist] for word in givensubjectlist)
|
|
|
if(foundinlist == True or foundinlist2 == True):
|
|
|
generatedescriptors = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in locationlist] for word in givensubjectlist)
|
|
|
foundinlist2 = any(word.lower() in [item.lower() for item in buildinglist] for word in givensubjectlist)
|
|
|
keywordslist = ["location","background", "inside", "at the", "in a"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or foundinlist2 == True or keywordsinstring == True):
|
|
|
generatebackground = False
|
|
|
generateinsideshot = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in accessorielist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generateaccessorie = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in lenslist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generatelens = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in lightinglist] for word in givensubjectlist)
|
|
|
keywordslist = ["lighting"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generatelighting = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in moodlist] for word in givensubjectlist)
|
|
|
keywordslist = ["mood"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generatemood = False
|
|
|
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in poselist] for word in givensubjectlist)
|
|
|
keywordslist = ["pose", "posing"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generatepose = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in qualitylist] for word in givensubjectlist)
|
|
|
keywordslist = ["quality"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generatequality = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in shotsizelist] for word in givensubjectlist)
|
|
|
keywordslist = ["shot"]
|
|
|
keywordsinstring = any(word.lower() in givensubject.lower() for word in keywordslist)
|
|
|
if(foundinlist == True or keywordsinstring == True):
|
|
|
generateshot = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in timeperiodlist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generatetimeperiod = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in vomitlist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generatevomit = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in directionlist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generatedirection = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in focuslist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generatefocus = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in artmovementlist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generateartmovement = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in cameralist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generatecamera = False
|
|
|
|
|
|
|
|
|
foundinlist = any(word.lower() in [item.lower() for item in colorschemelist] for word in givensubjectlist)
|
|
|
if(foundinlist == True):
|
|
|
generatecolorscheme = False
|
|
|
|
|
|
|
|
|
|
|
|
subjectingivensubject = False
|
|
|
if("subject" in list(map(str.lower, givensubjectlist)) and smartsubject == True):
|
|
|
givensubjectpromptlist = givensubject.split("subject")
|
|
|
subjectingivensubject = True
|
|
|
|
|
|
completeprompt = ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
promptstocompound = int(promptcompounderlevel)
|
|
|
compoundcounter = 0
|
|
|
|
|
|
while compoundcounter < promptstocompound:
|
|
|
isphoto = 0
|
|
|
othertype = 0
|
|
|
humanspecial = 0
|
|
|
animaladdedsomething = 0
|
|
|
isweighted = 0
|
|
|
amountofimagetypes = 0
|
|
|
hybridorswap = ""
|
|
|
artistmode = "normal"
|
|
|
insideshot = 0
|
|
|
buildingfullmode = False
|
|
|
subjectchooser = ""
|
|
|
mainchooser = ""
|
|
|
|
|
|
completeprompt += prefixprompt
|
|
|
|
|
|
completeprompt += ", "
|
|
|
|
|
|
if(templatemode==True):
|
|
|
templatelist = csv_to_list("templates", antilist,"./csvfiles/templates/",1,";",True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
targettemplateenvironment = "all"
|
|
|
templateenvironmentsources = "all"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
templateprompts = [templateprompt[0] for templateprompt in templatelist if( (templateprompt[1] == targettemplateenvironment or targettemplateenvironment =="all") and (templateprompt[2] == templateenvironmentsources or templateenvironmentsources == "all") and (templateprompt[3] == forcesubject or forcesubject == "all") ) ]
|
|
|
templatepromptcreator = [templateprompt[1] for templateprompt in templatelist if( (templateprompt[1] == targettemplateenvironment or targettemplateenvironment =="all") and (templateprompt[2] == templateenvironmentsources or templateenvironmentsources == "all") and (templateprompt[3] == forcesubject or forcesubject == "all") ) ]
|
|
|
templatesubjects= [templateprompt[4] for templateprompt in templatelist if( (templateprompt[1] == targettemplateenvironment or targettemplateenvironment =="all") and (templateprompt[2] == templateenvironmentsources or templateenvironmentsources == "all") and (templateprompt[3] == forcesubject or forcesubject == "all") )]
|
|
|
|
|
|
|
|
|
chosentemplate = random.choice(templateprompts)
|
|
|
templateindex = templateprompts.index(chosentemplate)
|
|
|
|
|
|
print("Processing a prompt that was inspired from: " + templatepromptcreator[templateindex])
|
|
|
|
|
|
|
|
|
if(givensubject==""):
|
|
|
completeprompt += chosentemplate.replace("-subject-",templatesubjects[templateindex] )
|
|
|
elif(givensubject != "" and subjectingivensubject == False):
|
|
|
completeprompt += chosentemplate.replace("-subject-",givensubject )
|
|
|
elif(givensubject != "" and subjectingivensubject == True):
|
|
|
completeprompt += chosentemplate.replace("-subject-", givensubjectpromptlist[0] + " " + templatesubjects[templateindex] + " " + givensubjectpromptlist[1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i in range(custominputprefixrepeats):
|
|
|
if(chance_roll(insanitylevel, custominputprefixchance) and generatecustominputprefix == True):
|
|
|
completeprompt += random.choice(custominputprefixlist) + ", "
|
|
|
|
|
|
|
|
|
|
|
|
if(insanitylevel==0):
|
|
|
insanitylevel = random.randint(1, 10)
|
|
|
insanitylevel3 = int((insanitylevel/3) + 1.20)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
artiststylelistforchecking = ["popular", "3D", "anime" "art nouveau", "art deco", "character", "fantasy", "fashion", "manga", "photography","portrait","sci-fi"]
|
|
|
if((artiststyleselector in artiststylelistforchecking
|
|
|
or artists in artiststylelistforchecking)
|
|
|
and (forcesubject == "all" or forcesubject == "")):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(random.randint(0,6) > max(2,insanitylevel -2) and "concept" in mainchooserlist):
|
|
|
mainchooserlist.remove("concept")
|
|
|
if(random.randint(0,6) > max(2,insanitylevel -2) and "landscape" in mainchooserlist):
|
|
|
mainchooserlist.remove("landscape")
|
|
|
if(random.randint(0,6) > max(2,insanitylevel -2) and "object" in mainchooserlist):
|
|
|
mainchooserlist.remove("object")
|
|
|
if(random.randint(0,6) > max(2,insanitylevel -2) and "animal" in mainchooserlist):
|
|
|
mainchooserlist.remove("animal")
|
|
|
|
|
|
|
|
|
|
|
|
artiststylelistforchecking = ["architecture","bauhaus", "cityscape", "cinema", "cloudscape","impressionism", "installation", "landscape","magical realism", "nature", "romanticism","seascape", "space", "streetscape"]
|
|
|
|
|
|
if((artiststyleselector in artiststylelistforchecking
|
|
|
or artists in artiststylelistforchecking)
|
|
|
and (forcesubject == "all" or forcesubject == "")):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(random.randint(0,6) > max(2,insanitylevel -2) and "concept" in mainchooserlist):
|
|
|
mainchooserlist.remove("concept")
|
|
|
if(random.randint(0,6) > max(2,insanitylevel -2) and "animal" in mainchooserlist):
|
|
|
mainchooserlist.remove("animal")
|
|
|
if(random.randint(0,6) > max(2,insanitylevel -2) and "object" in mainchooserlist):
|
|
|
mainchooserlist.remove("object")
|
|
|
if(random.randint(0,8) > max(2,insanitylevel -2) and "humanoid" in mainchooserlist):
|
|
|
mainchooserlist.remove("humanoid")
|
|
|
|
|
|
|
|
|
|
|
|
mainchooser = random.choice(mainchooserlist)
|
|
|
|
|
|
if(forcesubject != "" and forcesubject != "all"):
|
|
|
mainchooser = forcesubject
|
|
|
|
|
|
if(mainchooser == "object"):
|
|
|
subjectchooser = "object"
|
|
|
if(mainchooser == "animal"):
|
|
|
|
|
|
if(random.randint(0,5) < 5):
|
|
|
subjectchooser = "animal"
|
|
|
else:
|
|
|
subjectchooser = "animal as human"
|
|
|
if(mainchooser == "humanoid"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
humanoidsubjectchooserlistbackup = humanoidsubjectchooserlist.copy()
|
|
|
if(random.randint(0,20) > max(2,insanitylevel -2) and "manwomanrelation" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("manwomanrelation")
|
|
|
if(random.randint(0,30) > max(2,insanitylevel -2) and "manwomanmultiple" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("manwomanmultiple")
|
|
|
if(random.randint(0,7) > max(2,insanitylevel -2) and "firstname" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("firstname")
|
|
|
if(random.randint(0,5) > max(2,insanitylevel -2) and "job" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("job")
|
|
|
if(random.randint(0,5) > max(2,insanitylevel -2) and "fictional" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("fictional")
|
|
|
if(random.randint(0,5) > max(2,insanitylevel -2) and "non fictional" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("non fictional")
|
|
|
if(random.randint(0,5) > max(2,insanitylevel -2) and "humanoid" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("humanoid")
|
|
|
|
|
|
if(random.randint(0,4) > max(2,insanitylevel -2) and "human" in humanoidsubjectchooserlist):
|
|
|
humanoidsubjectchooserlist.remove("human")
|
|
|
|
|
|
|
|
|
if(not bool(humanoidsubjectchooserlist)):
|
|
|
humanoidsubjectchooserlist = humanoidsubjectchooserlistbackup
|
|
|
|
|
|
subjectchooser = random.choice(humanoidsubjectchooserlist)
|
|
|
|
|
|
|
|
|
|
|
|
if(subtypehumanoid != "all"):
|
|
|
if(subtypehumanoid == "generic humans"):
|
|
|
subjectchooser = "human"
|
|
|
if(subtypehumanoid == "generic human relations"):
|
|
|
subjectchooser = "manwomanrelation"
|
|
|
if(subtypehumanoid == "multiple humans"):
|
|
|
subjectchooser = "manwomanmultiple"
|
|
|
if(subtypehumanoid == "celebrities e.a."):
|
|
|
subjectchooser = "non fictional"
|
|
|
if(subtypehumanoid == "fictional characters"):
|
|
|
subjectchooser = "fictional"
|
|
|
if(subtypehumanoid == "humanoids"):
|
|
|
subjectchooser = "humanoid"
|
|
|
if(subtypehumanoid == "based on job or title"):
|
|
|
subjectchooser = "job"
|
|
|
if(subtypehumanoid == "based on first name"):
|
|
|
subjectchooser = "firstname"
|
|
|
if(mainchooser == "landscape"):
|
|
|
subjectchooser = "landscape"
|
|
|
if(mainchooser == "concept"):
|
|
|
|
|
|
subjectchooser = random.choice(eventsubjectchooserlist)
|
|
|
if(subtypeconcept != "all"):
|
|
|
if(subtypeconcept == "event"):
|
|
|
subjectchooser = "event"
|
|
|
if(subtypeconcept == "the X of Y concepts"):
|
|
|
subjectchooser = "concept"
|
|
|
if(subtypeconcept == "lines from poems"):
|
|
|
subjectchooser = "poemline"
|
|
|
if(subtypeconcept == "lines from songs"):
|
|
|
subjectchooser = "songline"
|
|
|
if(subtypeconcept == "names from card based games"):
|
|
|
subjectchooser = "cardname"
|
|
|
if(subtypeconcept == "episode titles from tv shows"):
|
|
|
subjectchooser = "episodetitle"
|
|
|
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["manwomanmultiple"] and givensubject != "" and subtypehumanoid != "multiple humans"):
|
|
|
heshelist = ["they"]
|
|
|
hisherlist = ["their"]
|
|
|
himherlist = ["them"]
|
|
|
|
|
|
if(random.randint(0,20) == 0):
|
|
|
heshelist = ["one of them"]
|
|
|
hisherlist = ["one of their"]
|
|
|
himherlist = ["one of them"]
|
|
|
elif(subjectchooser in ["human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation","firstname","manwomanmultiple"]):
|
|
|
if(gender == "male"):
|
|
|
heshelist = ["he"]
|
|
|
hisherlist = ["his"]
|
|
|
himherlist = ["him"]
|
|
|
if(gender == "female"):
|
|
|
heshelist = ["she"]
|
|
|
hisherlist = ["her"]
|
|
|
himherlist = ["her"]
|
|
|
if(subjectchooser in ["manwomanmultiple"] and givensubject == ""):
|
|
|
heshelist = ["they"]
|
|
|
hisherlist = ["their"]
|
|
|
himherlist = ["them"]
|
|
|
|
|
|
if(random.randint(0,20) == 0):
|
|
|
heshelist = ["one of them"]
|
|
|
hisherlist = ["one of their"]
|
|
|
himherlist = ["one of them"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(artblastermode==True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(artistlist)):
|
|
|
completeprompt += "-artist-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(unique_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(unique_dist(insanitylevel) and bool(imagetypelist)):
|
|
|
completeprompt += "-imagetype-, "
|
|
|
if(unique_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(uniqueartmode==True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(othertypelist)):
|
|
|
completeprompt += "-othertype-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
if(rare_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(rare_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
if(unique_dist(insanitylevel) and bool(imagetypelist)):
|
|
|
completeprompt += "-imagetype-, "
|
|
|
if(unique_dist(insanitylevel) and bool(qualitylist)):
|
|
|
completeprompt += "-quality-, "
|
|
|
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(qualityvomitmode==True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(qualitylist)):
|
|
|
completeprompt += "-quality-, "
|
|
|
if(unique_dist(insanitylevel) and bool(minivomitlist)):
|
|
|
completeprompt += "-minivomit-, "
|
|
|
if(unique_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(unique_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(colorcannonmode == True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(moodlist)):
|
|
|
completeprompt += "-mood-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
if(rare_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(unique_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(unique_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(photofantasymode == True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
if(common_dist(insanitylevel)):
|
|
|
if(uncommon_dist(insanitylevel)):
|
|
|
completeprompt += "-imagetypequality- "
|
|
|
completeprompt += " photograph, "
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-photoaddition-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(cameralist)):
|
|
|
completeprompt += "-camera-, "
|
|
|
if(rare_dist(insanitylevel) and bool(lenslist)):
|
|
|
completeprompt += "-lens-, "
|
|
|
if(unique_dist(insanitylevel) and bool(moodlist)):
|
|
|
completeprompt += "-mood-, "
|
|
|
if(unique_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(massivemadnessmode == True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(rare_dist(insanitylevel) and bool(artistlist)):
|
|
|
completeprompt += "-artist-, "
|
|
|
if(rare_dist(insanitylevel) and bool(descriptorlist)):
|
|
|
completeprompt += "-descriptor-, "
|
|
|
if(rare_dist(insanitylevel) and bool(moodlist)):
|
|
|
completeprompt += "-mood-, "
|
|
|
if(rare_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
if(rare_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(rare_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(rare_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
if(rare_dist(insanitylevel) and bool(minilocationadditionslist)):
|
|
|
completeprompt += "-minilocationaddition-, "
|
|
|
if(rare_dist(insanitylevel) and bool(materiallist)):
|
|
|
completeprompt += "-material-, "
|
|
|
if(rare_dist(insanitylevel) and bool(conceptsuffixlist)):
|
|
|
completeprompt += "-conceptsuffix-, "
|
|
|
if(rare_dist(insanitylevel) and bool(qualitylist)):
|
|
|
completeprompt += "-quality-, "
|
|
|
if(rare_dist(insanitylevel) and bool(cameralist)):
|
|
|
completeprompt += "-camera-, "
|
|
|
if(rare_dist(insanitylevel) and bool(lenslist)):
|
|
|
completeprompt += "-lens-, "
|
|
|
if(rare_dist(insanitylevel) and bool(imagetypelist)):
|
|
|
completeprompt += "-imagetype-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(stylesmode == True):
|
|
|
chosenstyle = random.choice(styleslist)
|
|
|
chosenstyleprefix = chosenstyle.split("-subject-")[0]
|
|
|
chosenstylesuffix= chosenstyle.split("-subject-")[1]
|
|
|
completeprompt += chosenstyleprefix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
artistsplacement = "front"
|
|
|
|
|
|
if(random.randint(0, 2) == 0 and onlyartists == False):
|
|
|
artistlocations = ["back", "middle"]
|
|
|
artistsplacement = random.choice(artistlocations)
|
|
|
|
|
|
if(artists != "none" and artistsplacement == "front" and generateartist == True):
|
|
|
doartistnormal = True
|
|
|
if(artists == "greg mode"):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " -gregmode-, "
|
|
|
doartistnormal = False
|
|
|
|
|
|
elif(originalartistchoice == "all" and random.randint(0,3) == 0):
|
|
|
if(mainchooser in ["humanoid", "animal"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-portraitartist-;-characterartist-), OR(-portraitartist-;-characterartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
elif(mainchooser in ["landscape"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-landscapeartist-;-digitalartist-), OR(-landscapeartist-;-graphicdesignartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
elif(subjectchooser in ["building"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-landscapeartist-;-architectartist-), OR(-landscapeartist-;-architectartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
|
|
|
elif(random.randint(0,5) == 0):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-portraitartist-;-characterartist-;-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-), OR(-portraitartist-;-characterartist-;-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-) and OR(-portraitartist-;-characterartist-;-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-)"
|
|
|
doartistnormal = False
|
|
|
|
|
|
|
|
|
|
|
|
if(doartistnormal):
|
|
|
|
|
|
|
|
|
step = random.randint(0, 1)
|
|
|
minstep = step
|
|
|
end = random.randint(1, insanitylevel3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modeselector = random.randint(0,10)
|
|
|
if modeselector < 5 and end - step >= 2:
|
|
|
artistmodeslist = ["hybrid", "stopping", "adding", "switching", "enhancing"]
|
|
|
artistmode = artistmodeslist[modeselector]
|
|
|
if(advancedprompting == False):
|
|
|
artistmode = "normal"
|
|
|
if (artistmode in ["hybrid","switching"] and end - step == 1):
|
|
|
artistmode = "normal"
|
|
|
|
|
|
if(onlyartists == True and artistmode == "enhancing"):
|
|
|
artistmode = "normal"
|
|
|
|
|
|
if(len(artistlist) < 3):
|
|
|
artistmode = "normal"
|
|
|
if(onlyartists == True and step == end):
|
|
|
step = step - 1
|
|
|
|
|
|
if artistmode in ["hybrid", "stopping", "adding","switching"]:
|
|
|
completeprompt += " ["
|
|
|
|
|
|
while step < end:
|
|
|
if(normal_dist(insanitylevel)):
|
|
|
isweighted = 1
|
|
|
|
|
|
if isweighted == 1:
|
|
|
completeprompt += " ("
|
|
|
|
|
|
|
|
|
if(step == minstep):
|
|
|
|
|
|
if(giventypeofimage=="" and imagetype == "all" and random.randint(0, 1) == 0):
|
|
|
if(artiststyleselectormode == "normal"):
|
|
|
completeprompt += artiststyleselector + " art "
|
|
|
else:
|
|
|
completeprompt += "-artiststyle- art "
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
else:
|
|
|
artistbylist = [""]
|
|
|
completeprompt += random.choice(artistbylist) + " -artist-"
|
|
|
|
|
|
if isweighted == 1:
|
|
|
completeprompt += ":" + str(1 + (random.randint(-3,3)/10)) + ")"
|
|
|
|
|
|
if artistmode in ["hybrid"] and not end - step == 1:
|
|
|
completeprompt += "|"
|
|
|
if artistmode in ["switching"] and not end - step == 1:
|
|
|
completeprompt += ":"
|
|
|
|
|
|
if artistmode not in ["hybrid", "switching"]and not end - step > 1:
|
|
|
completeprompt += ","
|
|
|
elif artistmode not in ["hybrid", "switching"]and not end - step == 1:
|
|
|
completeprompt += " and "
|
|
|
|
|
|
isweighted = 0
|
|
|
|
|
|
step = step + 1
|
|
|
|
|
|
if artistmode in ["stopping"]:
|
|
|
completeprompt += "::"
|
|
|
completeprompt += str(random.randint(1,19))
|
|
|
|
|
|
if artistmode in ["switching","adding"]:
|
|
|
completeprompt += ":" + str(random.randint(1,18))
|
|
|
if artistmode in ["hybrid", "stopping","adding", "switching"]:
|
|
|
completeprompt += "] "
|
|
|
|
|
|
|
|
|
if(onlyartists == True):
|
|
|
|
|
|
completeprompt = parse_custom_functions(completeprompt, insanitylevel)
|
|
|
|
|
|
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-artist-", artistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-gregmode-", gregmodelist, False, False)
|
|
|
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-fantasyartist-", fantasyartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-popularartist-", popularartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-romanticismartist-", romanticismartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-photographyartist-", photographyartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-portraitartist-", portraitartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-characterartist-", characterartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-landscapeartist-", landscapeartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-scifiartist-", scifiartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-graphicdesignartist-", graphicdesignartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-digitalartist-", digitalartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-architectartist-", architectartistlist, False, False)
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, "-cinemaartist-", cinemaartistlist, False, False)
|
|
|
|
|
|
|
|
|
completeprompt = cleanup(completeprompt, advancedprompting, insanitylevel)
|
|
|
|
|
|
print("only generated these artists:" + completeprompt)
|
|
|
return completeprompt
|
|
|
|
|
|
|
|
|
completeprompt += ", "
|
|
|
|
|
|
|
|
|
|
|
|
if(giventypeofimage=="" and imagetype == "all" and random.randint(0, 2) == 0):
|
|
|
completeprompt += "-artiststyle- art, "
|
|
|
|
|
|
|
|
|
if artistmode in ["enhancing"]:
|
|
|
completeprompt += " ["
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(giventypeofimage=="" and generatetype == True):
|
|
|
if(imagetype != "all" and imagetype != "all - force multiple" and imagetype != "only other types"):
|
|
|
|
|
|
completeprompt += " " + imagetype + ", "
|
|
|
elif(imagetype == "all - force multiple" or unique_dist(insanitylevel)):
|
|
|
amountofimagetypes = random.randint(2,3)
|
|
|
elif(imagetype == "only other types"):
|
|
|
othertype = 1
|
|
|
completeprompt += random.choice(othertypelist)
|
|
|
|
|
|
if(imagetype == "all" and chance_roll(insanitylevel, imagetypechance) and amountofimagetypes <= 1):
|
|
|
amountofimagetypes = 1
|
|
|
|
|
|
|
|
|
|
|
|
for i in range(amountofimagetypes):
|
|
|
|
|
|
if((chance_roll(insanitylevel, imagetypequalitychance) or originalartistchoice == "greg mode") and generateimagetypequality):
|
|
|
completeprompt += "-imagetypequality- "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elif(random.randint(0,5) < 5):
|
|
|
completeprompt += " " + random.choice(imagetypelist) + ", "
|
|
|
else:
|
|
|
othertype = 1
|
|
|
completeprompt += " " + random.choice(othertypelist) + ", "
|
|
|
|
|
|
if(othertype==1):
|
|
|
completeprompt += " of a "
|
|
|
else:
|
|
|
completeprompt += ", "
|
|
|
elif(generatetype == True):
|
|
|
othertype = 1
|
|
|
completeprompt += giventypeofimage + " of a "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, minilocationadditionchance) and generateminilocationaddition == True):
|
|
|
completeprompt += " -minilocationaddition-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, artmovementprefixchance) and generateartmovement == True):
|
|
|
generateartmovement = False
|
|
|
completeprompt += " -artmovement-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, minivomitprefix1chance) and generateminivomit == True):
|
|
|
completeprompt += " -minivomit-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, minivomitprefix2chance) and generateminivomit == True):
|
|
|
completeprompt += " -minivomit-, "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(mainchooser in ["object", "animal", "humanoid", "concept"] and othertype == 0 and "portrait" not in completeprompt and generateshot == True and chance_roll(insanitylevel,shotsizechance)):
|
|
|
completeprompt += "-shotsize- of a "
|
|
|
elif("portrait" in completeprompt and generateshot == True):
|
|
|
completeprompt += " ,close up of a "
|
|
|
elif(mainchooser in ["landscape"] and generateshot == True):
|
|
|
completeprompt += " landscape of a "
|
|
|
elif(generateshot == True):
|
|
|
completeprompt += ", "
|
|
|
|
|
|
genjoboractivity = False
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt += " @ "
|
|
|
|
|
|
if(generatesubject == True):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(subjectingivensubject):
|
|
|
completeprompt += " " + givensubjectpromptlist[0] + " "
|
|
|
|
|
|
|
|
|
if(novel_dist(insanitylevel) and subjectchooser in ["animal", "animal as human,","human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation","firstname"]):
|
|
|
buildingfullmode = True
|
|
|
insideshot = 1
|
|
|
heshelist = ["they"]
|
|
|
hisherlist = ["their"]
|
|
|
himherlist = ["them"]
|
|
|
completeprompt += "a OR(-building-;-location-;-waterlocation-;-container-;rare) full of "
|
|
|
|
|
|
|
|
|
|
|
|
descriptorsintheback = random.randint(0,2)
|
|
|
if(descriptorsintheback < 2):
|
|
|
|
|
|
if(chance_roll(insanitylevel, subjectdescriptor1chance) and generatedescriptors == True):
|
|
|
if(subjectchooser in ["animal as human,","human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation", "manwomanmultiple","firstname"]):
|
|
|
completeprompt += "-humandescriptor- "
|
|
|
elif(mainchooser == "landscape"):
|
|
|
completeprompt += "-locationdescriptor- "
|
|
|
elif(mainchooser == "animal"):
|
|
|
completeprompt += "-animaldescriptor- "
|
|
|
else:
|
|
|
completeprompt += "-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 += "-humandescriptor- "
|
|
|
elif(mainchooser == "landscape"):
|
|
|
completeprompt += "-locationdescriptor- "
|
|
|
elif(mainchooser == "animal"):
|
|
|
completeprompt += "-animaldescriptor- "
|
|
|
else:
|
|
|
completeprompt += "-descriptor- "
|
|
|
|
|
|
|
|
|
if(mainchooser in ["animal", "object", "landscape", "concept"] and unique_dist(insanitylevel)):
|
|
|
completeprompt += " OR(-color-;-colorcombination-) "
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation", "manwomanmultiple","firstname"] and extraordinary_dist(insanitylevel)):
|
|
|
completeprompt += str(random.randint(20,99)) + " OR(y.o.;year old) "
|
|
|
|
|
|
if(subjectchooser in ["animal as human,","human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation", "manwomanmultiple","firstname"] and chance_roll(insanitylevel, subjectbodytypechance) and generatebodytype == True):
|
|
|
completeprompt += "-bodytype- "
|
|
|
|
|
|
if(subjectchooser in ["object","animal as human,","human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation", "manwomanmultiple","firstname"] and chance_roll(insanitylevel, subjectculturechance) and generatedescriptors == True):
|
|
|
completeprompt += "-culture- "
|
|
|
|
|
|
if(mainchooser == "object"):
|
|
|
|
|
|
completeprompt += " -objectstrengthstart-"
|
|
|
|
|
|
if(subtypeobject != "all"):
|
|
|
if(subtypeobject == "generic objects"):
|
|
|
objectwildcardlist = ["-object-"]
|
|
|
if(subtypeobject == "vehicles"):
|
|
|
objectwildcardlist = ["-vehicle-"]
|
|
|
if(subtypeobject == "food"):
|
|
|
objectwildcardlist = ["-food-"]
|
|
|
if(subtypeobject == "buildings"):
|
|
|
objectwildcardlist = ["-building-"]
|
|
|
if(subtypeobject == "space"):
|
|
|
objectwildcardlist = ["-space-"]
|
|
|
if(subtypeobject == "flora"):
|
|
|
objectwildcardlist = ["-flora-"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(givensubject == "" or (subjectingivensubject and givensubject != "")):
|
|
|
|
|
|
if(rare_dist(insanitylevel) and advancedprompting == True):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
completeprompt += "["
|
|
|
|
|
|
chosenobjectwildcard = random.choice(objectwildcardlist)
|
|
|
|
|
|
completeprompt += chosenobjectwildcard + " "
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
if(uncommon_dist(insanitylevel)):
|
|
|
completeprompt += "|" + random.choice(objectwildcardlist) + "] "
|
|
|
else:
|
|
|
completeprompt += "|"
|
|
|
completeprompt += chosenobjectwildcard + " "
|
|
|
completeprompt += "] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
if(uncommon_dist(insanitylevel)):
|
|
|
completeprompt += ":" + random.choice(objectwildcardlist) + ":" + str(random.randint(1,5)) + "] "
|
|
|
else:
|
|
|
completeprompt += ":"
|
|
|
completeprompt += chosenobjectwildcard + " "
|
|
|
completeprompt += ":" + str(random.randint(1,5)) + "] "
|
|
|
else:
|
|
|
completeprompt += " " + givensubject + " "
|
|
|
|
|
|
hybridorswap = ""
|
|
|
|
|
|
if(mainchooser == "animal"):
|
|
|
|
|
|
completeprompt += " -objectstrengthstart-"
|
|
|
|
|
|
|
|
|
if(givensubject == "" or (subjectingivensubject and givensubject != "")):
|
|
|
|
|
|
if(rare_dist(insanitylevel) and advancedprompting == True):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
completeprompt += "["
|
|
|
|
|
|
if(unique_dist(insanitylevel) and generateanimaladdition == True):
|
|
|
animaladdedsomething = 1
|
|
|
completeprompt += "-animaladdition- -animal- "
|
|
|
if(animaladdedsomething != 1):
|
|
|
completeprompt += "-animal- "
|
|
|
|
|
|
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
if(uncommon_dist(insanitylevel)):
|
|
|
completeprompt += "|" + random.choice(hybridlist) + "] "
|
|
|
else:
|
|
|
completeprompt += "| -animal- ] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
if(uncommon_dist(insanitylevel)):
|
|
|
completeprompt += ":" + random.choice(hybridlist) + ":" + str(random.randint(1,5)) + "] "
|
|
|
else:
|
|
|
completeprompt += ":-animal-:" + str(random.randint(1,5)) + "] "
|
|
|
else:
|
|
|
completeprompt += " " + givensubject + " "
|
|
|
|
|
|
hybridorswap = ""
|
|
|
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["animal as human","human","fictional", "non fictional", "humanoid", "manwomanrelation", "manwomanmultiple","firstname"] and chance_roll(insanitylevel, joboractivitychance) and humanspecial != 1 and generatesubject == True):
|
|
|
genjoboractivity = True
|
|
|
genjoboractivitylocationslist = ["front","middle", "middle","back","back", "back"]
|
|
|
genjoboractivitylocation = random.choice(genjoboractivitylocationslist)
|
|
|
|
|
|
|
|
|
if(genjoboractivity and genjoboractivitylocation=="front"):
|
|
|
completeprompt += "-job- "
|
|
|
|
|
|
|
|
|
|
|
|
if(mainchooser == "humanoid"):
|
|
|
|
|
|
completeprompt += " -objectstrengthstart-"
|
|
|
if(givensubject == "" or (subjectingivensubject and givensubject != "")):
|
|
|
|
|
|
if(subjectchooser == "human"):
|
|
|
completeprompt += "-manwoman-"
|
|
|
|
|
|
if(subjectchooser == "manwomanrelation"):
|
|
|
completeprompt += "-manwomanrelation-"
|
|
|
|
|
|
if(subjectchooser == "manwomanmultiple"):
|
|
|
completeprompt += "-manwomanmultiple-"
|
|
|
|
|
|
if(subjectchooser == "job"):
|
|
|
completeprompt += "-malefemale- "
|
|
|
completeprompt += "-job-"
|
|
|
|
|
|
if(subjectchooser == "fictional"):
|
|
|
if(rare_dist(insanitylevel) and advancedprompting == True and buildingfullmode == False):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
completeprompt += "["
|
|
|
|
|
|
|
|
|
if(novel_dist(insanitylevel)):
|
|
|
completeprompt += gender + " version of -oppositefictional-"
|
|
|
else:
|
|
|
completeprompt += "-fictional-"
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
completeprompt += "|" + random.choice(hybridhumanlist) + " ] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
completeprompt += ":" + random.choice(hybridhumanlist) + ":" + str(random.randint(1,5)) + "] "
|
|
|
hybridorswap = ""
|
|
|
|
|
|
if(subjectchooser == "non fictional"):
|
|
|
if(rare_dist(insanitylevel) and advancedprompting == True and buildingfullmode == False):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
completeprompt += "["
|
|
|
|
|
|
if(novel_dist(insanitylevel)):
|
|
|
completeprompt += gender + " version of -oppositenonfictional-"
|
|
|
else:
|
|
|
completeprompt += "-nonfictional-"
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
completeprompt += "|" + random.choice(hybridhumanlist) + "] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
completeprompt += ":" + random.choice(hybridhumanlist) + ":" + str(random.randint(1,5)) + "] "
|
|
|
hybridorswap = ""
|
|
|
|
|
|
if(subjectchooser == "humanoid"):
|
|
|
if(gender != "all"):
|
|
|
completeprompt += "-malefemale- "
|
|
|
if(rare_dist(insanitylevel) and advancedprompting == True and buildingfullmode == False):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
completeprompt += "["
|
|
|
|
|
|
completeprompt += "-humanoid-"
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
completeprompt += "|" + random.choice(hybridhumanlist) + "] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
completeprompt += ":" + random.choice(hybridhumanlist) + ":" + str(random.randint(1,5)) + "] "
|
|
|
hybridorswap = ""
|
|
|
|
|
|
if(subjectchooser == "firstname"):
|
|
|
if(rare_dist(insanitylevel) and advancedprompting == True and buildingfullmode == False):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
completeprompt += "["
|
|
|
|
|
|
completeprompt += "-firstname-"
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
completeprompt += "|" + "-firstname-" + "] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
completeprompt += ":" + "-firstname-" + ":" + str(random.randint(1,5)) + "] "
|
|
|
hybridorswap = ""
|
|
|
if(buildingfullmode == True):
|
|
|
completeprompt += "s"
|
|
|
completeprompt += " "
|
|
|
|
|
|
else:
|
|
|
if(subjectchooser == "manwomanmultiple" and subtypehumanoid != "multiple humans" and givensubject not in ["1girl", "1boy", "solo"]):
|
|
|
if(random.randint(0,1) == 1):
|
|
|
completeprompt += " " + givensubject + " and a -manwomanmultiple- "
|
|
|
else:
|
|
|
completeprompt += " a OR(group;couple;crowd;bunch) of " + givensubject + " "
|
|
|
else:
|
|
|
completeprompt += " " + givensubject + " "
|
|
|
|
|
|
|
|
|
|
|
|
if( (mainchooser == "humanoid" or mainchooser == "animal" or mainchooser == "object") and chance_roll(insanitylevel, subjectconceptsuffixchance)):
|
|
|
completeprompt += " of -conceptsuffix- "
|
|
|
|
|
|
if(mainchooser == "humanoid" or mainchooser == "animal" or mainchooser == "object"):
|
|
|
|
|
|
completeprompt += "-objectstrengthend-"
|
|
|
|
|
|
if(mainchooser == 'animal' and legendary_dist(insanitylevel)):
|
|
|
animaladdedsomething = 1
|
|
|
completeprompt += " -animalsuffixaddition- "
|
|
|
|
|
|
|
|
|
if(subjectchooser == "landscape"):
|
|
|
|
|
|
completeprompt += " -objectstrengthstart-"
|
|
|
|
|
|
|
|
|
if(givensubject == "" or (subjectingivensubject and givensubject != "")):
|
|
|
if(rare_dist(insanitylevel) and advancedprompting == True):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
completeprompt += "["
|
|
|
|
|
|
completeprompt += "-location- "
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
completeprompt += "|" + "-location-" + "] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
completeprompt += ":" + "-location-" + ":" + str(random.randint(1,5)) + "] "
|
|
|
else:
|
|
|
completeprompt += " " + givensubject + " "
|
|
|
|
|
|
hybridorswap = ""
|
|
|
|
|
|
|
|
|
completeprompt += "-objectstrengthend-"
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, subjectlandscapeaddonlocationchance) and insideshot == 0):
|
|
|
insideshot = 1
|
|
|
|
|
|
if(mainchooser=="humanoid" and legendary_dist(insanitylevel)):
|
|
|
completeprompt += " looking at a -addontolocationinside- "
|
|
|
elif(mainchooser=="humanoid" and legendary_dist(insanitylevel)):
|
|
|
completeprompt += " facing a -addontolocationinside- "
|
|
|
elif(legendary_dist(insanitylevel)):
|
|
|
completeprompt += " in the distance there is a -addontolocationinside- "
|
|
|
else:
|
|
|
completeprompt += " from inside of a -addontolocationinside- "
|
|
|
|
|
|
if(chance_roll(insanitylevel, subjectlandscapeaddonlocationchance) and insideshot == 0):
|
|
|
completeprompt += " and "
|
|
|
if(chance_roll(insanitylevel, subjectlandscapeaddonlocationdescriptorchance)):
|
|
|
completeprompt += "-locationdescriptor- "
|
|
|
if(chance_roll(insanitylevel, subjectlandscapeaddonlocationculturechance)):
|
|
|
completeprompt += "-culture- "
|
|
|
|
|
|
|
|
|
completeprompt += "-addontolocation- "
|
|
|
|
|
|
|
|
|
if(mainchooser == "concept"):
|
|
|
|
|
|
completeprompt += " -objectstrengthstart- "
|
|
|
if(givensubject == "" or (subjectingivensubject and givensubject != "")):
|
|
|
if(subjectchooser == "event"):
|
|
|
completeprompt += " \"" + random.choice(eventlist) + "\" "
|
|
|
|
|
|
if(subjectchooser == "concept"):
|
|
|
completeprompt += " \"The -conceptprefix- of -conceptsuffix-\" "
|
|
|
|
|
|
if(subjectchooser == "poemline"):
|
|
|
completeprompt += " \"-poemline-\" "
|
|
|
|
|
|
if(subjectchooser == "songline"):
|
|
|
completeprompt += " \"-songline-\" "
|
|
|
|
|
|
if(subjectchooser == "cardname"):
|
|
|
completeprompt += " \"-cardname-\" "
|
|
|
|
|
|
if(subjectchooser == "episodetitle"):
|
|
|
completeprompt += " \"-episodetitle-\" "
|
|
|
|
|
|
|
|
|
|
|
|
elif(givensubject != "" and subjectchooser == "concept" and subjectingivensubject == False):
|
|
|
if(random.randint(0,3) == 0):
|
|
|
completeprompt += " \"The -conceptprefix- of " + givensubject + "\" "
|
|
|
else:
|
|
|
completeprompt += " \"The " + givensubject + " of -conceptsuffix-\" "
|
|
|
else:
|
|
|
completeprompt += " " + givensubject + " "
|
|
|
|
|
|
|
|
|
completeprompt += " -objectstrengthend-"
|
|
|
|
|
|
if(subjectingivensubject):
|
|
|
completeprompt += " " + givensubjectpromptlist[1] + " "
|
|
|
|
|
|
if(genjoboractivity and genjoboractivitylocation=="middle"):
|
|
|
joboractivitylist = [joblist,humanactivitylist]
|
|
|
completeprompt += random.choice(random.choice(joboractivitylist)) + ", "
|
|
|
|
|
|
if(descriptorsintheback == 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):
|
|
|
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- "
|
|
|
elif(mainchooser == "animal"):
|
|
|
completeprompt += ", OR(;-heshe- is;normal) OR(;very;rare) -animaldescriptor- "
|
|
|
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- "
|
|
|
elif(mainchooser == "landscape"):
|
|
|
completeprompt += " and -locationdescriptor- "
|
|
|
elif(mainchooser == "animal"):
|
|
|
completeprompt += " and -animaldescriptor- "
|
|
|
else:
|
|
|
completeprompt += " and -descriptor- "
|
|
|
completeprompt += ", "
|
|
|
|
|
|
|
|
|
for i in range(objectadditionsrepeats):
|
|
|
if(mainchooser == "object" and chance_roll(insanitylevel, objectadditionschance) and generateobjectaddition == True):
|
|
|
completeprompt += ", -objectaddition- , "
|
|
|
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["animal as human,","human","fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple","firstname"] and chance_roll(insanitylevel, humanadditionchance) and generatehumanaddition == True):
|
|
|
humanspecial = 1
|
|
|
completeprompt += "-humanaddition- "
|
|
|
|
|
|
completeprompt += ", "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, overalladditionchance) and generateoveralladdition == True):
|
|
|
completeprompt += "-overalladdition- "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["animal as human,","human","fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple","firstname"] and chance_roll(insanitylevel, emojichance) and generateemoji== True):
|
|
|
completeprompt += "-emoji-, "
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["animal as human,","human","fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple","firstname"] and chance_roll(insanitylevel, humanexpressionchance) and generatehumanexpression== True):
|
|
|
completeprompt += "-humanexpression-, "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(genjoboractivity and genjoboractivitylocation=="back"):
|
|
|
joboractivitylist = [joblist,humanactivitylist]
|
|
|
completeprompt += ", " + random.choice(random.choice(joboractivitylist)) + ", "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["human", "humanoid", "manwomanrelation","firstname"] and chance_roll(insanitylevel, buildfacechance) and generateface== True):
|
|
|
completeprompt += random.choice(buildfacelist) + ", "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for i in range(custominputmidrepeats):
|
|
|
if(chance_roll(insanitylevel, custominputmidchance) and generatecustominputmid == True):
|
|
|
completeprompt += random.choice(custominputmidlist) + ", "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, minivomitmidchance) and generateminivomit == True):
|
|
|
completeprompt += " -minivomit-, "
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["animal as human","human","fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple", "firstname"] and chance_roll(insanitylevel, outfitchance) and generateoutfit == True and humanspecial != 1):
|
|
|
completeprompt += " " + random.choice(buildoutfitlist) + ", "
|
|
|
if(extraordinary_dist(insanitylevel)):
|
|
|
completeprompt += " -outfitvomit-, "
|
|
|
elif(overrideoutfit != "" and imagetype != "only templates mode"):
|
|
|
completeprompt += " " + random.choice(buildoutfitlist) + ", "
|
|
|
if(extraordinary_dist(insanitylevel)):
|
|
|
completeprompt += " -outfitvomit-, "
|
|
|
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["animal as human","human","fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple", "firstname"] and chance_roll(insanitylevel, posechance) and humanspecial != 1 and generatepose == True):
|
|
|
completeprompt += random.choice(poselist) + ", "
|
|
|
|
|
|
if(subjectchooser in ["human","job","fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple", "firstname"] and chance_roll(insanitylevel, hairchance) and generatehairstyle == True):
|
|
|
completeprompt += random.choice(buildhairlist) + ", "
|
|
|
if(unique_dist(insanitylevel)):
|
|
|
completeprompt += " -hairvomit-, "
|
|
|
|
|
|
if(subjectchooser in ["animal as human,","human","fictional", "non fictional", "humanoid", "manwomanrelation","manwomanmultiple", "firstname"] and chance_roll(insanitylevel, accessorychance) and generateaccessorie == True and generateaccessories == True):
|
|
|
completeprompt += random.choice(buildaccessorielist) + ", "
|
|
|
|
|
|
if(chance_roll(insanitylevel, humanoidinsideshotchance) and subjectchooser not in ["landscape", "concept"] and generateinsideshot == True):
|
|
|
insideshot = 1
|
|
|
completeprompt += random.choice(insideshotlist) + ", "
|
|
|
|
|
|
if(subjectchooser not in ["landscape", "concept"] and humanspecial != 1 and insideshot == 0 and chance_roll(insanitylevel, humanoidbackgroundchance) and generatebackground == True):
|
|
|
completeprompt += random.choice(backgroundtypelist) + ", "
|
|
|
|
|
|
|
|
|
if(subjectchooser in ["landscape"] and chance_roll(insanitylevel, landscapeminilocationchance) and generateminilocationaddition == True):
|
|
|
completeprompt += " -minilocationaddition-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, generalminilocationchance) and generateminilocationaddition == True):
|
|
|
completeprompt += " -minilocationaddition-, "
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt += " @ "
|
|
|
|
|
|
|
|
|
|
|
|
if(originalartistchoice == "greg mode" and generatequality == True):
|
|
|
completeprompt += "-quality-, "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, timperiodchance) or subjectchooser=="landscape"):
|
|
|
if(generatetimeperiod == True):
|
|
|
completeprompt += "-timeperiod-, "
|
|
|
|
|
|
if(mainchooser not in ["landscape"] and chance_roll(insanitylevel, focuschance) and generatefocus == True):
|
|
|
completeprompt += "-focus-, "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(artists != "none" and artistsplacement == "middle" and generateartist == True):
|
|
|
completeprompt += ", "
|
|
|
doartistnormal = True
|
|
|
if(artists == "greg mode"):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " -gregmode-, "
|
|
|
doartistnormal = False
|
|
|
|
|
|
|
|
|
elif(originalartistchoice == "all" and random.randint(0,3) == 0):
|
|
|
if(mainchooser in ["humanoid", "animal"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-portraitartist-;-characterartist-), OR(-portraitartist-;-characterartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
elif(mainchooser in ["landscape"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-landscapeartist-;-digitalartist-), OR(-landscapeartist-;-graphicdesignartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
elif(subjectchooser in ["building"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-landscapeartist-;-architectartist-), OR(-landscapeartist-;-architectartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
if(doartistnormal):
|
|
|
|
|
|
|
|
|
if(giventypeofimage=="" and imagetype == "all" and random.randint(0, 2) == 0):
|
|
|
completeprompt += "-artiststyle- art, "
|
|
|
|
|
|
|
|
|
step = random.randint(0, 1)
|
|
|
minstep = step
|
|
|
end = random.randint(1, insanitylevel3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modeselector = random.randint(0,10)
|
|
|
if modeselector < 4 and end - step >= 2:
|
|
|
artistmodeslist = ["hybrid", "stopping", "adding", "switching"]
|
|
|
artistmode = artistmodeslist[modeselector]
|
|
|
if(advancedprompting == False):
|
|
|
artistmode = "normal"
|
|
|
if artistmode in ["hybrid","switching"] and end - step == 1:
|
|
|
artistmode = "normal"
|
|
|
|
|
|
if(len(artistlist) < 3):
|
|
|
artistmode = "normal"
|
|
|
|
|
|
if artistmode in ["hybrid", "stopping", "adding","switching"]:
|
|
|
completeprompt += " ["
|
|
|
|
|
|
while step < end:
|
|
|
if(normal_dist(insanitylevel)):
|
|
|
isweighted = 1
|
|
|
|
|
|
if isweighted == 1:
|
|
|
completeprompt += " ("
|
|
|
|
|
|
|
|
|
if(step == minstep):
|
|
|
|
|
|
if(giventypeofimage=="" and imagetype == "all" and random.randint(0, 1) == 0):
|
|
|
if(artiststyleselectormode == "normal"):
|
|
|
completeprompt += artiststyleselector + " art "
|
|
|
else:
|
|
|
completeprompt += "-artiststyle- art "
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
else:
|
|
|
artistbylist = [""]
|
|
|
completeprompt += random.choice(artistbylist) + " -artist-"
|
|
|
|
|
|
if isweighted == 1:
|
|
|
completeprompt += ":" + str(1 + (random.randint(-3,3)/10)) + ")"
|
|
|
|
|
|
if artistmode in ["hybrid"] and not end - step == 1:
|
|
|
completeprompt += "|"
|
|
|
if artistmode in ["switching"] and not end - step == 1:
|
|
|
completeprompt += ":"
|
|
|
|
|
|
if artistmode not in ["hybrid", "switching"]and not end - step == 1:
|
|
|
completeprompt += ","
|
|
|
|
|
|
isweighted = 0
|
|
|
|
|
|
step = step + 1
|
|
|
|
|
|
if artistmode in ["stopping"]:
|
|
|
completeprompt += "::"
|
|
|
completeprompt += str(random.randint(1,19))
|
|
|
|
|
|
if artistmode in ["switching","adding"]:
|
|
|
completeprompt += ":" + str(random.randint(1,18))
|
|
|
if artistmode in ["hybrid", "stopping","adding", "switching"]:
|
|
|
completeprompt += "] "
|
|
|
|
|
|
completeprompt += ", "
|
|
|
|
|
|
|
|
|
|
|
|
if(originalartistchoice == "greg mode" and generatequality == True):
|
|
|
completeprompt += "-quality-, "
|
|
|
|
|
|
|
|
|
if(chance_roll(max(1,insanitylevel -1), directionchance) and generatedirection == True):
|
|
|
completeprompt += "-direction-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, moodchance) and generatemood == True):
|
|
|
completeprompt += "-mood-, "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, minivomitsuffixchance) and generateminivomit == True):
|
|
|
completeprompt += " -minivomit-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, artmovementchance) and generateartmovement == True):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, lightingchance) and generatelighting == True):
|
|
|
completeprompt += "-lighting-, "
|
|
|
|
|
|
|
|
|
if("photo" in completeprompt.lower()):
|
|
|
isphoto = 1
|
|
|
|
|
|
if(chance_roll(insanitylevel, photoadditionchance) and isphoto == 1 and generatephotoaddition == True):
|
|
|
completeprompt += random.choice(photoadditionlist) + ", "
|
|
|
|
|
|
if(isphoto == 1 and generatecamera == True):
|
|
|
completeprompt += "-camera-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, lenschance) or isphoto == 1):
|
|
|
if(generatelens == True):
|
|
|
completeprompt += "-lens-, "
|
|
|
|
|
|
if(chance_roll(insanitylevel, colorschemechance) and generatecolorscheme == True):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, vomit1chance) and generatevomit == True):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(chance_roll(insanitylevel, vomit2chance)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
|
|
|
|
|
|
if(mainchooser == "humanoid" and chance_roll(insanitylevel, humanvomitchance) and generatehumanvomit == True):
|
|
|
completeprompt += "-humanvomit-, "
|
|
|
if(chance_roll(insanitylevel, humanvomitchance)):
|
|
|
completeprompt += "-humanvomit-, "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, greatworkchance) and generategreatwork == True):
|
|
|
completeprompt += " in the style of -greatwork-, "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, poemlinechance) and generatepoemline == True):
|
|
|
completeprompt += " \"-poemline-\", "
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, songlinechance) and generatesongline == True):
|
|
|
completeprompt += " \"-songline-\", "
|
|
|
|
|
|
|
|
|
if((chance_roll(insanitylevel, quality1chance) or originalartistchoice == "greg mode") and generatequality == True):
|
|
|
completeprompt += "-quality-, "
|
|
|
if((chance_roll(insanitylevel, quality2chance) or originalartistchoice == "greg mode")):
|
|
|
completeprompt += "-quality-, "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(artblastermode==True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(artistlist)):
|
|
|
completeprompt += "-artist-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(unique_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(unique_dist(insanitylevel) and bool(imagetypelist)):
|
|
|
completeprompt += "-imagetype-, "
|
|
|
if(unique_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(uniqueartmode==True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
if(rare_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(rare_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
if(unique_dist(insanitylevel) and bool(qualitylist)):
|
|
|
completeprompt += "-quality-, "
|
|
|
if(unique_dist(insanitylevel) and bool(artistlist)):
|
|
|
completeprompt += "-artist-, "
|
|
|
if(novel_dist(insanitylevel) and bool(greatworklist)):
|
|
|
completeprompt += "in style of -greatwork-, "
|
|
|
if(novel_dist(insanitylevel) and bool(poemlinelist)):
|
|
|
completeprompt += "\"-poemline-\", "
|
|
|
if(novel_dist(insanitylevel) and bool(songlinelist)):
|
|
|
completeprompt += "\"-songline-\", "
|
|
|
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
|
|
|
if(qualityvomitmode==True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(qualitylist)):
|
|
|
completeprompt += "-quality-, "
|
|
|
if(unique_dist(insanitylevel) and bool(minivomitlist)):
|
|
|
completeprompt += "-minivomit-, "
|
|
|
if(unique_dist(insanitylevel) and bool(artmovementlist)) :
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(unique_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(colorcannonmode == True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(moodlist)):
|
|
|
completeprompt += "-mood-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
if(rare_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(unique_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(unique_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
|
|
|
if(photofantasymode == True):
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(uncommon_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
if(uncommon_dist(insanitylevel) and bool(cameralist)):
|
|
|
completeprompt += "-camera-, "
|
|
|
if(rare_dist(insanitylevel) and bool(lenslist)):
|
|
|
completeprompt += "-lens-, "
|
|
|
if(unique_dist(insanitylevel) and bool(moodlist)):
|
|
|
completeprompt += "-mood-, "
|
|
|
if(unique_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(massivemadnessmode == True):
|
|
|
completeprompt += ", "
|
|
|
step = 0
|
|
|
end = random.randint(1, insanitylevel) + 1
|
|
|
while step < end:
|
|
|
if(rare_dist(insanitylevel) and bool(artistlist)):
|
|
|
completeprompt += "-artist-, "
|
|
|
if(rare_dist(insanitylevel) and bool(descriptorlist)):
|
|
|
completeprompt += "-descriptor-, "
|
|
|
if(rare_dist(insanitylevel) and bool(moodlist)):
|
|
|
completeprompt += "-mood-, "
|
|
|
if(rare_dist(insanitylevel) and bool(colorschemelist)):
|
|
|
completeprompt += "-colorscheme-, "
|
|
|
if(rare_dist(insanitylevel) and bool(vomitlist)):
|
|
|
completeprompt += "-vomit-, "
|
|
|
if(rare_dist(insanitylevel) and bool(artmovementlist)):
|
|
|
completeprompt += "-artmovement-, "
|
|
|
if(rare_dist(insanitylevel) and bool(lightinglist)):
|
|
|
completeprompt += "-lighting-, "
|
|
|
if(rare_dist(insanitylevel) and bool(minilocationadditionslist)):
|
|
|
completeprompt += "-minilocationaddition-, "
|
|
|
if(rare_dist(insanitylevel) and bool(materiallist)):
|
|
|
completeprompt += "-material-, "
|
|
|
if(rare_dist(insanitylevel) and bool(conceptsuffixlist)):
|
|
|
completeprompt += "-conceptsuffix-, "
|
|
|
if(rare_dist(insanitylevel) and bool(qualitylist)):
|
|
|
completeprompt += "-quality-, "
|
|
|
if(rare_dist(insanitylevel) and bool(cameralist)):
|
|
|
completeprompt += "-camera-, "
|
|
|
step = step + 1
|
|
|
|
|
|
|
|
|
if(stylesmode == True):
|
|
|
completeprompt += chosenstylesuffix
|
|
|
|
|
|
|
|
|
|
|
|
if(chance_roll(insanitylevel, customstyle1chance) and generatestyle == True):
|
|
|
completeprompt += "-styletilora-, "
|
|
|
if(chance_roll(insanitylevel, customstyle2chance)):
|
|
|
completeprompt += "-styletilora-, "
|
|
|
|
|
|
|
|
|
|
|
|
for i in range(custominputsuffixrepeats):
|
|
|
if(chance_roll(insanitylevel, custominputsuffixchance) and generatecustominputsuffix == True):
|
|
|
completeprompt += random.choice(custominputsuffixlist) + ", "
|
|
|
|
|
|
|
|
|
|
|
|
if artistmode in ["enhancing"]:
|
|
|
completeprompt += "::" + str(random.randint(1,17)) + "] "
|
|
|
|
|
|
|
|
|
|
|
|
if(artists != "none" and artistsplacement == "back" and generateartist == True):
|
|
|
completeprompt += ", "
|
|
|
doartistnormal = True
|
|
|
if(artists == "greg mode"):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " -gregmode- ,"
|
|
|
doartistnormal = False
|
|
|
|
|
|
|
|
|
elif(originalartistchoice == "all" and random.randint(0,3) == 0):
|
|
|
if(mainchooser in ["humanoid", "animal"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-portraitartist-;-characterartist-), OR(-portraitartist-;-characterartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
elif(mainchooser in ["landscape"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-landscapeartist-;-digitalartist-), OR(-landscapeartist-;-graphicdesignartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
elif(subjectchooser in ["building"]):
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
completeprompt += random.choice(artistbylist) + " OR(-landscapeartist-;-architectartist-), OR(-landscapeartist-;-architectartist-) OR(;and OR(-fantasyartist-;-scifiartist-;-photographyartist-;-digitalartist-;-graphicdesignartist-);uncommon), "
|
|
|
doartistnormal = False
|
|
|
|
|
|
if(doartistnormal):
|
|
|
|
|
|
step = random.randint(0, 1)
|
|
|
minstep = step
|
|
|
end = random.randint(1, insanitylevel3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modeselector = random.randint(0,10)
|
|
|
if modeselector < 4 and end - step >= 2:
|
|
|
artistmodeslist = ["hybrid", "stopping", "adding", "switching"]
|
|
|
artistmode = artistmodeslist[modeselector]
|
|
|
if(advancedprompting == False):
|
|
|
artistmode = "normal"
|
|
|
if artistmode in ["hybrid","switching"] and end - step == 1:
|
|
|
artistmode = "normal"
|
|
|
|
|
|
if(len(artistlist) < 3):
|
|
|
artistmode = "normal"
|
|
|
|
|
|
if artistmode in ["hybrid", "stopping", "adding","switching"]:
|
|
|
completeprompt += " ["
|
|
|
|
|
|
while step < end:
|
|
|
if(normal_dist(insanitylevel)):
|
|
|
isweighted = 1
|
|
|
|
|
|
if isweighted == 1:
|
|
|
completeprompt += " ("
|
|
|
|
|
|
|
|
|
if(step == minstep):
|
|
|
|
|
|
if(giventypeofimage=="" and imagetype == "all" and random.randint(0, 1) == 0):
|
|
|
if(artiststyleselectormode == "normal"):
|
|
|
completeprompt += artiststyleselector + " art "
|
|
|
else:
|
|
|
completeprompt += "-artiststyle- art "
|
|
|
artistbylist = ["art by", "designed by", "stylized by", "by"]
|
|
|
else:
|
|
|
artistbylist = [""]
|
|
|
completeprompt += random.choice(artistbylist) + " -artist-"
|
|
|
|
|
|
if isweighted == 1:
|
|
|
completeprompt += ":" + str(1 + (random.randint(-3,3)/10)) + ")"
|
|
|
|
|
|
if artistmode in ["hybrid"] and not end - step == 1:
|
|
|
completeprompt += "|"
|
|
|
if artistmode in ["switching"] and not end - step == 1:
|
|
|
completeprompt += ":"
|
|
|
|
|
|
if artistmode not in ["hybrid", "switching"]and not end - step == 1:
|
|
|
completeprompt += ","
|
|
|
|
|
|
isweighted = 0
|
|
|
|
|
|
step = step + 1
|
|
|
|
|
|
if artistmode in ["stopping"]:
|
|
|
completeprompt += "::"
|
|
|
completeprompt += str(random.randint(1,19))
|
|
|
|
|
|
if artistmode in ["switching","adding"]:
|
|
|
completeprompt += ":" + str(random.randint(1,18))
|
|
|
if artistmode in ["hybrid", "stopping","adding", "switching"]:
|
|
|
completeprompt += "] "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt += ", "
|
|
|
completeprompt += suffixprompt
|
|
|
|
|
|
|
|
|
compoundcounter += 1
|
|
|
|
|
|
|
|
|
if(compoundcounter < promptstocompound):
|
|
|
if(seperator == "comma"):
|
|
|
completeprompt += " \n , "
|
|
|
else:
|
|
|
completeprompt += " \n " + seperator + " "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt = parse_custom_functions(completeprompt, insanitylevel)
|
|
|
|
|
|
|
|
|
|
|
|
if(mainchooser == "humanoid" and (givensubject == "" or subjectingivensubject and givensubject != "") and subjectchooser != "manwomanmultiple"):
|
|
|
samehumanreplacementlist = ["-heshe-","-heshe-","-heshe-","-heshe-","-heshe-", "-samehumansubject-", "-samehumansubject-", "-samehumansubject-", "-samehumansubject-", "-samehumansubject-"]
|
|
|
random.shuffle(samehumanreplacementlist)
|
|
|
|
|
|
|
|
|
completeprompt_list = list(completeprompt)
|
|
|
|
|
|
for i in range(len(completeprompt_list) - len("-heshe-") + 1):
|
|
|
if "".join(completeprompt_list[i:i+len("-heshe-")]) == "-heshe-":
|
|
|
|
|
|
replacement = samehumanreplacementlist.pop()
|
|
|
completeprompt_list[i:i+len("-heshe-")] = replacement
|
|
|
|
|
|
|
|
|
completeprompt = "".join(completeprompt_list)
|
|
|
|
|
|
|
|
|
if(mainchooser in ["animal", "object"] and (givensubject == "" or subjectingivensubject and givensubject != "")):
|
|
|
sameobjectreplacementlist = ["-heshe-","-heshe-","-heshe-","-heshe-","-heshe-", "-sameothersubject-", "-sameothersubject-", "-sameothersubject-", "-sameothersubject-", "-sameothersubject-"]
|
|
|
random.shuffle(sameobjectreplacementlist)
|
|
|
|
|
|
completeprompt_list = list(completeprompt)
|
|
|
|
|
|
|
|
|
for i in range(len(completeprompt_list) - len("-heshe-") + 1):
|
|
|
if "".join(completeprompt_list[i:i+len("-heshe-")]) == "-heshe-":
|
|
|
|
|
|
replacement = sameobjectreplacementlist.pop()
|
|
|
completeprompt_list[i:i+len("-heshe-")] = replacement
|
|
|
|
|
|
completeprompt = "".join(completeprompt_list)
|
|
|
|
|
|
|
|
|
if(rare_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-hairdescriptor-", "-descriptor-")
|
|
|
|
|
|
|
|
|
if(rare_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-humandescriptor-", "-descriptor-")
|
|
|
|
|
|
|
|
|
if(rare_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-locationdescriptor-", "-descriptor-")
|
|
|
|
|
|
|
|
|
if(rare_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-animaldescriptor-", "-descriptor-")
|
|
|
|
|
|
|
|
|
|
|
|
if(unique_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-culture-", "traditional -culture-")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(unique_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-outfit-", "-minioutfit-",1)
|
|
|
if(rare_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-outfitdescriptor-", "-descriptor-")
|
|
|
|
|
|
if(overrideoutfit != ""):
|
|
|
completeprompt = completeprompt.replace("-sameoutfit-", overrideoutfit)
|
|
|
completeprompt = completeprompt.replace("-outfit-", overrideoutfit,1)
|
|
|
completeprompt = completeprompt.replace("-minioutfit-", overrideoutfit,1)
|
|
|
completeprompt = completeprompt.replace("-overrideoutfit-", overrideoutfit)
|
|
|
|
|
|
if(givensubject != "" and subjectingivensubject == False):
|
|
|
completeprompt = completeprompt.replace("-samehumansubject-", givensubject)
|
|
|
completeprompt = completeprompt.replace("-sameothersubject-", givensubject)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt = completeprompt.replace("-overrideoutfit-", "")
|
|
|
|
|
|
|
|
|
if(insanitylevel > 7 and unique_dist(insanitylevel)):
|
|
|
completeprompt = completeprompt.replace("-descriptor-", "-artmovement-",1)
|
|
|
|
|
|
|
|
|
if(random.randint(0,insanitylevel) == 0 and insanitylevel < 5):
|
|
|
completeprompt = completeprompt.replace("-locationdescriptor-", "-basicbitchdescriptor-")
|
|
|
completeprompt = completeprompt.replace("-humandescriptor-", "-basicbitchdescriptor-")
|
|
|
completeprompt = completeprompt.replace("-outfitdescriptor-", "-basicbitchdescriptor-")
|
|
|
completeprompt = completeprompt.replace("-descriptor-", "-basicbitchdescriptor-")
|
|
|
completeprompt = completeprompt.replace("-animaldescriptor-", "-basicbitchdescriptor-")
|
|
|
|
|
|
|
|
|
if(random.randint(0,max(0, insanitylevel - 2)) <= 0):
|
|
|
completeprompt = completeprompt.replace("-color- and -color-", "-colorcombination-")
|
|
|
|
|
|
colorreplacementlist = ["-color-","-color-","-color-","-colorcombination-","-colorcombination-", "-colorcombination-", "-colorcombination-", "-colorcombination-", "-colorcombination-", "-colorcombination-"]
|
|
|
random.shuffle(colorreplacementlist)
|
|
|
|
|
|
|
|
|
completeprompt_list = list(completeprompt)
|
|
|
|
|
|
for i in range(len(completeprompt_list) - len("-color-") + 1):
|
|
|
if "".join(completeprompt_list[i:i+len("-color-")]) == "-color-":
|
|
|
|
|
|
replacement = colorreplacementlist.pop()
|
|
|
completeprompt_list[i:i+len("-color-")] = replacement
|
|
|
|
|
|
|
|
|
completeprompt = "".join(completeprompt_list)
|
|
|
|
|
|
|
|
|
|
|
|
if(random.randint(0,max(0, insanitylevel - 4)) <= 0):
|
|
|
completeprompt = completeprompt.replace("-material- and -material-", "-materialcombination-")
|
|
|
|
|
|
materialreplacementlist = ["-material-","-material-","-material-","-materialcombination-","-materialcombination-", "-materialcombination-", "-materialcombination-", "-materialcombination-", "-materialcombination-", "-materialcombination-"]
|
|
|
random.shuffle(materialreplacementlist)
|
|
|
|
|
|
|
|
|
completeprompt_list = list(completeprompt)
|
|
|
|
|
|
for i in range(len(completeprompt_list) - len("-material-") + 1):
|
|
|
if "".join(completeprompt_list[i:i+len("-material-")]) == "-material-":
|
|
|
|
|
|
replacement = materialreplacementlist.pop()
|
|
|
completeprompt_list[i:i+len("-material-")] = replacement
|
|
|
|
|
|
|
|
|
completeprompt = "".join(completeprompt_list)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (
|
|
|
"-color-" in completeprompt or
|
|
|
"-material-" in completeprompt or
|
|
|
"-animal-" in completeprompt or
|
|
|
"-object-" in completeprompt or
|
|
|
"-fictional-" in completeprompt or
|
|
|
"-nonfictional-" in completeprompt or
|
|
|
"-conceptsuffix-" in completeprompt or
|
|
|
"-building-" in completeprompt or
|
|
|
"-vehicle-" in completeprompt or
|
|
|
"-outfit-" in completeprompt or
|
|
|
"-location-" in completeprompt or
|
|
|
"-conceptprefix-" in completeprompt or
|
|
|
"-descriptor-" in completeprompt or
|
|
|
"-food-" in completeprompt or
|
|
|
"-haircolor-" in completeprompt or
|
|
|
"-hairstyle-" in completeprompt or
|
|
|
"-job-" in completeprompt or
|
|
|
"-culture-" in completeprompt or
|
|
|
"-accessory-" in completeprompt or
|
|
|
"-humanoid-" in completeprompt or
|
|
|
"-manwoman-" in completeprompt or
|
|
|
"-human-" in completeprompt or
|
|
|
"-colorscheme-" in completeprompt or
|
|
|
"-mood-" in completeprompt or
|
|
|
"-genderdescription-" in completeprompt or
|
|
|
"-artmovement-" in completeprompt or
|
|
|
"-malefemale-" in completeprompt or
|
|
|
"-objecttotal-" in completeprompt or
|
|
|
"-outfitprinttotal-" in completeprompt or
|
|
|
"-bodytype-" in completeprompt or
|
|
|
"-minilocation-" in completeprompt or
|
|
|
"-minilocationaddition-" in completeprompt or
|
|
|
"-pose-" in completeprompt or
|
|
|
"-season-" in completeprompt or
|
|
|
"-minioutfit-" in completeprompt or
|
|
|
"-elaborateoutfit-" in completeprompt or
|
|
|
"-minivomit-" in completeprompt or
|
|
|
"-vomit-" in completeprompt or
|
|
|
"-rpgclass-" in completeprompt or
|
|
|
"-subjectfromfile-" in completeprompt or
|
|
|
"-outfitfromfile-" in completeprompt or
|
|
|
"-brand-" in completeprompt or
|
|
|
"-space-" in completeprompt or
|
|
|
"-artist-" in completeprompt or
|
|
|
"-imagetype-" in completeprompt or
|
|
|
"-othertype-" in completeprompt or
|
|
|
"-quality-" in completeprompt or
|
|
|
"-lighting-" in completeprompt or
|
|
|
"-camera-" in completeprompt or
|
|
|
"-lens-" in completeprompt or
|
|
|
"-imagetypequality-" in completeprompt or
|
|
|
"-poemline-" in completeprompt or
|
|
|
"-songline-" in completeprompt or
|
|
|
"-greatwork-" in completeprompt or
|
|
|
"-fantasyartist-" in completeprompt or
|
|
|
"-popularartist-" in completeprompt or
|
|
|
"-romanticismartist-" in completeprompt or
|
|
|
"-photographyartist-" in completeprompt or
|
|
|
"-emoji-" in completeprompt or
|
|
|
"-timeperiod-" in completeprompt or
|
|
|
"-shotsize-" in completeprompt or
|
|
|
"-musicgenre-" in completeprompt or
|
|
|
"-animaladdition-" in completeprompt or
|
|
|
"-addontolocationinside-" in completeprompt or
|
|
|
"-addontolocation-" in completeprompt or
|
|
|
"-objectaddition-" in completeprompt or
|
|
|
"-humanaddition-" in completeprompt or
|
|
|
"-overalladdition-" in completeprompt or
|
|
|
"-focus-" in completeprompt or
|
|
|
"-direction-" in completeprompt or
|
|
|
"-styletilora-" in completeprompt or
|
|
|
"-manwomanrelation-" in completeprompt or
|
|
|
"-manwomanmultiple-" in completeprompt or
|
|
|
"-waterlocation-" in completeprompt or
|
|
|
"-container-" in completeprompt or
|
|
|
"-firstname-" in completeprompt or
|
|
|
"-flora-" in completeprompt or
|
|
|
"-print-" in completeprompt or
|
|
|
"-miniactivity-" in completeprompt or
|
|
|
"-pattern-" in completeprompt or
|
|
|
"-animalsuffixaddition-" in completeprompt or
|
|
|
"-chair-" in completeprompt or
|
|
|
"-cardname-" in completeprompt or
|
|
|
"-covering-" in completeprompt or
|
|
|
"-heshe-" in completeprompt or
|
|
|
"-hisher-" in completeprompt or
|
|
|
"-himher-" in completeprompt or
|
|
|
"-outfitdescriptor-" in completeprompt or
|
|
|
"-hairdescriptor-" in completeprompt or
|
|
|
"-hairvomit-" in completeprompt or
|
|
|
"-humandescriptor-" in completeprompt or
|
|
|
"-facepart-" in completeprompt or
|
|
|
"-buildfacepart-" in completeprompt or
|
|
|
"-outfitvomit-" in completeprompt or
|
|
|
"-locationdescriptor-" in completeprompt or
|
|
|
"-basicbitchdescriptor-" in completeprompt or
|
|
|
"-animaldescriptor-" in completeprompt or
|
|
|
"-humanexpression-" in completeprompt or
|
|
|
"-humanvomit-" in completeprompt or
|
|
|
"-eyecolor-" in completeprompt or
|
|
|
"-fashiondesigner-" in completeprompt or
|
|
|
"-colorcombination-" in completeprompt or
|
|
|
"-materialcombination-" in completeprompt or
|
|
|
"-oppositefictional-" in completeprompt or
|
|
|
"-oppositenonfictional-" in completeprompt or
|
|
|
"-photoaddition-" in completeprompt or
|
|
|
"-age-" in completeprompt or
|
|
|
"-agecalculator-" in completeprompt or
|
|
|
"-gregmode-" in completeprompt or
|
|
|
"-portraitartist-" in completeprompt or
|
|
|
"-characterartist-" in completeprompt or
|
|
|
"-landscapeartist-" in completeprompt or
|
|
|
"-scifiartist-" in completeprompt or
|
|
|
"-graphicdesignartist-" in completeprompt or
|
|
|
"-digitalartist-" in completeprompt or
|
|
|
"-architectartist-" in completeprompt or
|
|
|
"-cinemaartist-" in completeprompt or
|
|
|
"-element-" in completeprompt or
|
|
|
"-setting-" in completeprompt or
|
|
|
"-charactertype-" in completeprompt or
|
|
|
"-objectstohold-" in completeprompt or
|
|
|
"-episodetitle-" 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-","-subjectfromfile-", "-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-"]
|
|
|
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]
|
|
|
|
|
|
allwildcardslistwithhybrid = ["-material-", "-descriptor-", "-outfit-", "-conceptsuffix-","-culture-", "-objecttotal-", "-outfitprinttotal-", "-element-"]
|
|
|
allwildcardslistwithhybridlists = [materiallist, descriptorlist,outfitlist,conceptsuffixlist,culturelist, objecttotallist, outfitprinttotallist, elementlist]
|
|
|
|
|
|
|
|
|
|
|
|
for wildcard in allwildcardslistnohybrid:
|
|
|
attachedlist = allwildcardslistnohybridlists[allwildcardslistnohybrid.index(wildcard)]
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, wildcard, attachedlist,False, advancedprompting, artiststyleselector)
|
|
|
|
|
|
|
|
|
|
|
|
for wildcard in allwildcardslistwithhybrid:
|
|
|
attachedlist = allwildcardslistwithhybridlists[allwildcardslistwithhybrid.index(wildcard)]
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, wildcard, attachedlist,True, advancedprompting, artiststyleselector)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
matches = []
|
|
|
if(givensubject != ""):
|
|
|
pattern = r'\(\w+:\d+\.\d+\)'
|
|
|
matches = re.findall(pattern, givensubject)
|
|
|
|
|
|
|
|
|
if(len(completeprompt) > 325 and matches == []):
|
|
|
if(len(completeprompt) < 375):
|
|
|
strenght = "1.1"
|
|
|
elif(len(completeprompt) < 450):
|
|
|
strenght = "1.2"
|
|
|
else:
|
|
|
strenght = "1.3"
|
|
|
completeprompt = completeprompt.replace("-objectstrengthstart-","(")
|
|
|
completeprompt = completeprompt.replace("-objectstrengthend-",":" + strenght + ")")
|
|
|
else:
|
|
|
completeprompt = completeprompt.replace("-objectstrengthstart-","")
|
|
|
completeprompt = completeprompt.replace("-objectstrengthend-","")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt = parse_custom_functions(completeprompt, insanitylevel)
|
|
|
|
|
|
|
|
|
completeprompt = cleanup(completeprompt, advancedprompting, insanitylevel)
|
|
|
|
|
|
|
|
|
if("@" in completeprompt and prompt_g_and_l == True):
|
|
|
promptlist = completeprompt.split("@")
|
|
|
prompt_g = cleanup(promptlist[1], advancedprompting, insanitylevel)
|
|
|
prompt_l = cleanup((promptlist[0] + ", " + promptlist[2]).replace("of a",""), advancedprompting, insanitylevel)
|
|
|
elif(prompt_g_and_l == True):
|
|
|
prompt_g = completeprompt
|
|
|
prompt_l = completeprompt
|
|
|
|
|
|
completeprompt = completeprompt.replace(" @ ", " ")
|
|
|
completeprompt = completeprompt.replace("@ ", " ")
|
|
|
completeprompt = completeprompt.replace(" @", " ")
|
|
|
completeprompt = completeprompt.replace("@", " ")
|
|
|
completeprompt = cleanup(completeprompt, advancedprompting, insanitylevel)
|
|
|
|
|
|
|
|
|
if(random.randint(1, 50)==1):
|
|
|
print("")
|
|
|
print(random.choice(devmessagelist))
|
|
|
print("")
|
|
|
|
|
|
print(completeprompt)
|
|
|
if(prompt_g_and_l == False):
|
|
|
return completeprompt
|
|
|
else:
|
|
|
return completeprompt, prompt_g, prompt_l
|
|
|
|
|
|
|
|
|
|
|
|
def createpromptvariant(prompt = "", insanitylevel = 5, antivalues = "" , gender = "all", artists = "all", advancedprompting = True):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
emptylist = []
|
|
|
antilist = csv_to_list("antilist",emptylist , "./userfiles/",1)
|
|
|
antivaluelist = antivalues.split(",")
|
|
|
|
|
|
antilist += antivaluelist
|
|
|
|
|
|
|
|
|
|
|
|
colorlist = csv_to_list("colors",antilist)
|
|
|
animallist = csv_to_list("animals",antilist)
|
|
|
materiallist = csv_to_list("materials",antilist)
|
|
|
objectlist = csv_to_list("objects",antilist)
|
|
|
fictionallist = csv_to_list(csvfilename="fictional characters",antilist=antilist,skipheader=True,gender=gender)
|
|
|
nonfictionallist = csv_to_list(csvfilename="nonfictional characters",antilist=antilist,skipheader=True,gender=gender)
|
|
|
conceptsuffixlist = csv_to_list("concept_suffix",antilist)
|
|
|
buildinglist = csv_to_list("buildings",antilist)
|
|
|
vehiclelist = csv_to_list("vehicles",antilist)
|
|
|
outfitlist = csv_to_list("outfits",antilist)
|
|
|
locationlist = csv_to_list("locations",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)
|
|
|
colorschemelist = csv_to_list("colorscheme",antilist)
|
|
|
conceptprefixlist = csv_to_list("concept_prefix",antilist)
|
|
|
culturelist = csv_to_list("cultures",antilist)
|
|
|
descriptorlist = csv_to_list("descriptors",antilist)
|
|
|
devmessagelist = csv_to_list("devmessages",antilist)
|
|
|
directionlist = csv_to_list("directions",antilist)
|
|
|
emojilist = csv_to_list("emojis",antilist)
|
|
|
eventlist = csv_to_list("events",antilist)
|
|
|
focuslist = csv_to_list("focus",antilist)
|
|
|
greatworklist = csv_to_list("greatworks",antilist)
|
|
|
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("imagetypes",antilist)
|
|
|
joblist = joblist = csv_to_list(csvfilename="jobs",antilist=antilist,skipheader=True,gender=gender)
|
|
|
lenslist = csv_to_list("lenses",antilist)
|
|
|
lightinglist = csv_to_list("lighting",antilist)
|
|
|
malefemalelist = csv_to_list(csvfilename="malefemale",antilist=antilist,skipheader=True,gender=gender)
|
|
|
manwomanlist = csv_to_list(csvfilename="manwoman",antilist=antilist,skipheader=True,gender=gender)
|
|
|
moodlist = csv_to_list("moods",antilist)
|
|
|
othertypelist = csv_to_list("othertypes",antilist)
|
|
|
poselist = csv_to_list("poses",antilist)
|
|
|
qualitylist = csv_to_list("quality",antilist)
|
|
|
shotsizelist = csv_to_list("shotsizes",antilist)
|
|
|
timeperiodlist = csv_to_list("timeperiods",antilist)
|
|
|
vomitlist = csv_to_list("vomit",antilist)
|
|
|
foodlist = csv_to_list("foods", antilist)
|
|
|
genderdescriptionlist = csv_to_list(csvfilename="genderdescription",antilist=antilist,skipheader=True,gender=gender)
|
|
|
minilocationlist = csv_to_list("minilocations", antilist)
|
|
|
minioutfitlist = csv_to_list("minioutfits",antilist,"./csvfiles/",0,"?",False,False,gender)
|
|
|
seasonlist = csv_to_list("seasons", antilist)
|
|
|
elaborateoutfitlist = csv_to_list("elaborateoutfits", antilist)
|
|
|
minivomitlist = csv_to_list("minivomit", antilist)
|
|
|
imagetypequalitylist = csv_to_list("imagetypequality", antilist)
|
|
|
rpgclasslist = csv_to_list("rpgclasses", antilist)
|
|
|
brandlist = csv_to_list("brands", antilist)
|
|
|
spacelist = csv_to_list("space", antilist)
|
|
|
poemlinelist = csv_to_list("poemlines", antilist)
|
|
|
songlinelist = csv_to_list("songlines", antilist)
|
|
|
musicgenrelist = csv_to_list("musicgenres", antilist)
|
|
|
manwomanrelationlist = csv_to_list(csvfilename="manwomanrelations",antilist=antilist,skipheader=True,gender=gender)
|
|
|
manwomanmultiplelist = csv_to_list(csvfilename="manwomanmultiples",antilist=antilist,skipheader=True,gender=gender,delimiter="?")
|
|
|
waterlocationlist = csv_to_list("waterlocations", antilist)
|
|
|
containerlist = csv_to_list("containers", antilist)
|
|
|
firstnamelist = csv_to_list(csvfilename="firstnames",antilist=antilist,skipheader=True,gender=gender)
|
|
|
floralist = csv_to_list("flora", antilist)
|
|
|
printlist = csv_to_list("prints", antilist)
|
|
|
patternlist = csv_to_list("patterns", antilist)
|
|
|
chairlist = csv_to_list("chairs", antilist)
|
|
|
cardnamelist = csv_to_list("card_names", antilist)
|
|
|
coveringlist = csv_to_list("coverings", antilist)
|
|
|
facepartlist = csv_to_list("faceparts", antilist)
|
|
|
humanexpressionlist = csv_to_list(csvfilename="humanexpressions",antilist=antilist,delimiter="?")
|
|
|
humanvomitlist = csv_to_list("humanvomit", antilist)
|
|
|
eyecolorlist = csv_to_list("eyecolors", antilist)
|
|
|
fashiondesignerlist = csv_to_list("fashiondesigners", antilist)
|
|
|
colorcombinationlist = csv_to_list("colorcombinations", antilist)
|
|
|
materialcombinationlist = csv_to_list("materialcombinations", antilist)
|
|
|
agelist = csv_to_list("ages", antilist)
|
|
|
agecalculatorlist = csv_to_list("agecalculator", antilist)
|
|
|
elementlist = csv_to_list("elements", antilist)
|
|
|
settinglist = csv_to_list("settings", antilist)
|
|
|
charactertypelist = csv_to_list("charactertypes", antilist)
|
|
|
objectstoholdlist = csv_to_list("objectstohold", antilist)
|
|
|
episodetitlelist = csv_to_list(csvfilename="episodetitles",antilist=antilist,skipheader=True)
|
|
|
|
|
|
outfitdescriptorlist = csv_to_list("outfitdescriptors",antilist)
|
|
|
hairdescriptorlist = csv_to_list("hairdescriptors",antilist)
|
|
|
humandescriptorlist = csv_to_list("humandescriptors",antilist)
|
|
|
locationdescriptorlist = csv_to_list("locationdescriptors",antilist)
|
|
|
basicbitchdescriptorlist = csv_to_list("basicbitchdescriptors",antilist)
|
|
|
animaldescriptorlist = csv_to_list("animaldescriptors",antilist)
|
|
|
|
|
|
humanlist = fictionallist + nonfictionallist + humanoidlist + malefemalelist + manwomanlist + manwomanrelationlist + manwomanmultiplelist
|
|
|
objecttotallist = objectlist + buildinglist + vehiclelist + foodlist + spacelist + floralist + containerlist
|
|
|
outfitprinttotallist = objecttotallist + locationlist + colorlist + musicgenrelist + seasonlist + animallist + patternlist
|
|
|
|
|
|
|
|
|
if artists == "wild":
|
|
|
artists = "all (wild)"
|
|
|
artistlist = []
|
|
|
|
|
|
if(artists != "all" and artists != "none" and artists.startswith("personal_artists") == False and artists.startswith("personal artists") == False):
|
|
|
artistlist = artist_category_csv_to_list("artists_and_category",artists)
|
|
|
elif(artists.startswith("personal_artists") == True or artists.startswith("personal artists") == True):
|
|
|
artists = artists.replace(" ","_",-1)
|
|
|
artistlist = csv_to_list(artists,antilist,"./userfiles/")
|
|
|
elif(artists != "none"):
|
|
|
artistlist = csv_to_list("artists",antilist)
|
|
|
|
|
|
|
|
|
fantasyartistlist = artist_category_csv_to_list("artists_and_category","fantasy")
|
|
|
popularartistlist = artist_category_csv_to_list("artists_and_category","popular")
|
|
|
romanticismartistlist = artist_category_csv_to_list("artists_and_category","romanticism")
|
|
|
photographyartistlist = artist_category_csv_to_list("artists_and_category","photography")
|
|
|
portraitartistlist = artist_category_csv_to_list("artists_and_category","portrait")
|
|
|
characterartistlist = artist_category_csv_to_list("artists_and_category","character")
|
|
|
landscapeartistlist = artist_category_csv_to_list("artists_and_category","landscape")
|
|
|
scifiartistlist = artist_category_csv_to_list("artists_and_category","sci-fi")
|
|
|
graphicdesignartistlist = artist_category_csv_to_list("artists_and_category","graphic design")
|
|
|
digitalartistlist = artist_category_csv_to_list("artists_and_category","digital")
|
|
|
architectartistlist = artist_category_csv_to_list("artists_and_category","architecture")
|
|
|
cinemaartistlist = artist_category_csv_to_list("artists_and_category","cinema")
|
|
|
gregmodelist = csv_to_list("gregmode", antilist)
|
|
|
|
|
|
|
|
|
stylestiloralist = csv_to_list("styles_ti_lora",antilist,"./userfiles/")
|
|
|
generatestyle = bool(stylestiloralist)
|
|
|
|
|
|
custominputprefixlist = csv_to_list("custom_input_prefix",antilist,"./userfiles/")
|
|
|
generatecustominputprefix = bool(custominputprefixlist)
|
|
|
|
|
|
custominputmidlist = csv_to_list("custom_input_mid",antilist,"./userfiles/")
|
|
|
generatecustominputmid = bool(custominputmidlist)
|
|
|
|
|
|
custominputsuffixlist = csv_to_list("custom_input_suffix",antilist,"./userfiles/")
|
|
|
generatecustominputsuffix = bool(custominputsuffixlist)
|
|
|
|
|
|
customsubjectslist = csv_to_list("custom_subjects",antilist,"./userfiles/")
|
|
|
customoutfitslist = csv_to_list("custom_outfits",antilist,"./userfiles/")
|
|
|
|
|
|
|
|
|
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,"?")
|
|
|
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,"?")
|
|
|
|
|
|
|
|
|
prompt = prompt.replace(",", " , ")
|
|
|
prompt = prompt.replace("(", " ( ")
|
|
|
prompt = prompt.replace(")", " ) ")
|
|
|
prompt = prompt.replace("[", " [ ")
|
|
|
prompt = prompt.replace("]", " ] ")
|
|
|
prompt = prompt.replace("|", " | ")
|
|
|
prompt = prompt.replace(":", " : ")
|
|
|
|
|
|
prompt = " " + prompt
|
|
|
|
|
|
originalprompt = prompt
|
|
|
|
|
|
|
|
|
|
|
|
words = prompt.split()
|
|
|
num_words = len(words)
|
|
|
|
|
|
combinations_list = []
|
|
|
|
|
|
for length in range(1, 5):
|
|
|
for start_idx in range(num_words - length + 1):
|
|
|
end_idx = start_idx + length
|
|
|
combination = ' '.join(words[start_idx:end_idx])
|
|
|
combinations_list.append(combination)
|
|
|
|
|
|
maxamountofruns = 4
|
|
|
runs = 0
|
|
|
|
|
|
if(insanitylevel != 0):
|
|
|
print("")
|
|
|
print("Creating a prompt variation")
|
|
|
print("")
|
|
|
while(originalprompt == prompt and runs != maxamountofruns):
|
|
|
for combination in combinations_list:
|
|
|
lowercase_combination = combination.lower()
|
|
|
combination = " " + combination + " "
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in humanlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -human- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in objecttotallist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -objecttotal- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in artistlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -artist- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in colorlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -color- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in animallist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -animal- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in objectlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -object- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in fictionallist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -fictional- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in nonfictionallist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -nonfictional- ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in buildinglist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -building- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in vehiclelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -vehicle- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in outfitlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -outfit- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in locationlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -location- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in accessorielist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -accessory- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in artmovementlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -artmovement- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in bodytypelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -bodytype- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in cameralist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -camera- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in colorschemelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -colorscheme- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in eyecolorlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -eyecolor- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in fashiondesignerlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -fashiondesigner- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in colorcombinationlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -colorcombination- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in materialcombinationlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -materialcombination- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in photoadditionlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -photoaddition- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in agelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -age- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in agecalculatorlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -agecalculator- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in gregmodelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -gregmode- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in elementlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -element- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in settinglist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -setting- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in charactertypelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -charactertype- ")
|
|
|
if lowercase_combination in [x.lower() for x in objectstoholdlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -objectstohold- ")
|
|
|
if lowercase_combination in [x.lower() for x in episodetitlelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -episodetitle- ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in culturelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -culture- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in descriptorlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -descriptor- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in outfitdescriptorlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -outfitdescriptor- ")
|
|
|
if lowercase_combination in [x.lower() for x in hairdescriptorlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -hairdescriptor- ")
|
|
|
if lowercase_combination in [x.lower() for x in hairvomitlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -hairvomit- ")
|
|
|
if lowercase_combination in [x.lower() for x in humandescriptorlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -humandescriptor- ")
|
|
|
if lowercase_combination in [x.lower() for x in locationdescriptorlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -locationdescriptor- ")
|
|
|
if lowercase_combination in [x.lower() for x in basicbitchdescriptorlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -basicbitchdescriptor- ")
|
|
|
if lowercase_combination in [x.lower() for x in animaldescriptorlist] and chance_roll(insanitylevel, "rare"):
|
|
|
prompt = prompt.replace(combination," -animaldescriptor- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in directionlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -direction- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in emojilist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -emoji- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in humanexpressionlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -humanexpression- ")
|
|
|
if lowercase_combination in [x.lower() for x in humanvomitlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -humanvomit- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in eventlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -event- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in focuslist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -focus- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in greatworklist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -greatwork- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in haircolorlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -haircolor- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in hairstylelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -hairstyle- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in directionlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -direction- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in humanoidlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -humanoid- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in joblist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -job- ")
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in lenslist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -lens- ")
|
|
|
if lowercase_combination in [x.lower() for x in lightinglist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -lighting- ")
|
|
|
if lowercase_combination in [x.lower() for x in malefemalelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -malefemale- ")
|
|
|
if lowercase_combination in [x.lower() for x in manwomanlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -manwoman- ")
|
|
|
if lowercase_combination in [x.lower() for x in moodlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -mood- ")
|
|
|
if lowercase_combination in [x.lower() for x in othertypelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -othertype- ")
|
|
|
if lowercase_combination in [x.lower() for x in poselist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -pose- ")
|
|
|
if lowercase_combination in [x.lower() for x in qualitylist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -quality- ")
|
|
|
if lowercase_combination in [x.lower() for x in shotsizelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -shotsize- ")
|
|
|
if lowercase_combination in [x.lower() for x in timeperiodlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -timeperiod- ")
|
|
|
if lowercase_combination in [x.lower() for x in vomitlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -vomit- ")
|
|
|
if lowercase_combination in [x.lower() for x in foodlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -food- ")
|
|
|
if lowercase_combination in [x.lower() for x in genderdescriptionlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -genderdescription- ")
|
|
|
if lowercase_combination in [x.lower() for x in minilocationlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -minilocation- ")
|
|
|
if lowercase_combination in [x.lower() for x in minioutfitlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -minioutfit- ")
|
|
|
if lowercase_combination in [x.lower() for x in lenslist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -lens- ")
|
|
|
if lowercase_combination in [x.lower() for x in seasonlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -season- ")
|
|
|
if lowercase_combination in [x.lower() for x in imagetypequalitylist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -imagetypequality- ")
|
|
|
if lowercase_combination in [x.lower() for x in rpgclasslist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -rpgclass- ")
|
|
|
if lowercase_combination in [x.lower() for x in brandlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -brand- ")
|
|
|
if lowercase_combination in [x.lower() for x in spacelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -space- ")
|
|
|
if lowercase_combination in [x.lower() for x in poemlinelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -poemline- ")
|
|
|
if lowercase_combination in [x.lower() for x in songlinelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -songline- ")
|
|
|
if lowercase_combination in [x.lower() for x in musicgenrelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -musicgenre- ")
|
|
|
if lowercase_combination in [x.lower() for x in manwomanrelationlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -manwomanrelation- ")
|
|
|
if lowercase_combination in [x.lower() for x in manwomanmultiplelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -manwomanmultiple- ")
|
|
|
if lowercase_combination in [x.lower() for x in waterlocationlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -waterlocation- ")
|
|
|
if lowercase_combination in [x.lower() for x in containerlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -container- ")
|
|
|
if lowercase_combination in [x.lower() for x in firstnamelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -firstname- ")
|
|
|
if lowercase_combination in [x.lower() for x in floralist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -flora- ")
|
|
|
if lowercase_combination in [x.lower() for x in printlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -print- ")
|
|
|
if lowercase_combination in [x.lower() for x in miniactivitylist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -miniactivity- ")
|
|
|
if lowercase_combination in [x.lower() for x in patternlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -pattern- ")
|
|
|
if lowercase_combination in [x.lower() for x in chairlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -chair- ")
|
|
|
if lowercase_combination in [x.lower() for x in cardnamelist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -cardname- ")
|
|
|
if lowercase_combination in [x.lower() for x in coveringlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -covering- ")
|
|
|
if lowercase_combination in [x.lower() for x in facepartlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -facepart- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in fantasyartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -fantasyartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in popularartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -popularartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in romanticismartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -romanticismartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in photographyartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -photographyartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in portraitartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -portraitartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in characterartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -characterartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in landscapeartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -landscapeartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in scifiartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -scifiartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in graphicdesignartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -graphicdesignartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in architectartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -architectartist- ")
|
|
|
if lowercase_combination in [x.lower() for x in cinemaartistlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -cinemaartist- ")
|
|
|
|
|
|
|
|
|
if lowercase_combination in [x.lower() for x in stylestiloralist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -styletilora- ")
|
|
|
if lowercase_combination in [x.lower() for x in waterlocationlist] and chance_roll(insanitylevel, "uncommon"):
|
|
|
prompt = prompt.replace(combination," -waterlocation- ")
|
|
|
|
|
|
runs += 1
|
|
|
|
|
|
|
|
|
|
|
|
prompt = prompt.replace(" :", ":")
|
|
|
prompt = prompt.replace(": ", ":")
|
|
|
|
|
|
completeprompt = prompt
|
|
|
|
|
|
|
|
|
while (
|
|
|
"-color-" in completeprompt or
|
|
|
"-material-" in completeprompt or
|
|
|
"-animal-" in completeprompt or
|
|
|
"-object-" in completeprompt or
|
|
|
"-fictional-" in completeprompt or
|
|
|
"-nonfictional-" in completeprompt or
|
|
|
"-conceptsuffix-" in completeprompt or
|
|
|
"-building-" in completeprompt or
|
|
|
"-vehicle-" in completeprompt or
|
|
|
"-outfit-" in completeprompt or
|
|
|
"-location-" in completeprompt or
|
|
|
"-conceptprefix-" in completeprompt or
|
|
|
"-descriptor-" in completeprompt or
|
|
|
"-food-" in completeprompt or
|
|
|
"-haircolor-" in completeprompt or
|
|
|
"-hairstyle-" in completeprompt or
|
|
|
"-job-" in completeprompt or
|
|
|
"-culture-" in completeprompt or
|
|
|
"-accessory-" in completeprompt or
|
|
|
"-humanoid-" in completeprompt or
|
|
|
"-manwoman-" in completeprompt or
|
|
|
"-human-" in completeprompt or
|
|
|
"-colorscheme-" in completeprompt or
|
|
|
"-mood-" in completeprompt or
|
|
|
"-genderdescription-" in completeprompt or
|
|
|
"-artmovement-" in completeprompt or
|
|
|
"-malefemale-" in completeprompt or
|
|
|
"-objecttotal-" in completeprompt or
|
|
|
"-outfitprinttotal-" in completeprompt or
|
|
|
"-bodytype-" in completeprompt or
|
|
|
"-minilocation-" in completeprompt or
|
|
|
"-minilocationaddition-" in completeprompt or
|
|
|
"-pose-" in completeprompt or
|
|
|
"-season-" in completeprompt or
|
|
|
"-minioutfit-" in completeprompt or
|
|
|
"-elaborateoutfit-" in completeprompt or
|
|
|
"-minivomit-" in completeprompt or
|
|
|
"-vomit-" in completeprompt or
|
|
|
"-rpgclass-" in completeprompt or
|
|
|
"-subjectfromfile-" in completeprompt or
|
|
|
"-outfitfromfile-" in completeprompt or
|
|
|
"-brand-" in completeprompt or
|
|
|
"-space-" in completeprompt or
|
|
|
"-artist-" in completeprompt or
|
|
|
"-imagetype-" in completeprompt or
|
|
|
"-othertype-" in completeprompt or
|
|
|
"-quality-" in completeprompt or
|
|
|
"-lighting-" in completeprompt or
|
|
|
"-camera-" in completeprompt or
|
|
|
"-lens-" in completeprompt or
|
|
|
"-imagetypequality-" in completeprompt or
|
|
|
"-poemline-" in completeprompt or
|
|
|
"-songline-" in completeprompt or
|
|
|
"-greatwork-" in completeprompt or
|
|
|
"-fantasyartist-" in completeprompt or
|
|
|
"-popularartist-" in completeprompt or
|
|
|
"-romanticismartist-" in completeprompt or
|
|
|
"-photographyartist-" in completeprompt or
|
|
|
"-emoji-" in completeprompt or
|
|
|
"-timeperiod-" in completeprompt or
|
|
|
"-shotsize-" in completeprompt or
|
|
|
"-musicgenre-" in completeprompt or
|
|
|
"-animaladdition-" in completeprompt or
|
|
|
"-objectaddition-" in completeprompt or
|
|
|
"-humanaddition-" in completeprompt or
|
|
|
"-overalladdition-" in completeprompt or
|
|
|
"-focus-" in completeprompt or
|
|
|
"-direction-" in completeprompt or
|
|
|
"-styletilora-" in completeprompt or
|
|
|
"-manwomanrelation-" in completeprompt or
|
|
|
"-manwomanmultiple-" in completeprompt or
|
|
|
"-waterlocation-" in completeprompt or
|
|
|
"-container-" in completeprompt or
|
|
|
"-firstname-" in completeprompt or
|
|
|
"-flora-" in completeprompt or
|
|
|
"-print-" in completeprompt or
|
|
|
"-miniactivity-" in completeprompt or
|
|
|
"-pattern-" in completeprompt or
|
|
|
"-chair-" in completeprompt or
|
|
|
"-cardname-" in completeprompt or
|
|
|
"-covering-" in completeprompt or
|
|
|
"-outfitdescriptor-" in completeprompt or
|
|
|
"-hairdescriptor-" in completeprompt or
|
|
|
"-hairvomit-" in completeprompt or
|
|
|
"-humandescriptor-" in completeprompt or
|
|
|
"-facepart-" in completeprompt or
|
|
|
"-locationdescriptor-" in completeprompt or
|
|
|
"-basicbitchdescriptor-" in completeprompt or
|
|
|
"-animaldescriptor-" in completeprompt or
|
|
|
"-humanexpression-" in completeprompt or
|
|
|
"-humanvomit-" in completeprompt or
|
|
|
"-eyecolor-" in completeprompt or
|
|
|
"-fashiondesigner-" in completeprompt or
|
|
|
"-colorcombination-" in completeprompt or
|
|
|
"-materialcombination-" in completeprompt or
|
|
|
"-photoaddition-" in completeprompt or
|
|
|
"-age-" in completeprompt or
|
|
|
"-agecalculator-" in completeprompt or
|
|
|
"-gregmode-" in completeprompt or
|
|
|
"-portraitartist-" in completeprompt or
|
|
|
"-characterartist-" in completeprompt or
|
|
|
"-landscapeartist-" in completeprompt or
|
|
|
"-scifiartist-" in completeprompt or
|
|
|
"-graphicdesignartist-" in completeprompt or
|
|
|
"-digitalartist-" in completeprompt or
|
|
|
"-architectartist-" in completeprompt or
|
|
|
"-cinemaartist-" in completeprompt or
|
|
|
"-element-" in completeprompt or
|
|
|
"-setting-" in completeprompt or
|
|
|
"-charactertype-" in completeprompt or
|
|
|
"-objectstohold-" in completeprompt or
|
|
|
"-episodetitle-" 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-", "-subjectfromfile-", "-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-"]
|
|
|
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]
|
|
|
|
|
|
allwildcardslistwithhybrid = ["-material-", "-descriptor-", "-outfit-", "-conceptsuffix-","-culture-", "-objecttotal-", "-outfitprinttotal-", "-element-"]
|
|
|
allwildcardslistwithhybridlists = [materiallist, descriptorlist,outfitlist,conceptsuffixlist,culturelist, objecttotallist, outfitprinttotallist, elementlist]
|
|
|
|
|
|
|
|
|
|
|
|
for wildcard in allwildcardslistnohybrid:
|
|
|
attachedlist = allwildcardslistnohybridlists[allwildcardslistnohybrid.index(wildcard)]
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, wildcard, attachedlist,False, advancedprompting)
|
|
|
|
|
|
|
|
|
|
|
|
for wildcard in allwildcardslistwithhybrid:
|
|
|
attachedlist = allwildcardslistwithhybridlists[allwildcardslistwithhybrid.index(wildcard)]
|
|
|
completeprompt = replacewildcard(completeprompt, insanitylevel, wildcard, attachedlist,True, advancedprompting)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt = cleanup(completeprompt, advancedprompting, insanitylevel)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return completeprompt
|
|
|
|
|
|
|
|
|
def replacewildcard(completeprompt, insanitylevel, wildcard,listname, activatehybridorswap, advancedprompting, artiststyleselector = ""):
|
|
|
|
|
|
if(len(listname) == 0):
|
|
|
|
|
|
completeprompt = completeprompt.replace(wildcard, "",1)
|
|
|
else:
|
|
|
|
|
|
while wildcard in completeprompt:
|
|
|
if(unique_dist(insanitylevel) and activatehybridorswap == True and len(listname)>2 and advancedprompting==True):
|
|
|
hybridorswaplist = ["hybrid", "swap"]
|
|
|
hybridorswap = random.choice(hybridorswaplist)
|
|
|
replacementvalue = random.choice(listname)
|
|
|
listname.remove(replacementvalue)
|
|
|
hybridorswapreplacementvalue = "[" + replacementvalue
|
|
|
|
|
|
if(hybridorswap == "hybrid"):
|
|
|
replacementvalue = random.choice(listname)
|
|
|
listname.remove(replacementvalue)
|
|
|
hybridorswapreplacementvalue += "|" + replacementvalue + "] "
|
|
|
if(hybridorswap == "swap"):
|
|
|
replacementvalue = random.choice(listname)
|
|
|
listname.remove(replacementvalue)
|
|
|
hybridorswapreplacementvalue += ":" + replacementvalue + ":" + str(random.randint(1,20)) + "] "
|
|
|
|
|
|
completeprompt = completeprompt.replace(wildcard, hybridorswapreplacementvalue,1)
|
|
|
|
|
|
|
|
|
if(bool(listname)):
|
|
|
replacementvalue = random.choice(listname)
|
|
|
if(wildcard not in ["-heshe-", "-himher-","-hisher-"]):
|
|
|
listname.remove(replacementvalue)
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
replacementvalue = ""
|
|
|
|
|
|
|
|
|
if(wildcard == "-artist-" and "-artiststyle-" in completeprompt):
|
|
|
artiststyles = []
|
|
|
artiststyle = []
|
|
|
chosenartiststyle = ""
|
|
|
artiststyles = artist_category_by_category_csv_to_list("artists_and_category",replacementvalue)
|
|
|
artiststyle = [x.strip() for x in artiststyles[0].split(",")]
|
|
|
|
|
|
artiststyle = list(filter(lambda x: len(x) > 0, artiststyle))
|
|
|
|
|
|
if(artiststyleselector in artiststyle):
|
|
|
artiststyle.remove(artiststyleselector)
|
|
|
|
|
|
|
|
|
if("nudity" in artiststyle):
|
|
|
artiststyle.remove("nudity")
|
|
|
|
|
|
|
|
|
|
|
|
while bool(artiststyle) and "-artiststyle-" in completeprompt:
|
|
|
|
|
|
chosenartiststyle = random.choice(artiststyle)
|
|
|
completeprompt = completeprompt.replace("-artiststyle-",chosenartiststyle ,1)
|
|
|
artiststyle.remove(chosenartiststyle)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(wildcard == "-outfit-" or wildcard == "-minioutfit-"):
|
|
|
completeprompt = completeprompt.replace("-sameoutfit-", replacementvalue,1)
|
|
|
|
|
|
|
|
|
|
|
|
if "from" in replacementvalue:
|
|
|
|
|
|
from_index = replacementvalue.find("from")
|
|
|
|
|
|
|
|
|
replacementvalueforoverrides = replacementvalue[:from_index].strip()
|
|
|
else:
|
|
|
replacementvalueforoverrides = replacementvalue
|
|
|
|
|
|
if(wildcard in ["-human-"
|
|
|
,"-humanoid-"
|
|
|
, "-manwoman-"
|
|
|
, "-manwomanrelation-"
|
|
|
, "-manwomanmultiple-"]
|
|
|
and "-samehumansubject-" in completeprompt):
|
|
|
if(completeprompt.index(wildcard) < completeprompt.index("-samehumansubject-")):
|
|
|
completeprompt = completeprompt.replace("-samehumansubject-", "the " + replacementvalueforoverrides)
|
|
|
|
|
|
if(wildcard in ["-fictional-"
|
|
|
, "-nonfictional-"
|
|
|
, "-firstname-"
|
|
|
, "-oppositefictional-"
|
|
|
, "-oppositenonfictional-"]
|
|
|
and "-samehumansubject-" in completeprompt):
|
|
|
if(completeprompt.index(wildcard) < completeprompt.index("-samehumansubject-")):
|
|
|
completeprompt = completeprompt.replace("-samehumansubject-", replacementvalueforoverrides)
|
|
|
|
|
|
|
|
|
if(wildcard in ["-job-"]
|
|
|
and "-samehumansubject-" in completeprompt):
|
|
|
if(completeprompt.index(wildcard) < completeprompt.index("-samehumansubject-")):
|
|
|
completeprompt = completeprompt.replace("-samehumansubject-", "the " + replacementvalueforoverrides)
|
|
|
|
|
|
|
|
|
|
|
|
if(wildcard in ["-malefemale-"]
|
|
|
and "-samehumansubject-" in completeprompt):
|
|
|
if(completeprompt.index(wildcard) < completeprompt.index("-samehumansubject-")):
|
|
|
completeprompt = completeprompt.replace("-samehumansubject-", "the " + replacementvalueforoverrides)
|
|
|
|
|
|
if(wildcard in ["-animal-"
|
|
|
, "-object-"
|
|
|
, "-vehicle-"
|
|
|
, "-food-"
|
|
|
, "-objecttotal-"
|
|
|
, "-space-"
|
|
|
, "-flora-"
|
|
|
, "-location-"
|
|
|
, "-building-"]
|
|
|
and "-sameothersubject-" in completeprompt):
|
|
|
if(completeprompt.index(wildcard) < completeprompt.index("-sameothersubject-")):
|
|
|
completeprompt = completeprompt.replace("-sameothersubject-", "the " + replacementvalueforoverrides)
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt = completeprompt.replace(wildcard, replacementvalue,1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return completeprompt
|
|
|
|
|
|
def build_dynamic_negative(positive_prompt = "", insanitylevel = 0, enhance = False, existing_negative_prompt = ""):
|
|
|
|
|
|
|
|
|
negative_primer = []
|
|
|
negative_result = []
|
|
|
all_negative_words_list = []
|
|
|
|
|
|
|
|
|
|
|
|
negative_primer, negative_result = load_negative_list()
|
|
|
|
|
|
|
|
|
artistlist, categorylist = load_all_artist_and_category()
|
|
|
|
|
|
artist_names = [artist.strip().lower() for artist in artistlist]
|
|
|
|
|
|
|
|
|
|
|
|
for artist_name, category in zip(artist_names, categorylist):
|
|
|
positive_prompt = positive_prompt.lower().replace(artist_name, category)
|
|
|
|
|
|
|
|
|
allwords = split_prompt_to_words(positive_prompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for word in allwords:
|
|
|
if(word.lower() in negative_primer):
|
|
|
index_of_word = negative_primer.index(word.lower())
|
|
|
all_negative_words_list.append(negative_result[index_of_word])
|
|
|
|
|
|
all_negative_words = ", ".join(all_negative_words_list)
|
|
|
all_negative_words_list = all_negative_words.split(",")
|
|
|
all_negative_words_list = [elem.strip().lower() for elem in all_negative_words_list]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if enhance == True:
|
|
|
enhancelist = ["worst quality", "low quality", "normal quality", "lowres", "low details", "oversaturated", "undersaturated", "overexposed", "underexposed", "grayscale", "bw", "bad photo", "bad photography", "bad art", "watermark", "signature", "text font", "username", "error", "logo", "words", "letters", "digits", "autograph", "trademark", "name", "blur", "blurry", "grainy", "ugly", "asymmetrical", "poorly lit", "bad shadow", "draft", "cropped", "out of frame", "cut off", "censored", "jpeg artifacts", "out of focus", "glitch", "duplicate"]
|
|
|
all_negative_words_list += enhancelist
|
|
|
|
|
|
|
|
|
|
|
|
removalchance = int((insanitylevel) * 10)
|
|
|
|
|
|
for i in range(len(all_negative_words_list)):
|
|
|
if(random.randint(1, 100)<removalchance):
|
|
|
all_negative_words_list.pop(random.randint(0, len(all_negative_words_list)-1))
|
|
|
|
|
|
|
|
|
|
|
|
all_negative_words_list = [word for word in all_negative_words_list if word not in allwords]
|
|
|
|
|
|
|
|
|
|
|
|
word_count = {}
|
|
|
for word in all_negative_words_list:
|
|
|
if word in word_count:
|
|
|
word_count[word] += 1
|
|
|
else:
|
|
|
word_count[word] = 1
|
|
|
|
|
|
|
|
|
unique_words = []
|
|
|
for word, count in word_count.items():
|
|
|
if(count > 2):
|
|
|
|
|
|
counttotal = count
|
|
|
if(counttotal > 3):
|
|
|
counttotal = 3
|
|
|
unique_words.append(f"({word}:1.{counttotal})")
|
|
|
else:
|
|
|
unique_words.append(word)
|
|
|
|
|
|
negative_result = ", ".join(unique_words)
|
|
|
|
|
|
negative_result += ", " + existing_negative_prompt
|
|
|
|
|
|
return negative_result
|
|
|
|
|
|
def replace_match(match):
|
|
|
|
|
|
words = match.group(0)[1:-1].split('|')
|
|
|
return words[0]
|
|
|
|
|
|
def cleanup(completeprompt, advancedprompting, insanitylevel = 5):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(advancedprompting==False):
|
|
|
hybridpattern = r'\[\w+\|\w+\]'
|
|
|
|
|
|
completeprompt = re.sub(hybridpattern, replace_match, completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = completeprompt.replace("[", " ")
|
|
|
completeprompt = completeprompt.replace("]", " ")
|
|
|
completeprompt = completeprompt.replace("|", " ")
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('\(\:\d+\.\d+\)', '', completeprompt)
|
|
|
|
|
|
|
|
|
if(insanitylevel < 7):
|
|
|
completeprompt = completeprompt.replace("DayGlo", " ")
|
|
|
completeprompt = completeprompt.replace("fluorescent", " ")
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('\[ ', '[', completeprompt)
|
|
|
completeprompt = re.sub('\[,', '[', completeprompt)
|
|
|
completeprompt = re.sub(' \]', ']', completeprompt)
|
|
|
completeprompt = re.sub(' \|', '|', completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('\( ', '(', completeprompt)
|
|
|
completeprompt = re.sub(' \(', '(', completeprompt)
|
|
|
completeprompt = re.sub('\) ', ')', completeprompt)
|
|
|
completeprompt = re.sub(' \)', ')', completeprompt)
|
|
|
|
|
|
completeprompt = re.sub(' :', ':', completeprompt)
|
|
|
completeprompt = re.sub(',::', '::', completeprompt)
|
|
|
completeprompt = re.sub(',:', ':', completeprompt)
|
|
|
|
|
|
completeprompt = re.sub(',,', ', ', completeprompt)
|
|
|
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:
|
|
|
completeprompt = re.sub(' ', ' ', completeprompt)
|
|
|
completeprompt = re.sub('a The', 'The', completeprompt)
|
|
|
completeprompt = re.sub('the the', 'the', completeprompt)
|
|
|
completeprompt = re.sub(', ,', ',', completeprompt)
|
|
|
completeprompt = re.sub(',,', ',', completeprompt)
|
|
|
|
|
|
completeprompt = re.sub(', of a', ' of a', completeprompt)
|
|
|
completeprompt = re.sub('of a,', 'of a', completeprompt)
|
|
|
completeprompt = re.sub('of a of a', 'of a', completeprompt)
|
|
|
completeprompt = re.sub(' a a ', ' a ', completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = re.sub(' a a', ' an a', completeprompt)
|
|
|
completeprompt = re.sub(' a e', ' an e', completeprompt)
|
|
|
completeprompt = re.sub(' a i', ' an i', completeprompt)
|
|
|
completeprompt = re.sub(' a u', ' an u', completeprompt)
|
|
|
completeprompt = re.sub(' a o', ' an o', completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('art art', 'art', completeprompt)
|
|
|
completeprompt = re.sub('-artiststyle- art,', '', completeprompt)
|
|
|
completeprompt = re.sub('-artiststyle- art', '', completeprompt)
|
|
|
completeprompt = re.sub('-artiststyle-', '', completeprompt)
|
|
|
completeprompt = re.sub('- art ', '', completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('a his', 'his', completeprompt)
|
|
|
completeprompt = re.sub('a her', 'her', completeprompt)
|
|
|
completeprompt = re.sub('they is', 'they are', completeprompt)
|
|
|
completeprompt = re.sub('they has', 'they have', completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('- shaped', '-shaped', completeprompt)
|
|
|
completeprompt = re.sub('echa- ', 'echa-', completeprompt)
|
|
|
completeprompt = re.sub('style -', 'style-', completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('a 2', '2', completeprompt)
|
|
|
completeprompt = re.sub('a 3', '3', completeprompt)
|
|
|
completeprompt = re.sub('a 4', '4', completeprompt)
|
|
|
completeprompt = re.sub('a 5', '5', completeprompt)
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('fs ', 'ves ', completeprompt)
|
|
|
completeprompt = re.sub('fs,', 'ves,', completeprompt)
|
|
|
completeprompt = re.sub('sss ', 'ss ', completeprompt)
|
|
|
completeprompt = re.sub('sss,', 'ss,', completeprompt)
|
|
|
completeprompt = re.sub(' Mans', ' Men,', completeprompt)
|
|
|
completeprompt = re.sub(' mans', ' men', completeprompt)
|
|
|
completeprompt = re.sub(' Womans,', ' Women', completeprompt)
|
|
|
completeprompt = re.sub(' womans,', ' women,', completeprompt)
|
|
|
completeprompt = re.sub('\(Mans', '(Men,', completeprompt)
|
|
|
completeprompt = re.sub('\(mans', '(men', completeprompt)
|
|
|
completeprompt = re.sub('\(Womans', '(Women', completeprompt)
|
|
|
completeprompt = re.sub('\(womans', '(women', completeprompt)
|
|
|
|
|
|
completeprompt = re.sub('-sameothersubject-', 'it', completeprompt)
|
|
|
completeprompt = re.sub('-samehumansubject-', 'the person', completeprompt)
|
|
|
|
|
|
|
|
|
completeprompt = re.sub('(?<!\()\s?\(', ' (', completeprompt)
|
|
|
completeprompt = re.sub('\)(?![\s)])', ') ', completeprompt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
completeprompt = completeprompt.strip(", ")
|
|
|
|
|
|
return completeprompt
|
|
|
|
|
|
def custom_or(values, insanitylevel = 5):
|
|
|
|
|
|
last_element = values[-1]
|
|
|
first_element = values[0]
|
|
|
|
|
|
|
|
|
if last_element in ['always', 'common', 'normal','uncommon', 'rare', 'legendary','unique', 'extraordinary', 'novel', 'never']:
|
|
|
|
|
|
if not(chance_roll(insanitylevel, last_element)):
|
|
|
return first_element
|
|
|
|
|
|
else:
|
|
|
values.remove(first_element)
|
|
|
values.remove(last_element)
|
|
|
selected_value = random.choice(values)
|
|
|
return selected_value
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
selected_value = random.choice(values)
|
|
|
return selected_value
|
|
|
|
|
|
def parse_custom_functions(completeprompt, insanitylevel = 5):
|
|
|
|
|
|
|
|
|
ORpattern = r'OR\((.*?)\)'
|
|
|
ORbasesearch = 'OR('
|
|
|
|
|
|
|
|
|
|
|
|
while re.findall(ORpattern, completeprompt):
|
|
|
|
|
|
|
|
|
|
|
|
startofOR = completeprompt.rfind(ORbasesearch)
|
|
|
|
|
|
lastpartofcompleteprompt = completeprompt[startofOR:]
|
|
|
|
|
|
|
|
|
matches = re.findall(ORpattern, lastpartofcompleteprompt)
|
|
|
|
|
|
|
|
|
matches.sort(key=len)
|
|
|
|
|
|
|
|
|
match = matches[0]
|
|
|
|
|
|
or_replacement = ""
|
|
|
|
|
|
|
|
|
|
|
|
arguments = [arg.strip() for arg in match.split(';')]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
or_replacement = custom_or(arguments, insanitylevel)
|
|
|
completematch = 'OR(' + match + ')'
|
|
|
completeprompt = completeprompt.replace(completematch, or_replacement)
|
|
|
|
|
|
|
|
|
|
|
|
return completeprompt
|
|
|
|
|
|
def split_prompt_to_words(text):
|
|
|
|
|
|
|
|
|
|
|
|
text = re.sub(r'[^a-zA-Z,-]', ' ', text)
|
|
|
|
|
|
|
|
|
words = re.split(r'[,\s]+', text)
|
|
|
|
|
|
words = [word.strip() for word in words]
|
|
|
|
|
|
|
|
|
words = [word for word in words if word]
|
|
|
|
|
|
|
|
|
listsinglewords = list(set(words))
|
|
|
|
|
|
|
|
|
if ',' in text:
|
|
|
allwords = text.split(',')
|
|
|
else:
|
|
|
allwords = [text]
|
|
|
|
|
|
words = [word.strip().lower() for word in allwords]
|
|
|
|
|
|
|
|
|
listwords = list(set(filter(None, words)))
|
|
|
|
|
|
totallist = listsinglewords + listwords
|
|
|
|
|
|
totallist = list(set(filter(None, totallist)))
|
|
|
|
|
|
return totallist |