Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
S
Stable Diffusion Webui
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
Hunter0726
Stable Diffusion Webui
提交
b3593d09
提交
b3593d09
编辑于
1 year ago
作者:
For Sure
浏览文件
操作
下载
补丁
差异文件
Add support for saving init images in img2img
上级
22bcc7be
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
modules/processing.py
+8
-0
8 个添加, 0 个删除
modules/processing.py
modules/shared.py
+3
-0
3 个添加, 0 个删除
modules/shared.py
有
11 个添加
和
0 个删除
modules/processing.py
+
8
−
0
浏览文件 @
b3593d09
...
...
@@ -3,6 +3,7 @@ import math
import
os
import
sys
import
warnings
import
hashlib
import
torch
import
numpy
as
np
...
...
@@ -476,6 +477,7 @@ def create_infotext(p, all_prompts, all_seeds, all_subseeds, comments=None, iter
"
Conditional mask weight
"
:
getattr
(
p
,
"
inpainting_mask_weight
"
,
shared
.
opts
.
inpainting_mask_weight
)
if
p
.
is_using_inpainting_conditioning
else
None
,
"
Clip skip
"
:
None
if
clip_skip
<=
1
else
clip_skip
,
"
ENSD
"
:
None
if
opts
.
eta_noise_seed_delta
==
0
else
opts
.
eta_noise_seed_delta
,
"
Init image hash
"
:
getattr
(
p
,
'
init_img_hash
'
,
None
)
}
generation_params
.
update
(
p
.
extra_generation_params
)
...
...
@@ -1007,6 +1009,12 @@ class StableDiffusionProcessingImg2Img(StableDiffusionProcessing):
self
.
color_corrections
=
[]
imgs
=
[]
for
img
in
self
.
init_images
:
# Save init image
if
opts
.
save_init_img
:
self
.
init_img_hash
=
hashlib
.
md5
(
img
.
tobytes
()).
hexdigest
()
images
.
save_image
(
img
,
path
=
opts
.
outdir_init_images
,
basename
=
None
,
forced_filename
=
self
.
init_img_hash
,
save_to_dirs
=
False
)
image
=
images
.
flatten
(
img
,
opts
.
img2img_background_color
)
if
crop_region
is
None
and
self
.
resize_mode
!=
3
:
...
...
此差异已折叠。
点击以展开。
modules/shared.py
+
3
−
0
浏览文件 @
b3593d09
...
...
@@ -39,6 +39,7 @@ restricted_opts = {
"
outdir_grids
"
,
"
outdir_txt2img_grids
"
,
"
outdir_save
"
,
"
outdir_init_images
"
}
ui_reorder_categories
=
[
...
...
@@ -253,6 +254,7 @@ options_templates.update(options_section(('saving-images', "Saving images/grids"
"
use_upscaler_name_as_suffix
"
:
OptionInfo
(
False
,
"
Use upscaler name as filename suffix in the extras tab
"
),
"
save_selected_only
"
:
OptionInfo
(
True
,
"
When using
'
Save
'
button, only save a single selected image
"
),
"
do_not_add_watermark
"
:
OptionInfo
(
False
,
"
Do not add watermark to images
"
),
"
save_init_img
"
:
OptionInfo
(
True
,
"
Save init images when using img2img
"
),
"
temp_dir
"
:
OptionInfo
(
""
,
"
Directory for temporary images; leave empty for default
"
),
"
clean_temp_dir_at_start
"
:
OptionInfo
(
False
,
"
Cleanup non-default temporary directory when starting webui
"
),
...
...
@@ -268,6 +270,7 @@ options_templates.update(options_section(('saving-paths', "Paths for saving"), {
"
outdir_txt2img_grids
"
:
OptionInfo
(
"
outputs/txt2img-grids
"
,
'
Output directory for txt2img grids
'
,
component_args
=
hide_dirs
),
"
outdir_img2img_grids
"
:
OptionInfo
(
"
outputs/img2img-grids
"
,
'
Output directory for img2img grids
'
,
component_args
=
hide_dirs
),
"
outdir_save
"
:
OptionInfo
(
"
log/images
"
,
"
Directory for saving images using the Save button
"
,
component_args
=
hide_dirs
),
"
outdir_init_images
"
:
OptionInfo
(
"
outputs/init-images
"
,
"
Directory for saving init images when using img2img
"
,
component_args
=
hide_dirs
),
}))
options_templates
.
update
(
options_section
((
'
saving-to-dirs
'
,
"
Saving to a directory
"
),
{
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录