added subtype options + interface changes

This commit is contained in:
AIrjen
2023-07-08 11:04:56 +02:00
parent 5b16e878e9
commit b9d59b927d
5 changed files with 225 additions and 24 deletions
+36 -3
View File
@@ -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, gender = "all"):
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"):
# load the config file
@@ -872,11 +872,33 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
if(mainchooser == "humanoid"):
#humanoidsubjectchooserlist = ["human", "job", "fictional", "non fictional", "humanoid", "manwomanrelation"]
subjectchooser = random.choice(humanoidsubjectchooserlist)
if(subtypehumanoid != "all"):
if(subtypehumanoid == "generic humans"):
subjectchooser = "human"
if(subtypehumanoid == "generic human relations"):
subjectchooser = "manwomanrelation"
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(mainchooser == "landscape"):
subjectchooser = "landscape"
if(mainchooser == "concept"):
#eventsubjectchooserlist = ["event", "concept"]
#eventsubjectchooserlist = ["event", "concept", "poemline", "songline"]
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"
@@ -1189,7 +1211,18 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
completeprompt += "-culture- "
if(mainchooser == "object"):
objectwildcardlist = ["-object-", "-building-","-vehicle-","-food-", "-space-"] # using wildcards for replacements
# if we have an overwrite, then make sure we only take the override
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 we have a given subject, we should skip making an actual subject
if(givensubject == ""):
+2 -2
View File
@@ -12,7 +12,7 @@ from call_extras import *
from model_lists import *
def generateimages(amount = 1, size = "all",model = "currently selected model",samplingsteps = "40",cfg= "7",hiresfix = True,hiressteps ="0",denoisestrength="0.6",samplingmethod="DPM++ SDE Karras", upscaler="R-ESRGAN 4x+", hiresscale="2",apiurl="http://127.0.0.1:7860",qualitygate=False,quality="7.6",runs="5",insanitylevel="5",subject="all", artist="all", imagetype="all",silentmode=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma", img2imgbatch = "1", img2imgsamplingsteps = "20", img2imgcfg = "7", img2imgsamplingmethod = "DPM++ SDE Karras", img2imgupscaler = "R-ESRGAN 4x+", img2imgmodel = "currently selected model", img2imgactivate = False, img2imgscale = "2", img2imgpadding = "64",img2imgdenoisestrength="0.3",ultimatesdupscale=False,usdutilewidth = "512", usdutileheight = "0", usdumaskblur = "8", usduredraw ="Linear", usduSeamsfix = "None", usdusdenoise = "0.35", usduswidth = "64", usduspadding ="32", usdusmaskblur = "8",controlnetenabled=False, controlnetmodel="",img2imgdenoisestrengthmod="-0.05",enableextraupscale = False,controlnetblockymode = False,extrasupscaler1 = "all",extrasupscaler2 ="all",extrasupscaler2visiblity="0.5",extrasupscaler2gfpgan="0",extrasupscaler2codeformer="0.15",extrasupscaler2codeformerweight="0.1",extrasresize="2",onlyupscale="false",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20, gender="all"):
def generateimages(amount = 1, size = "all",model = "currently selected model",samplingsteps = "40",cfg= "7",hiresfix = True,hiressteps ="0",denoisestrength="0.6",samplingmethod="DPM++ SDE Karras", upscaler="R-ESRGAN 4x+", hiresscale="2",apiurl="http://127.0.0.1:7860",qualitygate=False,quality="7.6",runs="5",insanitylevel="5",subject="all", artist="all", imagetype="all",silentmode=False, workprompt="", antistring="",prefixprompt="", suffixprompt="", negativeprompt="",promptcompounderlevel = "1", seperator="comma", img2imgbatch = "1", img2imgsamplingsteps = "20", img2imgcfg = "7", img2imgsamplingmethod = "DPM++ SDE Karras", img2imgupscaler = "R-ESRGAN 4x+", img2imgmodel = "currently selected model", img2imgactivate = False, img2imgscale = "2", img2imgpadding = "64",img2imgdenoisestrength="0.3",ultimatesdupscale=False,usdutilewidth = "512", usdutileheight = "0", usdumaskblur = "8", usduredraw ="Linear", usduSeamsfix = "None", usdusdenoise = "0.35", usduswidth = "64", usduspadding ="32", usdusmaskblur = "8",controlnetenabled=False, controlnetmodel="",img2imgdenoisestrengthmod="-0.05",enableextraupscale = False,controlnetblockymode = False,extrasupscaler1 = "all",extrasupscaler2 ="all",extrasupscaler2visiblity="0.5",extrasupscaler2gfpgan="0",extrasupscaler2codeformer="0.15",extrasupscaler2codeformerweight="0.1",extrasresize="2",onlyupscale="false",givensubject="",smartsubject=True,giventypeofimage="",imagemodechance=20, gender="all", chosensubjectsubtypeobject="all", chosensubjectsubtypehumanoid="all", chosensubjectsubtypeconcept="all"):
loops = int(amount) # amount of images to generate
steps = 0
upscalefilelist=[]
@@ -70,7 +70,7 @@ def generateimages(amount = 1, size = "all",model = "currently selected model",s
print(workprompt)
else:
randomprompt = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, False,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender)
randomprompt = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, False,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept)
# make the filename, from from a to the first comma
start_index = randomprompt.find("of a ") + len("of a ")
+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, gender = "all"):
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", subtypeobject = "all", subtypehumanoid = "all", subtypeconcept = "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, gender)
result = build_dynamic_prompt(insanitylevel,subject,artist,imagetype, onlyartists,antistring,prefixprompt,suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance, gender, subtypeobject, subtypehumanoid, subtypeconcept)
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, "female")
generateprompts(10,5,"humanoid","all","all",False,"","","PREFIXPROMPT" ,"SUFFIXPROMPT","",1,"","",True,"",100, "female", "all", "fictional characters", "all")
+6 -2
View File
@@ -35,12 +35,16 @@ def one_button_prompt_api(_: gr.Blocks, app: FastAPI):
smartsubject:bool = Body(True,title='smart subject'),
giventypeofimage: str = Body('',title='given type of image'),
imagemodechance: int = Body(20,title='image mode chance'),
gender: str = Body('all',title="gender")):
gender: str = Body('all',title='gender'),
subtypeobject: str = Body('all',title='subtypeobject'),
subtypehumanoid: str = Body('all', title='subtypehumanoid'),
subtypeconcept: str = Body('all', title='subtypeconcept')
):
keys = ['insanitylevel', 'forcesubject', 'artists', 'imagetype', 'onlyartists', 'antivalues', 'prefixprompt',
'suffixprompt', 'promptcompounderlevel', 'seperator', 'givensubject', 'smartsubject', 'giventypeofimage',
'imagemodechance', 'gender']
'imagemodechance', 'gender', 'subtypeobject','subtypehumanoid','subtypeconcept']
payload = {}
for key in keys:
payload[key] = locals()[key]
+178 -14
View File
@@ -15,7 +15,12 @@ from main import *
from model_lists import *
from csv_reader import *
subjects = ["all","object","animal","humanoid", "landscape", "concept"]
#subjects = ["all","object","animal","humanoid", "landscape", "concept"]
subjects =["all"]
subjectsubtypesobject = ["all"]
subjectsubtypeshumanoid = ["all"]
subjectsubtypesconcept = ["all"]
artists = ["all", "none", "popular", "greg mode", "3D", "abstract", "angular", "anime" ,"architecture", "art nouveau", "art deco", "baroque", "bauhaus", "cartoon", "character", "children's illustration", "cityscape", "clean", "cloudscape", "collage", "colorful", "comics", "cubism", "dark", "detailed", "digital", "expressionism", "fantasy", "fashion", "fauvism", "figurativism", "gore", "graffiti", "graphic design", "high contrast", "horror", "impressionism", "installation", "landscape", "light", "line drawing", "low contrast", "luminism", "magical realism", "manga", "melanin", "messy", "monochromatic", "nature", "nudity", "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"]
imagetypes = ["all", "all - force multiple", "photograph", "octane render","digital art","concept art", "painting", "portrait", "anime key visual", "only other types", "only templates mode", "art blaster mode", "quality vomit mode", "color cannon mode", "unique art mode", "massive madness mode", "photo fantasy mode", "subject only mode"]
promptmode = ["at the back", "in the front"]
@@ -67,8 +72,124 @@ for filename in os.listdir(userfilesfolder):
artists.insert(2, name)
# on startup, check if we have a config file, or else create it
load_config_csv()
config = load_config_csv()
# load subjects stuff from config
generatevehicle = True
generateobject = True
generatefood = True
generatebuilding = True
generatespace = True
generateanimal = True
generatemanwoman = True
generatemanwomanrelation = True
generatefictionalcharacter = True
generatenonfictionalcharacter = True
generatehumanoids = True
generatejob = True
generatelandscape = True
generateevent = True
generateconcepts = True
generatepoemline = True
generatesongline = True
for item in config:
# objects
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
# animals
if item[0] == 'subject_animal' and item[1] != 'on':
generateanimal = False
# humanoids
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_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
# landscape
if item[0] == 'subject_landscape' and item[1] != 'on':
generatelandscape = False
# concept
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] == 'poemline' and item[1] != 'on':
generatepoemline = False
if item[0] == 'songline' and item[1] != 'on':
generatesongline = False
# build up all subjects we can choose based on the loaded config file
if(generatevehicle or generateobject or generatefood or generatebuilding or generatespace):
subjects.append("object")
if(generateanimal):
subjects.append("animal")
if(generatemanwoman or generatemanwomanrelation or generatefictionalcharacter or generatenonfictionalcharacter or generatehumanoids or generatejob):
subjects.append("humanoid")
if(generatelandscape):
subjects.append("landscape")
if(generateevent or generateconcepts or generatepoemline or generatesongline):
subjects.append("concept")
# do the same for the subtype subjects
# subjectsubtypesobject = ["all"]
# subjectsubtypeshumanoid = ["all"]
# subjectsubtypesconcept = ["all"]
# objects first
if(generateobject):
subjectsubtypesobject.append("generic objects")
if(generatevehicle):
subjectsubtypesobject.append("vehicles")
if(generatefood):
subjectsubtypesobject.append("food")
if(generatebuilding):
subjectsubtypesobject.append("buildings")
if(generatespace):
subjectsubtypesobject.append("space")
# humanoids (should I review descriptions??)
if(generatemanwoman):
subjectsubtypeshumanoid.append("generic humans")
if(generatemanwomanrelation):
subjectsubtypeshumanoid.append("generic human relations")
if(generatenonfictionalcharacter):
subjectsubtypeshumanoid.append("celebrities e.a.")
if(generatefictionalcharacter):
subjectsubtypeshumanoid.append("fictional characters")
if(generatehumanoids):
subjectsubtypeshumanoid.append("humanoids")
if(generatejob):
subjectsubtypeshumanoid.append("based on job or title")
# concepts
if(generateevent):
subjectsubtypesconcept.append("event")
if(generateconcepts):
subjectsubtypesconcept.append("the X of Y concepts")
if(generatepoemline):
subjectsubtypesconcept.append("lines from poems")
if(generatesongline):
subjectsubtypesconcept.append("lines from songs")
class Script(scripts.Script):
@@ -80,12 +201,12 @@ class Script(scripts.Script):
def ui(self, is_img2img):
def gen_prompt(insanitylevel, subject, artist, imagetype, antistring, prefixprompt, suffixprompt, promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage, imagemodechance,chosengender):
def gen_prompt(insanitylevel, subject, artist, imagetype, antistring, prefixprompt, suffixprompt, promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage, imagemodechance,chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept):
promptlist = []
for i in range(5):
promptlist.append(build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring,prefixprompt,suffixprompt,promptcompounderlevel,seperator,givensubject,smartsubject, giventypeofimage, imagemodechance,chosengender))
promptlist.append(build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring,prefixprompt,suffixprompt,promptcompounderlevel,seperator,givensubject,smartsubject, giventypeofimage, imagemodechance,chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept))
return promptlist
@@ -128,6 +249,12 @@ class Script(scripts.Script):
artist = gr.Dropdown(
artists, label="Artists", value="all")
with gr.Row():
chosensubjectsubtypeobject = gr.Dropdown(
subjectsubtypesobject, label="Type of object", value="all", visible=False)
chosensubjectsubtypehumanoid = gr.Dropdown(
subjectsubtypeshumanoid, label="Type of humanoids", value="all", visible=False)
chosensubjectsubtypeconcept = gr.Dropdown(
subjectsubtypesconcept, label="Type of concept", value="all", visible=False)
chosengender = gr.Dropdown(
genders, label="gender", value="all", visible=False)
with gr.Row():
@@ -147,8 +274,6 @@ 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():
gr.Markdown("""
<font size="2">
@@ -168,6 +293,8 @@ class Script(scripts.Script):
</font>
"""
)
with gr.Row():
giventypeofimage = gr.Textbox(label="Overwrite type of image: ", value="")
with gr.Row():
with gr.Column():
antistring = gr.Textbox(label="Filter out following properties (comma seperated). Example ""film grain, purple, cat"" ")
@@ -415,11 +542,11 @@ class Script(scripts.Script):
"""
### TXT2IMG
<font size="2">
Start WebUi with option --api for this to work. This is not needed for Vlad.
Start WebUi with option --api for this to work. This is not needed for Vlad SD Next.
Note: This part is entirely optional and you can use the normal generate button.
This part is intended for running an upscaling at the same time.
This part is only intended for running an upscaling at the same time.
</font>
"""
)
@@ -563,7 +690,7 @@ class Script(scripts.Script):
extrasupscaler2codeformerweight = gr.Slider(0, 1, value="0.1", step=0.05, label="CodeFormer weight", visible = False)
genprom.click(gen_prompt, inputs=[insanitylevel,subject, artist, imagetype, antistring,prefixprompt, suffixprompt,promptcompounderlevel, seperator, givensubject,smartsubject,giventypeofimage,imagemodechance, chosengender], outputs=[prompt1, prompt2, prompt3,prompt4,prompt5])
genprom.click(gen_prompt, inputs=[insanitylevel,subject, artist, imagetype, antistring,prefixprompt, suffixprompt,promptcompounderlevel, seperator, givensubject,smartsubject,giventypeofimage,imagemodechance, chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept], outputs=[prompt1, prompt2, prompt3,prompt4,prompt5])
prompt1toworkflow.click(prompttoworkflowprompt, inputs=prompt1, outputs=workprompt)
prompt2toworkflow.click(prompttoworkflowprompt, inputs=prompt2, outputs=workprompt)
@@ -571,7 +698,7 @@ class Script(scripts.Script):
prompt4toworkflow.click(prompttoworkflowprompt, inputs=prompt4, outputs=workprompt)
prompt5toworkflow.click(prompttoworkflowprompt, inputs=prompt5, outputs=workprompt)
startmain.click(generateimages, inputs=[amountofimages,size,model,samplingsteps,cfg,hiresfix,hiressteps,denoisestrength,samplingmethod, upscaler,hiresscale, apiurl, qualitygate, quality, runs,insanitylevel,subject, artist, imagetype, silentmode, workprompt, antistring, prefixprompt, suffixprompt,negativeprompt,promptcompounderlevel, seperator, img2imgbatch, img2imgsamplingsteps, img2imgcfg, img2imgsamplingmethod, img2imgupscaler, img2imgmodel,img2imgactivate, img2imgscale, img2imgpadding,img2imgdenoisestrength,ultimatesdupscale,usdutilewidth, usdutileheight, usdumaskblur, usduredraw, usduSeamsfix, usdusdenoise, usduswidth, usduspadding, usdusmaskblur, controlnetenabled, controlnetmodel,img2imgdenoisestrengthmod,enableextraupscale,controlnetblockymode,extrasupscaler1,extrasupscaler2,extrasupscaler2visiblity,extrasupscaler2gfpgan,extrasupscaler2codeformer,extrasupscaler2codeformerweight,extrasresize,onlyupscale,givensubject,smartsubject,giventypeofimage,imagemodechance, chosengender])
startmain.click(generateimages, inputs=[amountofimages,size,model,samplingsteps,cfg,hiresfix,hiressteps,denoisestrength,samplingmethod, upscaler,hiresscale, apiurl, qualitygate, quality, runs,insanitylevel,subject, artist, imagetype, silentmode, workprompt, antistring, prefixprompt, suffixprompt,negativeprompt,promptcompounderlevel, seperator, img2imgbatch, img2imgsamplingsteps, img2imgcfg, img2imgsamplingmethod, img2imgupscaler, img2imgmodel,img2imgactivate, img2imgscale, img2imgpadding,img2imgdenoisestrength,ultimatesdupscale,usdutilewidth, usdutileheight, usdumaskblur, usduredraw, usduSeamsfix, usdusdenoise, usduswidth, usduspadding, usdusmaskblur, controlnetenabled, controlnetmodel,img2imgdenoisestrengthmod,enableextraupscale,controlnetblockymode,extrasupscaler1,extrasupscaler2,extrasupscaler2visiblity,extrasupscaler2gfpgan,extrasupscaler2codeformer,extrasupscaler2codeformerweight,extrasresize,onlyupscale,givensubject,smartsubject,giventypeofimage,imagemodechance, chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept])
automatedoutputsfolderbutton.click(openfolder)
@@ -586,7 +713,44 @@ class Script(scripts.Script):
[subject],
[chosengender]
)
# turn things on and off for subject subtype object
def subjectsvalueforsubtypeobject(subject):
enable=(subject=="object")
return {
chosensubjectsubtypeobject: gr.update(visible=enable),
}
subject.change(
subjectsvalueforsubtypeobject,
[subject],
[chosensubjectsubtypeobject]
)
# turn things on and off for subject subtype humanoid
def subjectsvalueforsubtypeobject(subject):
enable=(subject=="humanoid")
return {
chosensubjectsubtypehumanoid: gr.update(visible=enable),
}
subject.change(
subjectsvalueforsubtypeobject,
[subject],
[chosensubjectsubtypehumanoid]
)
# turn things on and off for subject subtype concept
def subjectsvalueforsubtypeconcept(subject):
enable=(subject=="concept")
return {
chosensubjectsubtypeconcept: gr.update(visible=enable),
}
subject.change(
subjectsvalueforsubtypeconcept,
[subject],
[chosensubjectsubtypeconcept]
)
# Turn things off and on for onlyupscale and txt2img
def onlyupscalevalues(onlyupscale):
onlyupscale = not onlyupscale
@@ -689,12 +853,12 @@ class Script(scripts.Script):
return [insanitylevel,subject, artist, imagetype, prefixprompt,suffixprompt,negativeprompt, promptcompounderlevel, ANDtoggle, silentmode, workprompt, antistring, seperator, givensubject, smartsubject, giventypeofimage, imagemodechance, chosengender]
return [insanitylevel,subject, artist, imagetype, prefixprompt,suffixprompt,negativeprompt, promptcompounderlevel, ANDtoggle, silentmode, workprompt, antistring, seperator, givensubject, smartsubject, giventypeofimage, imagemodechance, chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept]
def run(self, p, insanitylevel, subject, artist, imagetype, prefixprompt,suffixprompt,negativeprompt, promptcompounderlevel, ANDtoggle, silentmode, workprompt, antistring,seperator, givensubject, smartsubject, giventypeofimage, imagemodechance, chosengender):
def run(self, p, insanitylevel, subject, artist, imagetype, prefixprompt,suffixprompt,negativeprompt, promptcompounderlevel, ANDtoggle, silentmode, workprompt, antistring,seperator, givensubject, smartsubject, giventypeofimage, imagemodechance, chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept):
images = []
infotexts = []
@@ -766,7 +930,7 @@ class Script(scripts.Script):
#Here is where we build a "normal" prompt
preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance,chosengender)
preppedprompt += build_dynamic_prompt(insanitylevel,subject,artist, imagetype, False, antistring, prefixprompt, suffixprompt,promptcompounderlevel, seperator,givensubject,smartsubject,giventypeofimage,imagemodechance,chosengender, chosensubjectsubtypeobject, chosensubjectsubtypehumanoid, chosensubjectsubtypeconcept)
# set the artist mode back when done (for automatic mode)
artist = artistcopy