From 21e5c21b6d265b22997634026901999a462c448e Mon Sep 17 00:00:00 2001 From: AIrjen Date: Mon, 8 Jan 2024 20:53:21 +0100 Subject: [PATCH] more styles added semi-style mode in the generation process --- build_dynamic_prompt.py | 30 ++++++++++++++-- csvfiles/fictional characters.csv | 3 +- csvfiles/special_lists/negativewords.csv | 1 + csvfiles/templates/styles.csv | 46 +++++++++++++++++++++++- 4 files changed, 75 insertions(+), 5 deletions(-) diff --git a/build_dynamic_prompt.py b/build_dynamic_prompt.py index 36c0a5a..cab00ac 100644 --- a/build_dynamic_prompt.py +++ b/build_dynamic_prompt.py @@ -25,6 +25,8 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all originalartistchoice = artists doartistnormal = True + + partlystylemode = False # load the config file config = load_config_csv() @@ -1556,8 +1558,17 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all # or "landscape" in artists): # completeprompt += " landscape, " - # woops, never to this as wildcards. We need to know as early as possible wether something is a photo. Lets put it back! + + + if(amountofimagetypes < 2 and random.randint(0,int(imagemodechance/3)) == 0): + partlystylemode = True + chosenstyle = random.choice(styleslist) + chosenstyleprefix = chosenstyle.split("-subject-")[0] + chosenstylesuffix = chosenstyle.split("-subject-")[1] + + completeprompt += " " + chosenstyleprefix + ", " elif(random.randint(0,5) < 5): + # woops, never to this as wildcards. We need to know as early as possible wether something is a photo. Lets put it back! completeprompt += " " + random.choice(imagetypelist) + ", " else: othertype = 1 @@ -1593,9 +1604,9 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all 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): + elif("portrait" in completeprompt and generateshot == True and partlystylemode == False): completeprompt += " ,close up of a " - elif(mainchooser in ["landscape"] and generateshot == True): + elif(mainchooser in ["landscape"] and generateshot == True and partlystylemode == False): completeprompt += " landscape of a " elif(generateshot == True): completeprompt += ", " @@ -2546,6 +2557,19 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all + if(partlystylemode == True): + # add a part of the style to the back + chosenstylesuffixlist = chosenstylesuffix.split(",") + for i in range(len(chosenstylesuffixlist)): + if(random.randint(3, 10)