getting there!

This commit is contained in:
AIrjen
2024-03-30 09:49:02 +01:00
parent 38d41dc51e
commit b211040537
5 changed files with 85 additions and 26 deletions
+51 -24
View File
@@ -3273,7 +3273,7 @@ def build_dynamic_prompt(insanitylevel = 5, forcesubject = "all", artists = "all
prompt_g = cleanup(promptlist[1], advancedprompting, insanitylevel)
prompt_l = cleanup((promptlist[0] + ", " + promptlist[2]).replace("of a",""), advancedprompting, insanitylevel)
if("@@@" in completeprompt and superprompter == True):
load_models()
#load_models()
promptlist = completeprompt.split("@@@")
subjectprompt = cleanup(promptlist[1], advancedprompting, insanitylevel)
superpromptresult = one_button_superprompt(insanitylevel=insanitylevel, prompt=subjectprompt, seed=seed, override_subject=givensubject, override_outfit=overrideoutfit)
@@ -4706,9 +4706,13 @@ def split_prompt_to_words(text):
def one_button_superprompt(insanitylevel = 5, prompt = "", seed = -1, override_subject = "" , override_outfit = ""):
if(seed <= 0):
seed = 1
seed = random.randint(1,1000000)
done = False
load_models()
superprompterstyleslist = csv_to_list("superprompter_styles")
descriptorlist = csv_to_list("descriptors")
temperature_lookup = {
1: 0.001,
@@ -4724,14 +4728,14 @@ def one_button_superprompt(insanitylevel = 5, prompt = "", seed = -1, override_s
}
max_new_tokens_lookup = {
1: 80,
2: 80,
3: 90,
4: 90,
5: 100,
6: 100,
7: 120,
8: 120,
1: 25,
2: 30,
3: 35,
4: 40,
5: 50,
6: 70,
7: 90,
8: 100,
9: 150,
10: 255
}
@@ -4753,10 +4757,10 @@ def one_button_superprompt(insanitylevel = 5, prompt = "", seed = -1, override_s
1: 0.1,
2: 0.5,
3: 1.0,
4: 1.5,
5: 2.0,
6: 2.5,
7: 3.0,
4: 1.25,
5: 1.5,
6: 1.75,
7: 2.0,
8: 4.0,
9: 7.0,
10: 15.0
@@ -4766,14 +4770,26 @@ def one_button_superprompt(insanitylevel = 5, prompt = "", seed = -1, override_s
temperature = temperature_lookup.get(insanitylevel, 0.5)
max_new_tokens = max_new_tokens_lookup.get(insanitylevel, 75)
top_p = top_p_lookup.get(insanitylevel, 5.0)
if(uncommon_dist(insanitylevel)):
question = "Expand the following prompt to make it more " + random.choice(descriptorlist)
elif(normal_dist(insanitylevel)):
question = "Expand the following prompt to make it more " + random.choice(superprompterstyleslist)
else:
question = "Expand the following prompt to add more detail: "
translation_table_remove_stuff = str.maketrans('', '', '., ')
translation_table_remove_numbers = str.maketrans('', '', '0123456789')
prompt = prompt.translate(translation_table_remove_numbers)
while done == False:
print(seed)
print(temperature)
print(top_p)
print(question)
question = "Expand the following prompt to add more detail: "
#question = "Expand the following prompt to make it more epic: "
superpromptresult = answer(input_text=question + prompt, max_new_tokens=max_new_tokens, repetition_penalty=2.0, temperature=temperature, top_p=top_p, top_k=10, seed=seed)
print("orignal: " + prompt)
@@ -4796,29 +4812,40 @@ def one_button_superprompt(insanitylevel = 5, prompt = "", seed = -1, override_s
superpromptresult = superpromptresult # If neither period nor comma exists, keep the entire text
# check if its matching all words from the override:
words_to_check = override_subject.split() + override_outfit.split()
possible_words_to_check = override_subject.lower().split() + override_outfit.lower().split()
print(possible_words_to_check)
words_to_check = []
words_to_remove = ['subject', 'solo', '1girl', '1boy']
for word in possible_words_to_check:
word = word.translate(translation_table_remove_stuff)
if word not in words_to_remove:
if not word.startswith("-") and not word.endswith("-"):
words_to_check.append(word)
print(words_to_check)
# Iterate through each word and check if it exists in the other string
i = 0
for word in words_to_check:
if word not in superpromptresult:
if word not in superpromptresult.lower() and word != "subject":
i += 1
if(i==0 or j == 20):
done = True
# slowly converge and change
else:
seed += 1
j += 1
if(temperature < 5.0):
temperature += 0.4 + round((10/random.randint(15,25)),2)
if(temperature < 0.5):
temperature += 0.05 + round((1/random.randint(15,25)),2)
else:
temperature -= 0.4
temperature -= 0.1
if(top_p < 2.0):
top_p += 0.2 + round((10/random.randint(25,35)),2)
if(top_p < 1.0):
top_p += 0.2 + round((1/random.randint(25,35)),2)
else:
top_p -= 0.3
max_new_tokens += 3
+7
View File
@@ -1,3 +1,4 @@
adorable
alluring
appealing
attractive
@@ -5,13 +6,19 @@ beautiful
charming
cozy
cute
dynamic
elegant
ethereal
epic
exquisite
flawless
glamourous
good-looking
gorgeous
kawaii
lovely
noir
magnificent
mundane
pleasant
pretty
1 alluring adorable
1 adorable
2 alluring alluring
3 appealing appealing
4 attractive attractive
6 charming charming
7 cozy cozy
8 cute cute
9 dynamic
10 elegant elegant
11 ethereal
12 epic
13 exquisite exquisite
14 flawless flawless
15 glamourous glamourous
16 good-looking good-looking
17 gorgeous gorgeous
18 kawaii
19 lovely lovely
20 noir
21 magnificent magnificent
22 mundane
23 pleasant pleasant
24 pretty pretty
+1 -1
View File
@@ -1,4 +1,4 @@
alluring, appealing, attractive, beautiful, charming, cozy, cute, elegant, exquisite, flawless, glamourous, good-looking, gorgeous, lovely, magnificent, pleasant, pretty
adorable, alluring, appealing, attractive, beautiful, charming, cozy, cute, elegant, exquisite, flawless, glamourous, good-looking, gorgeous, lovely, magnificent, pleasant, pretty
gothic, dark, moody, monochromatic, gritty, grim, macabre, goth, horror, baroque
dirty, grimy, gritty
creepy, scary, horror, monster, monstrous, macabre
1 alluring, appealing, attractive, beautiful, charming, cozy, cute, elegant, exquisite, flawless, glamourous, good-looking, gorgeous, lovely, magnificent, pleasant, pretty adorable, alluring, appealing, attractive, beautiful, charming, cozy, cute, elegant, exquisite, flawless, glamourous, good-looking, gorgeous, lovely, magnificent, pleasant, pretty
2 gothic, dark, moody, monochromatic, gritty, grim, macabre, goth, horror, baroque
3 dirty, grimy, gritty
4 creepy, scary, horror, monster, monstrous, macabre
+25
View File
@@ -0,0 +1,25 @@
artful
adorable
alluring
appealing
attractive
beautiful
charming
cozy
cute
dark
elegant
epic
exquisite
fantastical
flawless
glamourous
grimy
gorgeous
humorous
lovely
magnificent
modern
pleasant
pretty
whymsical
1 artful
2 adorable
3 alluring
4 appealing
5 attractive
6 beautiful
7 charming
8 cozy
9 cute
10 dark
11 elegant
12 epic
13 exquisite
14 fantastical
15 flawless
16 glamourous
17 grimy
18 gorgeous
19 humorous
20 lovely
21 magnificent
22 modern
23 pleasant
24 pretty
25 whymsical
+1 -1
View File
@@ -35,7 +35,7 @@ def generateprompts(amount = 1,insanitylevel="5",subject="all", artist="all", im
# superpromptresult2 = answer(input_text="Help me prompt this a little bit better and concise: """ + result + "" , max_new_tokens=150, repetition_penalty=1.5, temperature=0.5, top_p=0.1, top_k=10, seed=seed)
# superpromptresult3 = answer(input_text="Make this more artful: """ + result + "" , max_new_tokens=150, repetition_penalty=1.5, temperature=5.0, top_p=5, top_k=1, seed=seed)
# superpromptresult4 = answer(input_text="Describe this for me please: """ + result + "" , max_new_tokens=150, repetition_penalty=1.5, temperature=5.0, top_p=5, top_k=1, seed=seed)
#unload_models()
# unload_models()
#print (result + " --- " + superpromptresult1 + " --- " + superpromptresult2 + " --- " + superpromptresult3 + " --- " + superpromptresult4)