work on enhance positive
This commit is contained in:
+53
-3
@@ -147,6 +147,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
episodetitlelist = csv_to_list(csvfilename="episodetitles",antilist=antilist,skipheader=True)
|
||||
tokenlist = []
|
||||
|
||||
|
||||
|
||||
# additional descriptor lists
|
||||
outfitdescriptorlist = csv_to_list("outfitdescriptors",antilist)
|
||||
@@ -286,8 +287,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
tokinatorlist = csv_to_list("tokinator", antilist,"./csvfiles/templates/",0,"?")
|
||||
styleslist = csv_to_list("styles", antilist,"./csvfiles/templates/",0,"?")
|
||||
|
||||
|
||||
|
||||
|
||||
# subjects
|
||||
mainchooserlist = []
|
||||
objectwildcardlist = []
|
||||
@@ -1673,7 +1673,7 @@ 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 and partlystylemode == False):
|
||||
completeprompt += " ,close up of a "
|
||||
completeprompt += " , close up of a "
|
||||
elif(mainchooser in ["landscape"] and generateshot == True and partlystylemode == False):
|
||||
completeprompt += " landscape of a "
|
||||
elif(generateshot == True):
|
||||
@@ -2658,6 +2658,9 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
|
||||
|
||||
|
||||
|
||||
# prompt enhancer!
|
||||
print("hello?")
|
||||
completeprompt = enhance_positive(completeprompt, insanitylevel)
|
||||
completeprompt += ", "
|
||||
completeprompt += suffixprompt
|
||||
|
||||
@@ -3888,6 +3891,53 @@ def build_dynamic_negative(positive_prompt = "", insanitylevel = 0, enhance = Fa
|
||||
|
||||
return negative_result
|
||||
|
||||
def enhance_positive(positive_prompt = "", insanitylevel = 5):
|
||||
|
||||
|
||||
wordcombilist = csv_to_list(csvfilename="wordcombis", directory="./csvfiles/special_lists/",delimiter="?")
|
||||
|
||||
allwords = split_prompt_to_words(positive_prompt)
|
||||
allwords = [elem.strip().lower() for elem in allwords] # lower them
|
||||
|
||||
newwordlist = []
|
||||
addwords = ""
|
||||
wordsfound = 0
|
||||
|
||||
#lower all!
|
||||
|
||||
for combiset in wordcombilist:
|
||||
|
||||
combiwords = set(combiset.split(', '))
|
||||
for combiword in combiwords:
|
||||
for word in allwords:
|
||||
if(word.lower() == combiword.lower()):
|
||||
|
||||
wordsfound += 1
|
||||
combiwords2 = set(combiset.split(', '))
|
||||
for combiword2 in combiwords2:
|
||||
newwordlist.append(combiword2)
|
||||
|
||||
|
||||
newprompt = "bla"
|
||||
|
||||
newwordlist = [word for word in newwordlist if word not in allwords]
|
||||
newwordlist = list(set(newwordlist)) # make unique
|
||||
|
||||
insanitylevel = max(0,insanitylevel - 6)
|
||||
|
||||
j = 0
|
||||
for i in range(0,wordsfound):
|
||||
if(random.randint(0,insanitylevel + j) == 0 and len(newwordlist) > 0):
|
||||
addwords += ", " + newwordlist.pop(random.randrange(len(newwordlist)))
|
||||
print(addwords)
|
||||
j += 1
|
||||
|
||||
|
||||
|
||||
positive_prompt += addwords
|
||||
|
||||
return positive_prompt
|
||||
|
||||
def replace_match(match):
|
||||
# Extract the first word from the match
|
||||
words = match.group(0)[1:-1].split('|')
|
||||
|
||||
@@ -14,4 +14,4 @@ gorgeous
|
||||
lovely
|
||||
magnificent
|
||||
pleasant
|
||||
pretty
|
||||
pretty
|
||||
|
@@ -515,4 +515,65 @@ Rollo from Vikings;male
|
||||
Goldilocks;female
|
||||
Glinda;female
|
||||
Robin Hood;male
|
||||
Lilith;female
|
||||
Lilith;female
|
||||
Moiraine Damodred;femala
|
||||
Dexter from dexter's lab;male
|
||||
Johnny Bravo;male
|
||||
Donald Duck;male
|
||||
Scrooge McDuck;male
|
||||
Daisy Duck;female
|
||||
Goofy;male
|
||||
Daffy Duck;male
|
||||
Sylvanas Windrunner;female
|
||||
Doomguy;male
|
||||
Guybrush Threepwood;male
|
||||
Tom Nook;male
|
||||
Cayde-6;male
|
||||
Chloe Price;female
|
||||
Deckard Cain;male
|
||||
Commander Shepard;genderless
|
||||
Rayman;male
|
||||
Ryu Hayabusa;male
|
||||
Ayane Hiragana;female
|
||||
Kasumi;female
|
||||
Gordon Freeman;male
|
||||
The Joker;male
|
||||
Harley Quinn;female
|
||||
GLaDOS;genderless
|
||||
Agent 47;male
|
||||
Sam Fisher;male
|
||||
Rayne from BloodRayne;female
|
||||
Sarah Kerrigan;female
|
||||
Megaman;male
|
||||
Max Payne;male
|
||||
Ivy Valentine;female
|
||||
Chell;female
|
||||
Ciri;female
|
||||
Yennefer of Vengerberg;female
|
||||
Cammy;female
|
||||
Aerith Gainsborough;female
|
||||
Lucky Chloe;female
|
||||
Jin Kazama;male
|
||||
Heihachi Mishima;male
|
||||
Akuma;male
|
||||
Eddy Gordo;male
|
||||
Lightning from FF13;female
|
||||
Pacman;male
|
||||
Jack Sparrow;male
|
||||
Cersei Lannister;female
|
||||
Austin Powers;male
|
||||
Bella Swan;female
|
||||
Beatrice Prior;female
|
||||
Beetlejuice;male
|
||||
Big bird;genderless
|
||||
Buffy Summers;female
|
||||
Bridget Jones;female
|
||||
Catwoman;female
|
||||
Charlie Brown;male
|
||||
Cheshire Cat;male
|
||||
Cookie Monster;male
|
||||
Daisy Duke;female
|
||||
Deadpool;male
|
||||
Doctor Evil;male
|
||||
Edward Cullen;male
|
||||
Jessica Rabbit;female
|
||||
|
@@ -240,4 +240,5 @@ Synthetic Leather and Geometric Patterns
|
||||
Anti-Radiation Fabric and Neoprene
|
||||
Smart Glass and Weather-Resistant Textiles
|
||||
Silicon Rubber and Reflective Strips
|
||||
Liquid Crystal Polymer and Ultra-Thin Alloy
|
||||
Liquid Crystal Polymer and Ultra-Thin Alloy
|
||||
Lilac and Gooseberry's
|
||||
|
@@ -57,6 +57,7 @@ faded;bright, sunny, light, vibrant, colorful
|
||||
noir;bright, sunny, light, vibrant, colorful
|
||||
horror;bright, sunny, light, vibrant, colorful, beautiful, cute
|
||||
monster;beautiful, cute, adorable
|
||||
monstrous;beautiful, cute, adorable
|
||||
creepy;beautiful, cute, adorable
|
||||
luminism;monochromatic, washed out
|
||||
fortnite;photograph, realism, photorealism
|
||||
|
||||
|
@@ -0,0 +1,21 @@
|
||||
alluring, appealing, attractive, beautiful, charming, cozy, cute, elegant, exquisite, flawless, glamourous, good-looking, gorgeous, lovely, magnificent, pleasant, pretty
|
||||
gothic, dark, moody, monochromatic, ugly, gritty, grim, macabre, goth, horror
|
||||
cute, kawaii, chibi, endearing, appealing, tiny, lovable, sweet, innocent
|
||||
photograph, realism, photorealism, photography, photo, RAW photo
|
||||
industrial, mechanical, photorealism, modernist, minimalist
|
||||
vibrant, colorful, vivid, expressive, rainbow
|
||||
dramatic, epic
|
||||
dynamic, action
|
||||
ordinary, mundane, plain, common, boring, drab
|
||||
unattractive, ugly, amateurish
|
||||
organic, flora, fauna, nature, nature-inspired
|
||||
dream, dreamy, dreamlike, magic, magical, fantastic, fairy tale
|
||||
simple, minimalist, minimalistic
|
||||
futuristic, sci fi, sci-fi, modern
|
||||
portrait, close up, close-up
|
||||
fashionable, fashion, haute couture
|
||||
concept art, fantasy, sci-fi
|
||||
cinema, cinematic, cinestill, movie still
|
||||
anime, manga
|
||||
funny, whimsical, fun
|
||||
authentic, traditional, classic
|
||||
|
@@ -0,0 +1,36 @@
|
||||
import sys, os
|
||||
import random
|
||||
import uuid
|
||||
import re
|
||||
from datetime import datetime
|
||||
sys.path.append(os.path.abspath(".."))
|
||||
|
||||
|
||||
from build_dynamic_prompt import *
|
||||
|
||||
|
||||
|
||||
def generateprompts(amount = 1,positive_prompt = "",insanitylevel="0",enhance=False,existing_negative_prompt=""):
|
||||
loops = int(amount) # amount of images to generate
|
||||
steps = 0
|
||||
originalpositiveprompt = positive_prompt
|
||||
|
||||
insanitylevel = int(insanitylevel)
|
||||
while steps < loops:
|
||||
# build prompt
|
||||
if originalpositiveprompt == "":
|
||||
positive_prompt = build_dynamic_prompt(insanitylevel=insanitylevel)
|
||||
result = enhance_positive(positive_prompt=positive_prompt, insanitylevel=insanitylevel)
|
||||
print("enhanced prompt: " + result)
|
||||
print("")
|
||||
print("loop " + str(steps))
|
||||
print("")
|
||||
|
||||
|
||||
steps += 1
|
||||
|
||||
|
||||
print("")
|
||||
print("All done!")
|
||||
|
||||
generateprompts(10,"",5,False,"")
|
||||
Reference in New Issue
Block a user