busy with gender

This commit is contained in:
AIrjen
2023-07-07 14:15:54 +02:00
parent d9fc65013a
commit edebb8a824
4 changed files with 1185 additions and 1167 deletions
+3 -1
View File
@@ -33,7 +33,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
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("nonfictional characters",antilist)
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)
@@ -1296,6 +1296,8 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
hybridorswap = ""
if(subjectchooser == "humanoid"):
if(gender != "all"):
completeprompt += "-malefemale- "
if rare_dist(insanitylevel):
hybridorswaplist = ["hybrid", "swap"]
hybridorswap = random.choice(hybridorswaplist)
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -10,7 +10,7 @@ from build_dynamic_prompt import *
def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", imagetype="all",onlyartists=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20):
def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", imagetype="all",onlyartists=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20, gender = "all"):
loops = int(amount) # amount of images to generate
steps = 0
@@ -18,7 +18,7 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im
while steps < loops:
# build prompt
result = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, onlyartists,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance)
result = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, onlyartists,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender)
print("")
print("loop " + str(steps))
@@ -46,4 +46,4 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im
print("")
print("All done!")
generateprompts(10,5,"humanoid","all","all",False,"","","PREFIXPROMPT" ,"SUFFIXPROMPT","",1,"","",True,"",100)
generateprompts(10,5,"humanoid","all","all",False,"","","PREFIXPROMPT" ,"SUFFIXPROMPT","",1,"","",True,"",100, "female")
+16 -1
View File
@@ -22,6 +22,7 @@ promptmode = ["at the back", "in the front"]
promptcompounder = ["1", "2", "3", "4", "5"]
ANDtogglemode = ["none", "automatic", "prefix AND prompt + suffix", "prefix + prefix + prompt + suffix"]
seperatorlist = ["comma", "AND", "BREAK"]
genders = ["all", "male", "female"]
#for autorun and upscale
sizelist = ["all", "portrait", "wide", "square", "ultrawide"]
@@ -143,8 +144,10 @@ class Script(scripts.Script):
with gr.Row():
givensubject = gr.Textbox(label="Overwrite subject: ", value="")
smartsubject = gr.Checkbox(label="Smart subject", value = True)
with gr.Row():
giventypeofimage = gr.Textbox(label="Overwrite type of image: ", value="")
with gr.Row():
chosengender = gr.Dropdown(
genders, "gender", value="all", visible=False)
with gr.Row():
gr.Markdown("""
<font size="2">
@@ -570,6 +573,18 @@ class Script(scripts.Script):
startmain.click(generateimages, inputs=[amountofimages,size,model,samplingsteps,cfg,hiresfix,hiressteps,denoisestrength,samplingmethod, upscaler,hiresscale, apiurl, qualitygate, quality, runs,insanitylevel,subject, artist, imagetype, silentmode, workprompt, antistring, prefixprompt, suffixprompt,negativeprompt,promptcompounderlevel, seperator, img2imgbatch, img2imgsamplingsteps, img2imgcfg, img2imgsamplingmethod, img2imgupscaler, img2imgmodel,img2imgactivate, img2imgscale, img2imgpadding,img2imgdenoisestrength,ultimatesdupscale,usdutilewidth, usdutileheight, usdumaskblur, usduredraw, usduSeamsfix, usdusdenoise, usduswidth, usduspadding, usdusmaskblur, controlnetenabled, controlnetmodel,img2imgdenoisestrengthmod,enableextraupscale,controlnetblockymode,extrasupscaler1,extrasupscaler2,extrasupscaler2visiblity,extrasupscaler2gfpgan,extrasupscaler2codeformer,extrasupscaler2codeformerweight,extrasresize,onlyupscale,givensubject,smartsubject,giventypeofimage,imagemodechance])
automatedoutputsfolderbutton.click(openfolder)
# turn things on and off for gender
def subjectsvalue(subject):
enable=(subject=="humanoid")
return {
chosengender: gr.update(visible=enable),
}
subject.change(
subjectsvalue,
[subject],
[chosengender]
)
# Turn things off and on for onlyupscale and txt2img
def onlyupscalevalues(onlyupscale):