baqu2213 commited on
Commit
3062583
1 Parent(s): 8f3d420

Upload 3 files

Browse files
Danbooru Prompt Selector/TEST2024/NAIA_0228_testv2.exe CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:dcf08a1a57c417ff09cec03b41545f9200ef30c3ede7f440be8222ce1da09cf1
3
- size 854809343
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c212fa226d9e6ac3494f9bd078ef73fe35aae0d27daa323480326d4d3b15584
3
+ size 854809342
Danbooru Prompt Selector/TEST2024/NAIA_0228_testv2.py CHANGED
@@ -1555,7 +1555,7 @@ class App(customtkinter.CTk, TkinterDnD.DnDWrapper):
1555
  self.xy_plot_count = 0
1556
  self.import_image_negative = {}
1557
 
1558
- self.title("NAIA Beta v1.09 (Test version)")
1559
  self.grid_rowconfigure(0, weight=1)
1560
  self.columnconfigure(2, weight=1)
1561
 
@@ -2498,6 +2498,10 @@ class App(customtkinter.CTk, TkinterDnD.DnDWrapper):
2498
  after_wildcard = self.image_generation_repeat_prompt
2499
  self.image_generation_repeat_current += 1
2500
  elif self.image_generation_repeat > 1 and not self.hold_wildcard:
 
 
 
 
2501
  self.image_generation_repeat_current += 1
2502
  ##############################
2503
  gen_request = {
@@ -4584,21 +4588,21 @@ class App(customtkinter.CTk, TkinterDnD.DnDWrapper):
4584
  self.image_label_report.insert("0.0", temp)
4585
  self.image_label_report.configure(state="disabled")
4586
  if result_image:
 
 
 
 
4587
  if app.state() != 'zoomed':
4588
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
4589
  else:
4590
- current_image = Image.open(filename)
4591
- original_width, original_height = current_image.size
4592
- max_size = app.winfo_screenheight()-100
4593
- if original_width > max_size or original_height > max_size:
4594
- new_image = Image.new("RGB", (max_size, max_size), "black")
4595
- new_image.paste(current_image, ((max_size - original_width) // 2, (max_size - original_height) // 2))
4596
- instant_result_image = customtkinter.CTkImage(new_image, size=(max_size, max_size))
4597
- else:
4598
- instant_result_image = customtkinter.CTkImage(current_image, size=(max_size, max_size))
4599
  self.image_label.configure(image=instant_result_image)
4600
  img_label_result.grid(row=0, column=1)
4601
- img_label_result.configure(image=customtkinter.CTkImage(result_image, size=(576, 576)))
 
 
 
4602
  set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
4603
  generation_thread = threading.Thread(target=run_generation, daemon=True)
4604
  generation_thread.start()
@@ -4640,7 +4644,7 @@ class App(customtkinter.CTk, TkinterDnD.DnDWrapper):
4640
  img2img_window_left = customtkinter.CTkScrollableFrame(img2img_window)
4641
  img2img_window_left.grid(row=0, column=0, pady=5, padx=5, sticky="nsew")
4642
  img2img_window_right = customtkinter.CTkFrame(img2img_window, width=586)
4643
- img2img_window_right.grid(row=0, column=1, pady=5, padx=5, sticky="nsew")
4644
  #img2img_window_menu = customtkinter.CTkFrame(img2img_window, width=140)
4645
  #img2img_window_menu.grid(row=0, column=2, pady=5, padx=5, sticky="nsew")
4646
 
@@ -4661,7 +4665,7 @@ class App(customtkinter.CTk, TkinterDnD.DnDWrapper):
4661
 
4662
  img_label = customtkinter.CTkCanvas(img2img_window_left, width=cwidth, height=cheight)
4663
  img_label.grid(row=0, column=0)
4664
- img_label_result = customtkinter.CTkLabel(img2img_window_left, text="")
4665
 
4666
  # 마스크 이미지 생성 및 저장 함수
4667
  def create_and_save_mask_image():
@@ -5076,14 +5080,8 @@ class App(customtkinter.CTk, TkinterDnD.DnDWrapper):
5076
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
5077
  else:
5078
  current_image = Image.open(filename)
5079
- original_width, original_height = current_image.size
5080
- max_size = app.winfo_screenheight()-100
5081
- if original_width > max_size or original_height > max_size:
5082
- new_image = Image.new("RGB", (max_size, max_size), "black")
5083
- new_image.paste(current_image, ((max_size - original_width) // 2, (max_size - original_height) // 2))
5084
- instant_result_image = customtkinter.CTkImage(new_image, size=(max_size, max_size))
5085
- else:
5086
- instant_result_image = customtkinter.CTkImage(current_image, size=(max_size, max_size))
5087
  self.image_label.configure(image=instant_result_image)
5088
  set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
5089
  generation_thread = threading.Thread(target=run_generation, daemon=True)
@@ -7177,14 +7175,8 @@ public class DPI {
7177
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
7178
  else:
7179
  current_image = Image.open(filename)
7180
- original_width, original_height = current_image.size
7181
- max_size = app.winfo_screenheight()-100
7182
- if original_width > max_size or original_height > max_size:
7183
- new_image = Image.new("RGB", (max_size, max_size), "black")
7184
- new_image.paste(current_image, ((max_size - original_width) // 2, (max_size - original_height) // 2))
7185
- instant_result_image = customtkinter.CTkImage(new_image, size=(max_size, max_size))
7186
- else:
7187
- instant_result_image = customtkinter.CTkImage(current_image, size=(max_size, max_size))
7188
  self.image_label.configure(image=instant_result_image)
7189
  app.ext_set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
7190
  x_position = label_space + (xloop * image_width)
@@ -7383,14 +7375,8 @@ public class DPI {
7383
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
7384
  else:
7385
  current_image = Image.open(filename)
7386
- original_width, original_height = current_image.size
7387
- max_size = app.winfo_screenheight()-100
7388
- if original_width > max_size or original_height > max_size:
7389
- new_image = Image.new("RGB", (max_size, max_size), "black")
7390
- new_image.paste(current_image, ((max_size - original_width) // 2, (max_size - original_height) // 2))
7391
- instant_result_image = customtkinter.CTkImage(new_image, size=(max_size, max_size))
7392
- else:
7393
- instant_result_image = customtkinter.CTkImage(current_image, size=(max_size, max_size))
7394
  self.image_label.configure(image=instant_result_image)
7395
  app.ext_set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
7396
  if self.instant_stop_bit:
 
1555
  self.xy_plot_count = 0
1556
  self.import_image_negative = {}
1557
 
1558
+ self.title("NAIA Beta v1.09.1 (Test version 2)")
1559
  self.grid_rowconfigure(0, weight=1)
1560
  self.columnconfigure(2, weight=1)
1561
 
 
2498
  after_wildcard = self.image_generation_repeat_prompt
2499
  self.image_generation_repeat_current += 1
2500
  elif self.image_generation_repeat > 1 and not self.hold_wildcard:
2501
+ if self.image_generation_repeat_flag == False:
2502
+ self.image_generation_repeat_flag = True
2503
+ self.image_generation_repeat_prompt = after_wildcard
2504
+ after_wildcard = self.image_generation_repeat_prompt
2505
  self.image_generation_repeat_current += 1
2506
  ##############################
2507
  gen_request = {
 
4588
  self.image_label_report.insert("0.0", temp)
4589
  self.image_label_report.configure(state="disabled")
4590
  if result_image:
4591
+ current_image = Image.open(filename)
4592
+ cw, ch = current_image.size
4593
+ cw = int(cw * (100 / app.dpi))
4594
+ ch = int(ch * (100 / app.dpi))
4595
  if app.state() != 'zoomed':
4596
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
4597
  else:
4598
+ new_image = self.resize_and_center_image(current_image, self.wide_res_width, self.wide_res_height)
4599
+ instant_result_image = customtkinter.CTkImage(new_image, size=(self.wide_res_width, self.wide_res_height))
 
 
 
 
 
 
 
4600
  self.image_label.configure(image=instant_result_image)
4601
  img_label_result.grid(row=0, column=1)
4602
+ if app.winfo_screenheight() >= 1152:
4603
+ img_label_result.configure(image=customtkinter.CTkImage(current_image, size=(cw, ch)))
4604
+ else:
4605
+ img_label_result.configure(image=customtkinter.CTkImage(result_image, size=(620,620)))
4606
  set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
4607
  generation_thread = threading.Thread(target=run_generation, daemon=True)
4608
  generation_thread.start()
 
4644
  img2img_window_left = customtkinter.CTkScrollableFrame(img2img_window)
4645
  img2img_window_left.grid(row=0, column=0, pady=5, padx=5, sticky="nsew")
4646
  img2img_window_right = customtkinter.CTkFrame(img2img_window, width=586)
4647
+ img2img_window_right.grid(row=0, column=2, pady=5, padx=5, sticky="nsew")
4648
  #img2img_window_menu = customtkinter.CTkFrame(img2img_window, width=140)
4649
  #img2img_window_menu.grid(row=0, column=2, pady=5, padx=5, sticky="nsew")
4650
 
 
4665
 
4666
  img_label = customtkinter.CTkCanvas(img2img_window_left, width=cwidth, height=cheight)
4667
  img_label.grid(row=0, column=0)
4668
+ img_label_result = customtkinter.CTkLabel(img2img_window, text="")
4669
 
4670
  # 마스크 이미지 생성 및 저장 함수
4671
  def create_and_save_mask_image():
 
5080
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
5081
  else:
5082
  current_image = Image.open(filename)
5083
+ new_image = self.resize_and_center_image(current_image, self.wide_res_width, self.wide_res_height)
5084
+ instant_result_image = customtkinter.CTkImage(new_image, size=(self.wide_res_width, self.wide_res_height))
 
 
 
 
 
 
5085
  self.image_label.configure(image=instant_result_image)
5086
  set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
5087
  generation_thread = threading.Thread(target=run_generation, daemon=True)
 
7175
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
7176
  else:
7177
  current_image = Image.open(filename)
7178
+ new_image = self.resize_and_center_image(current_image, self.wide_res_width, self.wide_res_height)
7179
+ instant_result_image = customtkinter.CTkImage(new_image, size=(self.wide_res_width, self.wide_res_height))
 
 
 
 
 
 
7180
  self.image_label.configure(image=instant_result_image)
7181
  app.ext_set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
7182
  x_position = label_space + (xloop * image_width)
 
7375
  instant_result_image = customtkinter.CTkImage(result_image, size=(620,620))
7376
  else:
7377
  current_image = Image.open(filename)
7378
+ new_image = self.resize_and_center_image(current_image, self.wide_res_width, self.wide_res_height)
7379
+ instant_result_image = customtkinter.CTkImage(new_image, size=(self.wide_res_width, self.wide_res_height))
 
 
 
 
 
 
7380
  self.image_label.configure(image=instant_result_image)
7381
  app.ext_set_image_to_queue(result_image, result_prompt, str(result_seed), filename)
7382
  if self.instant_stop_bit:
Danbooru Prompt Selector/TEST2024/NAIA_generation.py CHANGED
@@ -313,7 +313,7 @@ def generate(gen_request):
313
  "noise_schedule": "native"
314
  }
315
 
316
- if "image" not in gen_request and "reference_image" in gen_request:
317
  params["reference_image"] = gen_request["reference_image"]
318
  params["reference_information_extracted"] = gen_request["reference_information_extracted"]
319
  params["reference_strength"] = gen_request["reference_strength"]
@@ -342,7 +342,7 @@ def generate(gen_request):
342
  current_key = instant_keyword[gen_request["repeat"]]
343
  else:
344
  current_key = instant_keyword[gen_request["repeat"] % len(instant_keyword)]
345
- keywords[i] = current_key
346
 
347
  filename_rule = gen_request["png_rule"]
348
  save_folder = gen_request["save_folder"]
 
313
  "noise_schedule": "native"
314
  }
315
 
316
+ if "reference_image" in gen_request:
317
  params["reference_image"] = gen_request["reference_image"]
318
  params["reference_information_extracted"] = gen_request["reference_information_extracted"]
319
  params["reference_strength"] = gen_request["reference_strength"]
 
342
  current_key = instant_keyword[gen_request["repeat"]]
343
  else:
344
  current_key = instant_keyword[gen_request["repeat"] % len(instant_keyword)]
345
+ keywords[i] = ', '.join(current_key.split('^'))
346
 
347
  filename_rule = gen_request["png_rule"]
348
  save_folder = gen_request["save_folder"]