Upload 2 files
Browse files
Danbooru Prompt Selector/TEST2024/NAIA_0203_testv2.py
CHANGED
|
@@ -1896,6 +1896,9 @@ class App(customtkinter.CTk):
|
|
| 1896 |
gen_request["count"] =self.generation_count
|
| 1897 |
if app.auto_count_left_flag == True:
|
| 1898 |
app.auto_count_left -= 1
|
|
|
|
|
|
|
|
|
|
| 1899 |
app.image_generation_button.configure(border_width = 2)
|
| 1900 |
pass_bit = False
|
| 1901 |
retry_count = 0
|
|
|
|
| 1896 |
gen_request["count"] =self.generation_count
|
| 1897 |
if app.auto_count_left_flag == True:
|
| 1898 |
app.auto_count_left -= 1
|
| 1899 |
+
if self.image_generation_repeat_flag == True:
|
| 1900 |
+
gen_request["repeat"] = self.image_generation_repeat_current -1
|
| 1901 |
+
gen_request["repeat_max"] = self.image_generation_repeat
|
| 1902 |
app.image_generation_button.configure(border_width = 2)
|
| 1903 |
pass_bit = False
|
| 1904 |
retry_count = 0
|
Danbooru Prompt Selector/TEST2024/NAIA_generation.py
CHANGED
|
@@ -291,6 +291,21 @@ def generate(gen_request):
|
|
| 291 |
rating = gen_request["rating"]
|
| 292 |
params["negative_prompt"] = parse_and_execute_commands(positive, params["negative_prompt"], user_input, rating)
|
| 293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
filename_rule = gen_request["png_rule"]
|
| 295 |
save_folder = gen_request["save_folder"]
|
| 296 |
|
|
|
|
| 291 |
rating = gen_request["rating"]
|
| 292 |
params["negative_prompt"] = parse_and_execute_commands(positive, params["negative_prompt"], user_input, rating)
|
| 293 |
|
| 294 |
+
if "repeat" in gen_request:
|
| 295 |
+
max = gen_request["repeat_max"]
|
| 296 |
+
keywords = [key.strip() for key in positive.split(',')]
|
| 297 |
+
|
| 298 |
+
for i, key in enumerate(keywords):
|
| 299 |
+
if "->" in key:
|
| 300 |
+
instant_keyword = [k for k in key.split('->')]
|
| 301 |
+
if len(instant_keyword) > gen_request["repeat"]:
|
| 302 |
+
current_key = instant_keyword[gen_request["repeat"]]
|
| 303 |
+
else:
|
| 304 |
+
current_key = instant_keyword[gen_request["repeat"] % len(instant_keyword)]
|
| 305 |
+
keywords[i] = current_key
|
| 306 |
+
|
| 307 |
+
positive = ', '.join(keywords)
|
| 308 |
+
|
| 309 |
filename_rule = gen_request["png_rule"]
|
| 310 |
save_folder = gen_request["save_folder"]
|
| 311 |
|