Work on seperating male and female
This commit is contained in:
@@ -10,7 +10,7 @@ from random_functions import *
|
||||
# insanity level controls randomness of propmt 0-10
|
||||
# forcesubject van be used to force a certain type of subject
|
||||
# Set artistmode to none, to exclude artists
|
||||
def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all", imagetype = "all", onlyartists = False, antivalues = "", prefixprompt = "", suffixprompt ="",promptcompounderlevel ="1", seperator = "comma", givensubject="",smartsubject = True,giventypeofimage="", imagemodechance = 20):
|
||||
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"):
|
||||
|
||||
|
||||
# load the config file
|
||||
@@ -32,7 +32,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
animallist = csv_to_list("animals",antilist)
|
||||
materiallist = csv_to_list("materials",antilist)
|
||||
objectlist = csv_to_list("objects",antilist)
|
||||
fictionallist = csv_to_list("fictional characters",antilist)
|
||||
fictionallist = csv_to_list(csvfilename="fictional characters",antilist=antilist,skipheader=True,gender=gender)
|
||||
nonfictionallist = csv_to_list("nonfictional characters",antilist)
|
||||
conceptsuffixlist = csv_to_list("concept_suffix",antilist)
|
||||
buildinglist = csv_to_list("buildings",antilist)
|
||||
@@ -62,8 +62,8 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
joblist = csv_to_list("jobs",antilist)
|
||||
lenslist = csv_to_list("lenses",antilist)
|
||||
lightinglist = csv_to_list("lighting",antilist)
|
||||
malefemalelist = csv_to_list("malefemale",antilist)
|
||||
manwomanlist = csv_to_list("manwoman",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)
|
||||
@@ -72,7 +72,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
timeperiodlist = csv_to_list("timeperiods",antilist)
|
||||
vomitlist = csv_to_list("vomit",antilist)
|
||||
foodlist = csv_to_list("foods", antilist)
|
||||
genderdescriptionlist = csv_to_list("genderdescription", 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)
|
||||
seasonlist = csv_to_list("seasons", antilist)
|
||||
@@ -85,7 +85,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
poemlinelist = csv_to_list("poemlines", antilist)
|
||||
songlinelist = csv_to_list("songlines", antilist)
|
||||
musicgenrelist = csv_to_list("musicgenres", antilist)
|
||||
manwomanrelationlist = csv_to_list("manwomanrelations", antilist)
|
||||
manwomanrelationlist = csv_to_list(csvfilename="manwomanrelations",antilist=antilist,skipheader=True,gender=gender)
|
||||
waterlocationlist = csv_to_list("waterlocations", antilist)
|
||||
containerlist = csv_to_list("containers", antilist)
|
||||
|
||||
|
||||
+23
-9
@@ -19,7 +19,7 @@ def add_from_csv(completeprompt, csvfilename, addcomma, prefix, suffix):
|
||||
return ", ".join([completeprompt,addtoprompt])
|
||||
return " ".join([completeprompt,addtoprompt])
|
||||
|
||||
def csv_to_list(csvfilename, antilist=[], directory="./csvfiles/", lowerandstrip=0, delimiter=";", listoflistmode = False):
|
||||
def csv_to_list(csvfilename, antilist=[], directory="./csvfiles/", lowerandstrip=0, delimiter=";", listoflistmode = False, skipheader = False, gender = "all"):
|
||||
userfilesdirectory = "./userfiles/"
|
||||
userfileaddonname = csvfilename + "_addon.csv"
|
||||
userfilereplacename = csvfilename + "_replace.csv"
|
||||
@@ -40,30 +40,44 @@ def csv_to_list(csvfilename, antilist=[], directory="./csvfiles/", lowerandstrip
|
||||
if(os.path.isfile(full_path + csvfilename + ".csv")):
|
||||
with open(full_path + csvfilename + ".csv", "r", newline="",encoding="utf8") as file:
|
||||
reader = csv.reader(file, delimiter=delimiter)
|
||||
if(skipheader==True):
|
||||
next(reader)
|
||||
if(listoflistmode==True):
|
||||
csvlist = list(reader)
|
||||
else:
|
||||
for row in reader:
|
||||
value = row[0]
|
||||
if(value.lower().strip() not in antilist):
|
||||
if(lowerandstrip == 1):
|
||||
csvlist.append(row[0].lower().strip())
|
||||
csvlist.append(row[0])
|
||||
if(
|
||||
(gender != "all" and row[1] == gender)
|
||||
or gender == "all"
|
||||
):
|
||||
if(value.lower().strip() not in antilist):
|
||||
if(lowerandstrip == 1):
|
||||
csvlist.append(row[0].lower().strip())
|
||||
else:
|
||||
csvlist.append(row[0])
|
||||
|
||||
# do the add ons!
|
||||
if(directory=="./csvfiles/" or directory=="./csvfiles/special_lists/"):
|
||||
if(os.path.isfile(userfilesfolder + csvfilename + "_addon" + ".csv")):
|
||||
with open(userfilesfolder + csvfilename + "_addon" + ".csv", "r", newline="",encoding="utf8") as file:
|
||||
reader = csv.reader(file, delimiter=",")
|
||||
if(skipheader==True):
|
||||
next(reader)
|
||||
if(listoflistmode==True):
|
||||
csvlist.append(list(reader))
|
||||
else:
|
||||
for row in reader:
|
||||
value = row[0]
|
||||
if(value.lower().strip() not in antilist):
|
||||
if(lowerandstrip == 1):
|
||||
csvlist.append(row[0].lower().strip())
|
||||
csvlist.append(row[0])
|
||||
if(
|
||||
(gender != "all" and row[1] == gender)
|
||||
or gender == "all"
|
||||
):
|
||||
if(value.lower().strip() not in antilist):
|
||||
if(lowerandstrip == 1):
|
||||
csvlist.append(row[0].lower().strip())
|
||||
else:
|
||||
csvlist.append(row[0])
|
||||
|
||||
|
||||
# remove duplicates, but check only for lowercase stuff
|
||||
|
||||
@@ -96,8 +96,8 @@ quality2chance;uncommon
|
||||
# custom style list (lora and tis);
|
||||
customstyle1chance;uncommon
|
||||
customstyle2chance;uncommon
|
||||
# suffix custom list#
|
||||
# suffix custom list;
|
||||
custominputsuffixrepeats;2
|
||||
custominputsuffixchance;uncommon
|
||||
# artists stuff
|
||||
# artists stuff;
|
||||
artistsatbackchance;uncommon
|
||||
|
+509
-508
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,4 @@
|
||||
feminine
|
||||
masculine
|
||||
androgynous
|
||||
description;gender
|
||||
feminine;female
|
||||
masculine;male
|
||||
androgynous;undetermined
|
||||
|
@@ -1,2 +1,3 @@
|
||||
Male
|
||||
Female
|
||||
malefemale;gender
|
||||
Male;male
|
||||
Female;female
|
||||
|
@@ -1,2 +1,3 @@
|
||||
Man
|
||||
Woman
|
||||
manwoman;gender
|
||||
Man;male
|
||||
Woman;female
|
||||
|
@@ -1,16 +1,17 @@
|
||||
Boy
|
||||
Girl
|
||||
Mother
|
||||
Father
|
||||
Grandma
|
||||
Grandpa
|
||||
Aunt
|
||||
Uncle
|
||||
Sister
|
||||
Brother
|
||||
Sibling
|
||||
Parent
|
||||
Wife
|
||||
Husband
|
||||
Girlfriend
|
||||
Boyfriend
|
||||
manwomanrelation;gender
|
||||
Boy;male
|
||||
Girl;female
|
||||
Mother;female
|
||||
Father;male
|
||||
Grandma;female
|
||||
Grandpa;male
|
||||
Aunt;female
|
||||
Uncle;male
|
||||
Sister;female
|
||||
Brother;male
|
||||
Sibling;undetermined
|
||||
Parent;undetermined
|
||||
Wife;female
|
||||
Husband;male
|
||||
Girlfriend;female
|
||||
Boyfriend;male
|
||||
|
Reference in New Issue
Block a user