baqu2213 commited on
Commit
52593ff
1 Parent(s): f1664b3

Upload 4 files

Browse files
.gitattributes CHANGED
@@ -113,3 +113,4 @@ Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0103_testv2.exe filte
113
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0105_testv2.exe filter=lfs diff=lfs merge=lfs -text
114
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0107_testv3.exe filter=lfs diff=lfs merge=lfs -text
115
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0108_testv3.exe filter=lfs diff=lfs merge=lfs -text
 
 
113
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0105_testv2.exe filter=lfs diff=lfs merge=lfs -text
114
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0107_testv3.exe filter=lfs diff=lfs merge=lfs -text
115
  Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0108_testv3.exe filter=lfs diff=lfs merge=lfs -text
116
+ Danbooru[[:space:]]Prompt[[:space:]]Selector/TEST2024/NAIA_0110_testv3.exe filter=lfs diff=lfs merge=lfs -text
Danbooru Prompt Selector/TEST2024/NAIA_0110_testv3.exe ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2aace41512cef7fe9cb102e20225956722f56abb4079477639593ac7e5ec3303
3
+ size 837993022
Danbooru Prompt Selector/TEST2024/NAIA_0110_testv3.py ADDED
The diff for this file is too large to render. See raw diff
 
Danbooru Prompt Selector/TEST2024/NAIA_random_function_core.py CHANGED
@@ -38,6 +38,11 @@ def RFP(popped_row, fix_prompt, after_prompt, auto_hide_prompt, rm_a, rm_s, rm_c
38
  for keyword in temp_general:
39
  general.remove(keyword)
40
  fix = [item.strip() for item in fix_prompt[:-1].split(',')]
 
 
 
 
 
41
  if rm_s == 0:
42
  if popped_row['copyright']:
43
  series = [item.strip() for item in popped_row['copyright'].split(',')]
@@ -62,11 +67,6 @@ def RFP(popped_row, fix_prompt, after_prompt, auto_hide_prompt, rm_a, rm_s, rm_c
62
  character = [item.strip() for item in popped_row['character'].split(',')]
63
  processed[fix_index:fix_index] = character
64
  fix_index+=len(character)
65
- if rm_a == 0:
66
- if popped_row['artist']:
67
- artists = [item.strip() for item in popped_row['artist'].split(',')]
68
- artist = ["artist:" + _artist for _artist in artists]
69
- processed[fix_index:fix_index] = artist
70
  if magic_word["random_artist"] == True:
71
  processed.insert(fix_index, magic_word["random_artist_name"])
72
 
 
38
  for keyword in temp_general:
39
  general.remove(keyword)
40
  fix = [item.strip() for item in fix_prompt[:-1].split(',')]
41
+ if rm_a == 0:
42
+ if popped_row['artist']:
43
+ artists = [item.strip() for item in popped_row['artist'].split(',')]
44
+ artist = ["artist:" + _artist for _artist in artists]
45
+ fix = fix + artist
46
  if rm_s == 0:
47
  if popped_row['copyright']:
48
  series = [item.strip() for item in popped_row['copyright'].split(',')]
 
67
  character = [item.strip() for item in popped_row['character'].split(',')]
68
  processed[fix_index:fix_index] = character
69
  fix_index+=len(character)
 
 
 
 
 
70
  if magic_word["random_artist"] == True:
71
  processed.insert(fix_index, magic_word["random_artist_name"])
72
 
Danbooru Prompt Selector/TEST2024/NAIA_search.py CHANGED
@@ -154,19 +154,18 @@ def search(df, search_request, exclude_request, E=None, N=None, S=None, G=None):
154
  results = pd.DataFrame()
155
  for keyword in or_search_keyword:
156
  keywords = [item.strip() for item in keyword.split(',')]
157
- matched_rows = None
158
  for keyword in keywords:
159
  ndfs = []
160
- for column in ['copyright', 'character', 'artist', 'meta', 'general']:
161
- request_regex = False
162
- if any(char in keyword for char in special_chars):
163
  keyword = re.escape(keyword)
164
  request_regex = True
165
- if keyword == keywords[0]:
166
- if request_regex: matched_rows = df[df[column].str.contains(keyword, na=False, regex=True)]
167
- else: matched_rows = df[df[column].str.contains(keyword, na=False)]
 
168
  else:
169
- print(keyword, len(matched_rows))
170
  if request_regex:
171
  ndf = matched_rows[matched_rows[column].str.contains(keyword, na=False, regex=True)]
172
  else:
@@ -184,6 +183,7 @@ def search(df, search_request, exclude_request, E=None, N=None, S=None, G=None):
184
  matched_rows.drop_duplicates(subset=['general'])
185
  if not matched_rows.empty:
186
  results = pd.concat([results, matched_rows])
 
187
  print(results)
188
  del[[df]]
189
  results = results.drop_duplicates(subset=['general'])
 
154
  results = pd.DataFrame()
155
  for keyword in or_search_keyword:
156
  keywords = [item.strip() for item in keyword.split(',')]
157
+ matched_rows = pd.DataFrame()
158
  for keyword in keywords:
159
  ndfs = []
160
+ request_regex = False
161
+ if any(char in keyword for char in special_chars):
 
162
  keyword = re.escape(keyword)
163
  request_regex = True
164
+ for column in ['copyright', 'character', 'artist', 'meta', 'general']:
165
+ if keyword == keywords[0] or keyword == re.escape(keywords[0]):
166
+ if request_regex: matched_rows = pd.concat([matched_rows, df[df[column].str.contains(keyword, na=False, regex=True)]], ignore_index=True)
167
+ else: matched_rows = pd.concat([matched_rows, df[df[column].str.contains(keyword, na=False)]], ignore_index=True)
168
  else:
 
169
  if request_regex:
170
  ndf = matched_rows[matched_rows[column].str.contains(keyword, na=False, regex=True)]
171
  else:
 
183
  matched_rows.drop_duplicates(subset=['general'])
184
  if not matched_rows.empty:
185
  results = pd.concat([results, matched_rows])
186
+ del[matched_rows]
187
  print(results)
188
  del[[df]]
189
  results = results.drop_duplicates(subset=['general'])