Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
S
Stable Diffusion Webui
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
Hunter0726
Stable Diffusion Webui
提交
4ff4730d
未验证
提交
4ff4730d
编辑于
2 years ago
作者:
不会画画的中医不是好程序员
提交者:
GitHub
2 years ago
浏览文件
操作
下载
差异文件
Merge branch 'AUTOMATIC1111:master' into Inspiron
上级
f300d0f2
3e15f8e0
No related branches found
No related tags found
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
modules/script_callbacks.py
+16
-6
16 个添加, 6 个删除
modules/script_callbacks.py
有
16 个添加
和
6 个删除
modules/script_callbacks.py
+
16
−
6
浏览文件 @
4ff4730d
...
...
@@ -49,6 +49,14 @@ def ui_settings_callback():
report_exception
(
c
,
'
ui_settings_callback
'
)
def
image_saved_callback
(
image
,
p
,
fullfn
,
txt_fullfn
):
for
c
in
callbacks_image_saved
:
try
:
c
.
callback
(
image
,
p
,
fullfn
,
txt_fullfn
)
except
Exception
:
report_exception
(
c
,
'
image_saved_callback
'
)
def
add_callback
(
callbacks
,
fun
):
stack
=
[
x
for
x
in
inspect
.
stack
()
if
x
.
filename
!=
__file__
]
filename
=
stack
[
0
].
filename
if
len
(
stack
)
>
0
else
'
unknown file
'
...
...
@@ -56,9 +64,6 @@ def add_callback(callbacks, fun):
callbacks
.
append
(
ScriptCallback
(
filename
,
fun
))
def
image_saved_callback
(
image
,
p
,
fullfn
,
txt_fullfn
):
for
callback
in
callbacks_image_saved
:
callback
(
image
,
p
,
fullfn
,
txt_fullfn
)
def
on_model_loaded
(
callback
):
"""
register a function to be called when the stable diffusion model is created; the model is
...
...
@@ -82,9 +87,14 @@ def on_ui_tabs(callback):
def
on_ui_settings
(
callback
):
"""
register a function to be called before UI settings are populated; add your settings
by using shared.opts.add_option(shared.OptionInfo(...))
"""
callbacks_ui_settings
.
append
(
callback
)
add_callback
(
callbacks_ui_settings
,
callback
)
def
on_save_imaged
(
callback
):
"""
register a function to call after modules.images.save_image is called returning same values, original image and p
"""
callbacks_image_saved
.
append
(
callback
)
"""
register a function to be called after modules.images.save_image is called.
The callback is called with three arguments:
- p - procesing object (or a dummy object with same fields if the image is saved using save button)
- fullfn - image filename
- txt_fullfn - text file with parameters; may be None
"""
add_callback
(
callbacks_image_saved
,
callback
)
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录