Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
a8eb9e3b
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
12 个月 前同步成功
通知
1771
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
a8eb9e3b
编写于
1月 04, 2023
作者:
A
AUTOMATIC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Merge pull request #3791 from shirayu/fix/filename"
This reverts commit
eed58279
, reversing changes made to
4ae960b0
.
上级
eed58279
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
12 deletion
+4
-12
modules/images.py
modules/images.py
+4
-12
未找到文件。
modules/images.py
浏览文件 @
a8eb9e3b
...
...
@@ -447,14 +447,6 @@ def get_next_sequence_number(path, basename):
return
result
+
1
def
truncate_fullpath
(
full_path
,
encoding
=
'utf-8'
):
dir_name
,
full_name
=
os
.
path
.
split
(
full_path
)
file_name
,
file_ext
=
os
.
path
.
splitext
(
full_name
)
max_length
=
os
.
statvfs
(
dir_name
).
f_namemax
file_name_truncated
=
file_name
.
encode
(
encoding
)[:
max_length
-
len
(
file_ext
)].
decode
(
encoding
,
'ignore'
)
return
os
.
path
.
join
(
dir_name
,
file_name_truncated
+
file_ext
)
def
save_image
(
image
,
path
,
basename
,
seed
=
None
,
prompt
=
None
,
extension
=
'png'
,
info
=
None
,
short_filename
=
False
,
no_prompt
=
False
,
grid
=
False
,
pnginfo_section_name
=
'parameters'
,
p
=
None
,
existing_info
=
None
,
forced_filename
=
None
,
suffix
=
""
,
save_to_dirs
=
None
):
"""Save an image.
...
...
@@ -495,7 +487,7 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
if
save_to_dirs
:
dirname
=
namegen
.
apply
(
opts
.
directories_filename_pattern
or
"[prompt_words]"
).
lstrip
(
' '
).
rstrip
(
'
\\
/'
)
path
=
truncate_fullpath
(
os
.
path
.
join
(
path
,
dirname
)
)
path
=
os
.
path
.
join
(
path
,
dirname
)
os
.
makedirs
(
path
,
exist_ok
=
True
)
...
...
@@ -519,13 +511,13 @@ def save_image(image, path, basename, seed=None, prompt=None, extension='png', i
fullfn
=
None
for
i
in
range
(
500
):
fn
=
f
"
{
basecount
+
i
:
05
}
"
if
basename
==
''
else
f
"
{
basename
}
-
{
basecount
+
i
:
04
}
"
fullfn
=
truncate_fullpath
(
os
.
path
.
join
(
path
,
f
"
{
fn
}{
file_decoration
}
.
{
extension
}
"
)
)
fullfn
=
os
.
path
.
join
(
path
,
f
"
{
fn
}{
file_decoration
}
.
{
extension
}
"
)
if
not
os
.
path
.
exists
(
fullfn
):
break
else
:
fullfn
=
truncate_fullpath
(
os
.
path
.
join
(
path
,
f
"
{
file_decoration
}
.
{
extension
}
"
)
)
fullfn
=
os
.
path
.
join
(
path
,
f
"
{
file_decoration
}
.
{
extension
}
"
)
else
:
fullfn
=
truncate_fullpath
(
os
.
path
.
join
(
path
,
f
"
{
forced_filename
}
.
{
extension
}
"
)
)
fullfn
=
os
.
path
.
join
(
path
,
f
"
{
forced_filename
}
.
{
extension
}
"
)
pnginfo
=
existing_info
or
{}
if
info
is
not
None
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录