baqu2213 commited on
Commit
402eb66
โ€ข
1 Parent(s): 3dee35f

Upload 3 files

Browse files
.gitattributes CHANGED
@@ -129,3 +129,4 @@ Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0217_testv1.exe filte
129
  NAIA_0217_testv1.exe filter=lfs diff=lfs merge=lfs -text
130
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0217_testv2.exe filter=lfs diff=lfs merge=lfs -text
131
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0218_testv1.exe filter=lfs diff=lfs merge=lfs -text
 
 
129
  NAIA_0217_testv1.exe filter=lfs diff=lfs merge=lfs -text
130
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0217_testv2.exe filter=lfs diff=lfs merge=lfs -text
131
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0218_testv1.exe filter=lfs diff=lfs merge=lfs -text
132
+ Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0218_testv2.exe filter=lfs diff=lfs merge=lfs -text
Danbooru Prompt Selector/TEST2024/NAIA_0218_testv2.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:881c2153607833ff1c91ffce7736e6630d97fdce9d85e45771c03eed5b304e86
3
+ size 888968019
Danbooru Prompt Selector/TEST2024/NAIA_generation.py CHANGED
@@ -181,7 +181,7 @@ def generate(gen_request):
181
  negative = [neg.strip() for neg in negative]
182
  prompt = _prompt.split(',')
183
  prompt = [key.strip() for key in prompt]
184
- commands = [cmd.strip() for cmd in user_input.split(',')]
185
  for command in commands:
186
  condition, cmd = parse_conditional_command(command)
187
  if check_condition(prompt, condition, rating):
@@ -273,7 +273,7 @@ def generate(gen_request):
273
  "steps": 28 if gen_request["type"]!="upper" else gen_request["steps"],
274
  "scale": gen_request["scale"],
275
  "uncond_scale": gen_request["uncond_scale"],
276
- "negative_prompt": gen_request["negative"],
277
  "sm" : gen_request["sema"],
278
  "sm_dyn" : gen_request["sema_dyn"],
279
  "decrisper": False,
 
181
  negative = [neg.strip() for neg in negative]
182
  prompt = _prompt.split(',')
183
  prompt = [key.strip() for key in prompt]
184
+ commands = [cmd.strip() for cmd in user_input.split(',') if not cmd.strip().startswith('#')]
185
  for command in commands:
186
  condition, cmd = parse_conditional_command(command)
187
  if check_condition(prompt, condition, rating):
 
273
  "steps": 28 if gen_request["type"]!="upper" else gen_request["steps"],
274
  "scale": gen_request["scale"],
275
  "uncond_scale": gen_request["uncond_scale"],
276
+ "negative_prompt": ', '.join([keyword.strip() for keyword in gen_request["negative"].split(',') if not keyword.strip().startswith('#')]),
277
  "sm" : gen_request["sema"],
278
  "sm_dyn" : gen_request["sema_dyn"],
279
  "decrisper": False,
Danbooru Prompt Selector/TEST2024/NAIA_random_function_core.py CHANGED
@@ -3,7 +3,7 @@ import numpy as np
3
  import re
4
 
5
  def parse_and_execute_commands(processed, user_input, fix, after, popped_row):
6
- commands = [cmd.strip() for cmd in user_input.split(',')]
7
  for command in commands:
8
  condition, cmd = parse_conditional_command(command)
9
  if check_condition(processed, condition, popped_row):
@@ -93,13 +93,14 @@ def find_keyword_index(general):
93
  # 2์›” 12์ผ์— ํ•ด๋‹น ๋ถ€๋ถ„ return 2 -> return 0 ์œผ๋กœ ์ˆ˜์ •ํ•˜์˜€์œผ๋ฉฐ ์ด ๋ถ€๋ถ„ ํŠธ๋ž˜ํ‚น ํ•„์š”
94
  return 0
95
 
96
- def RFP(popped_row, fix_prompt, after_prompt, auto_hide_prompt, rm_a, rm_s, rm_c, nsfw, data, magic_word):
97
  boys = ["1boy", "2boys", "3boys", "4boys", "5boys", "6+boys"]
98
  girls = ["1girl", "2girls", "3girls", "4girls", "5girls", "6+girls"]
99
  general = [item.strip() for item in popped_row['general'].split(',')]
100
  special_word_check = fix_prompt+', '+after_prompt
101
  special_word_check = [item.strip() for item in special_word_check.split(',')]
102
  special_word_check = [item for item in special_word_check if item.startswith('*')]
 
103
  exc = []
104
  for keyword in general:
105
  if keyword == '!' or keyword == '!?' or keyword == '!!':
@@ -114,7 +115,24 @@ def RFP(popped_row, fix_prompt, after_prompt, auto_hide_prompt, rm_a, rm_s, rm_c
114
  for keyword in general:
115
  if keyword in data.qe_word or keyword in data.bag_of_tags or "horns" in keyword or "(" in keyword or keyword in boys or keyword in girls:
116
  nsfw_word.append(keyword)
 
 
117
  general = nsfw_word
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  if rm_c == 1:
119
  temp_general = []
120
  for keyword in general:
@@ -143,7 +161,7 @@ def RFP(popped_row, fix_prompt, after_prompt, auto_hide_prompt, rm_a, rm_s, rm_c
143
  series = []
144
  fix = fix + series
145
  after = [item.strip() for item in after_prompt[:-1].split(',')]
146
- auto_hide = [item.strip() for item in auto_hide_prompt[:-1].split(',')] + ["| |", ":|", "\||/", "<|> <|>", "|| ||", ";|"]
147
  fix_index = find_keyword_index(general)
148
  processed = general.copy()
149
  temp_hide_prompt = []
 
3
  import re
4
 
5
  def parse_and_execute_commands(processed, user_input, fix, after, popped_row):
6
+ commands = [cmd.strip() for cmd in user_input.split(',') if not cmd.strip().startswith('#')]
7
  for command in commands:
8
  condition, cmd = parse_conditional_command(command)
9
  if check_condition(processed, condition, popped_row):
 
93
  # 2์›” 12์ผ์— ํ•ด๋‹น ๋ถ€๋ถ„ return 2 -> return 0 ์œผ๋กœ ์ˆ˜์ •ํ•˜์˜€์œผ๋ฉฐ ์ด ๋ถ€๋ถ„ ํŠธ๋ž˜ํ‚น ํ•„์š”
94
  return 0
95
 
96
+ def RFP(popped_row, fix_prompt, after_prompt, auto_hide_prompt, rm_a, rm_s, rm_c, rm_loc, rm_color, nsfw, data, magic_word):
97
  boys = ["1boy", "2boys", "3boys", "4boys", "5boys", "6+boys"]
98
  girls = ["1girl", "2girls", "3girls", "4girls", "5girls", "6+girls"]
99
  general = [item.strip() for item in popped_row['general'].split(',')]
100
  special_word_check = fix_prompt+', '+after_prompt
101
  special_word_check = [item.strip() for item in special_word_check.split(',')]
102
  special_word_check = [item for item in special_word_check if item.startswith('*')]
103
+ colors = ['black','white','blond','silver','gray','yellow','blue','purple','red','pink','brown','orange','green','aqua','gradient']
104
  exc = []
105
  for keyword in general:
106
  if keyword == '!' or keyword == '!?' or keyword == '!!':
 
115
  for keyword in general:
116
  if keyword in data.qe_word or keyword in data.bag_of_tags or "horns" in keyword or "(" in keyword or keyword in boys or keyword in girls:
117
  nsfw_word.append(keyword)
118
+ nsfw_word = list(set(nsfw_word))
119
+ nsfw_word.sort()
120
  general = nsfw_word
121
+ if rm_loc == 1:
122
+ temp_general = []
123
+ locations = ['airplane interior', 'airport', 'apartment', 'arena', 'armory', 'bar', 'barn', 'bathroom', 'bathtub', 'bedroom', 'bell tower', 'billiard room', 'book store', 'bowling alley', 'bunker', 'bus interior', 'butcher shop', 'cafe', 'cafeteria', 'car interior', 'casino', 'castle', 'catacomb', 'changing room', 'church', 'classroom', 'closet', 'construction site', 'convenience store', 'convention hall', 'court', 'dining room', 'drugstore', 'ferris wheel', 'flower shop', 'gym', 'hangar', 'hospital', 'hotel room', 'hotel', 'infirmary', 'izakaya', 'kitchen', 'laboratory', 'library', 'living room', 'locker room', 'mall', 'messy room', 'mosque', 'movie theater', 'museum', 'nightclub', 'office', 'onsen', 'ovservatory', 'phone booth', 'planetarium', 'pool', 'prison', 'refinery', 'restaurant', 'restroom', 'rural', 'salon', 'school', 'sex shop', 'shop', 'shower room', 'skating rink', 'snowboard shop', 'spacecraft interior', 'staff room', 'stage', 'supermarket', 'throne', 'train station', 'tunnel', 'airfield', 'alley', 'amphitheater', 'aqueduct', 'bamboo forest', 'beach', 'blizzard', 'bridge', 'bus stop', 'canal', 'canyon', 'carousel', 'cave', 'cliff', 'cockpit', 'conservatory', 'cross walk', 'desert', 'dust storm', 'flower field', 'forest', 'garden', 'gas staion', 'gazebo', 'geyser', 'glacier', 'graveyard', 'harbor', 'highway', 'hill', 'island', 'jungle', 'lake', 'market', 'meadow', 'nuclear powerplant', 'oasis', 'ocean bottom', 'ocean', 'pagoda', 'parking lot', 'playground', 'pond', 'poolside', 'railroad', 'rainforest', 'rice paddy', 'roller coster', 'rooftop', 'rope bridge', 'running track', 'savannah', 'shipyard', 'shirine', 'skyscraper', 'soccor field', 'space elevator', 'stair', 'starry sky', 'swamp', 'tidal flat', 'volcano', 'waterfall', 'waterpark', 'wheat field', 'zoo', 'white background', 'simple background', 'grey background', 'gradient background', 'blue background', 'black background', 'yellow background', 'pink background', 'red background', 'brown background', 'green background', 'purple background', 'orange background']
124
+ for keyword in general:
125
+ if keyword in locations:
126
+ temp_general.append(keyword)
127
+ for keyword in temp_general:
128
+ general.remove(keyword)
129
+ if rm_color == 1:
130
+ temp_general = []
131
+ for keyword in general:
132
+ if any(color in keyword for color in colors):
133
+ temp_general.append(keyword)
134
+ for keyword in temp_general:
135
+ general.remove(keyword)
136
  if rm_c == 1:
137
  temp_general = []
138
  for keyword in general:
 
161
  series = []
162
  fix = fix + series
163
  after = [item.strip() for item in after_prompt[:-1].split(',')]
164
+ auto_hide = [item.strip() for item in auto_hide_prompt[:-1].split(',') if not item.strip().startswith('#')] + ["| |", ":|", "\||/", "<|> <|>", "|| ||", ";|"]
165
  fix_index = find_keyword_index(general)
166
  processed = general.copy()
167
  temp_hide_prompt = []