Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
6f678ec7
Commit
6f678ec7
authored
Sep 10, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Emoji are not being sorted correctly #192
parent
ee8a6fa8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
modules/images.py
modules/images.py
+4
-2
No files found.
modules/images.py
View file @
6f678ec7
...
@@ -6,6 +6,7 @@ import re
...
@@ -6,6 +6,7 @@ import re
import
numpy
as
np
import
numpy
as
np
from
PIL
import
Image
,
ImageFont
,
ImageDraw
,
PngImagePlugin
from
PIL
import
Image
,
ImageFont
,
ImageDraw
,
PngImagePlugin
from
fonts.ttf
import
Roboto
from
fonts.ttf
import
Roboto
import
string
import
modules.shared
import
modules.shared
from
modules.shared
import
opts
from
modules.shared
import
opts
...
@@ -235,6 +236,7 @@ def resize_image(resize_mode, im, width, height):
...
@@ -235,6 +236,7 @@ def resize_image(resize_mode, im, width, height):
invalid_filename_chars
=
'<>:"/
\\
|?*
\n
'
invalid_filename_chars
=
'<>:"/
\\
|?*
\n
'
re_nonletters
=
re
.
compile
(
r'[\s'
+
string
.
punctuation
+
']+'
)
def
sanitize_filename_part
(
text
):
def
sanitize_filename_part
(
text
):
...
@@ -256,11 +258,11 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
...
@@ -256,11 +258,11 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
pnginfo
=
None
pnginfo
=
None
if
opts
.
save_to_dirs
and
not
no_prompt
:
if
opts
.
save_to_dirs
and
not
no_prompt
:
words
=
re
.
findall
(
r'\w+'
,
prompt
or
""
)
words
=
re
_nonletters
.
split
(
prompt
or
""
)
if
len
(
words
)
==
0
:
if
len
(
words
)
==
0
:
words
=
[
"empty"
]
words
=
[
"empty"
]
dirname
=
" "
.
join
(
words
[
0
:
opts
.
save_to_dirs_prompt_len
])
dirname
=
" "
.
join
(
words
[
0
:
opts
.
save_to_dirs_prompt_len
])
.
strip
()
path
=
os
.
path
.
join
(
path
,
dirname
)
path
=
os
.
path
.
join
(
path
,
dirname
)
os
.
makedirs
(
path
,
exist_ok
=
True
)
os
.
makedirs
(
path
,
exist_ok
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment