yoinked commited on
Commit
4993ea8
1 Parent(s): f0a6346

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -156,11 +156,11 @@ def image_to_wd14_tags(image: Image.Image, model_name: str, threshold: float,
156
  tags_pairs = sorted(tags_pairs, key=lambda x: (-x[1], x[0]))
157
  for tag, score in tags_pairs:
158
  tag_outformat = tag
159
- if use_spaces:
160
- tag_outformat = tag_outformat.replace('_', ' ')
161
- tag_outformat = tag_outformat.replace(' ', '-')
162
- else:
163
  tag_outformat = tag_outformat.replace('_', '-')
 
 
 
164
  if use_escape:
165
  tag_outformat = re.sub(RE_SPECIAL, r'\\\1', tag_outformat)
166
  if include_ranks:
 
156
  tags_pairs = sorted(tags_pairs, key=lambda x: (-x[1], x[0]))
157
  for tag, score in tags_pairs:
158
  tag_outformat = tag
159
+ if not use_spaces::
 
 
 
160
  tag_outformat = tag_outformat.replace('_', '-')
161
+ else
162
+ tag_outformat = tag_outformat.replace(' ', ', ')
163
+ tag_outformat = tag_outformat.replace('_', ' ')
164
  if use_escape:
165
  tag_outformat = re.sub(RE_SPECIAL, r'\\\1', tag_outformat)
166
  if include_ranks: