Fix for only artists

and warning in Gradio
This commit is contained in:
AIrjen
2023-11-12 10:32:11 +01:00
parent 4efd566f52
commit 9787587afa
4 changed files with 21 additions and 6 deletions
+16 -1
View File
@@ -719,7 +719,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
# determine wether we have a special mode or not
if(random.randint(1,int(imagemodechance)) == 1 and imagetype == "all" and giventypeofimage == ""):
if(random.randint(1,int(imagemodechance)) == 1 and imagetype == "all" and giventypeofimage == "" and onlyartists == False):
imagetype = random.choice(imagetypemodelist) # override imagetype with a random "mode" value
@@ -1497,10 +1497,25 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
if(onlyartists == True):
#Parse or statements
completeprompt = parse_custom_functions(completeprompt, insanitylevel)
# replace artist wildcards
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)
# clean it up
completeprompt = cleanup(completeprompt, advancedprompting, insanitylevel)
+1 -1
View File
@@ -3,7 +3,7 @@ has OR(;large;small;giant;tiny;normal) OR(;Leather;normal) OR(belt;strap)OR(;s;n
has OR(Metal;Iron;Diamond;Steel;metallic;-materialcombination-) OR(plates;plating)
has a crest on chest
OR(is zipped up;is unzipped;is partially unzipped;zipper;buttons;is buttoned up;is partially unbuttoned;is unbuttoned)
has OR(;large;small;giant;tiny;normal) (zipper;button;buttons;zippers)
has OR(;large;small;giant;tiny;normal) OR(zipper;button;buttons;zippers)
is OR(off-the-shoulder;strapless;cropped;ruffled)
is OR(;very;normal) OR(large;small;tight;loose;baggy;delicate;wet;-outfitdescriptor-)
is made from OR(satin;curderoy;lace;cotton;metal;-materialcombination-)
1 has OR(;large;small;giant;tiny;normal) OR(;-color-;normal) bowOR(;s;normal)
3 has OR(Metal;Iron;Diamond;Steel;metallic;-materialcombination-) OR(plates;plating)
4 has a crest on chest
5 OR(is zipped up;is unzipped;is partially unzipped;zipper;buttons;is buttoned up;is partially unbuttoned;is unbuttoned)
6 has OR(;large;small;giant;tiny;normal) (zipper;button;buttons;zippers) has OR(;large;small;giant;tiny;normal) OR(zipper;button;buttons;zippers)
7 is OR(off-the-shoulder;strapless;cropped;ruffled)
8 is OR(;very;normal) OR(large;small;tight;loose;baggy;delicate;wet;-outfitdescriptor-)
9 is made from OR(satin;curderoy;lace;cotton;metal;-materialcombination-)
+2 -2
View File
@@ -88,11 +88,11 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im
print("")
print("All done!")
generateprompts(100,5
generateprompts(10,5
,"" # subject
,"all" # artists
,"all" # image type "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", "fixed styles mode"
, False # only artists
, True # only artists
,"","","PREFIXPROMPT"
,"SUFFIXPROMPT"
,"",1,""
+2 -2
View File
@@ -697,10 +697,10 @@ class Script(scripts.Script):
sizelist, label="Size to generate", value="all")
basesize = gr.Dropdown(
basesizelist, label="base size", value="512")
with gr.Row(scale=1):
with gr.Row():
samplingsteps = gr.Slider(1, 100, value="20", step=1, label="Sampling steps")
cfg = gr.Slider(1,20, value="6.0", step=0.1, label="CFG")
with gr.Row(scale=1):
with gr.Row():
hiresfix = gr.Checkbox(label="hires. fix", value=True)
hiressteps = gr.Slider(0, 100, value = "0", step=1, label="Hires steps")
hiresscale = gr.Slider(1, 4, value = "2", step=0.05, label="Scale")