Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
f0c62688
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
11 个月 前同步成功
通知
1758
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f0c62688
编写于
7月 08, 2023
作者:
A
AUTOMATIC1111
提交者:
GitHub
7月 08, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11488 from AUTOMATIC1111/callback-after_extra_networks_activate
add callback after_extra_networks_activate
上级
36026022
9c2a7f1e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
26 addition
and
0 deletion
+26
-0
modules/extra_networks.py
modules/extra_networks.py
+3
-0
modules/scripts.py
modules/scripts.py
+23
-0
未找到文件。
modules/extra_networks.py
浏览文件 @
f0c62688
...
...
@@ -103,6 +103,9 @@ def activate(p, extra_network_data):
except
Exception
as
e
:
errors
.
display
(
e
,
f
"activating extra network
{
extra_network_name
}
"
)
if
p
.
scripts
is
not
None
:
p
.
scripts
.
after_extra_networks_activate
(
p
,
batch_number
=
p
.
iteration
,
prompts
=
p
.
prompts
,
seeds
=
p
.
seeds
,
subseeds
=
p
.
subseeds
,
extra_network_data
=
extra_network_data
)
def
deactivate
(
p
,
extra_network_data
):
"""call deactivate for extra networks in extra_network_data in specified order, then call
...
...
modules/scripts.py
浏览文件 @
f0c62688
...
...
@@ -117,6 +117,21 @@ class Script:
pass
def
after_extra_networks_activate
(
self
,
p
,
*
args
,
**
kwargs
):
"""
Calledafter extra networks activation, before conds calculation
allow modification of the network after extra networks activation been applied
won't be call if p.disable_extra_networks
**kwargs will have those items:
- batch_number - index of current batch, from 0 to number of batches-1
- prompts - list of prompts for current batch; you can change contents of this list but changing the number of entries will likely break things
- seeds - list of seeds for current batch
- subseeds - list of subseeds for current batch
- extra_network_data - list of ExtraNetworkParams for current stage
"""
pass
def
process_batch
(
self
,
p
,
*
args
,
**
kwargs
):
"""
Same as process(), but called for every batch.
...
...
@@ -489,6 +504,14 @@ class ScriptRunner:
except
Exception
:
errors
.
report
(
f
"Error running before_process_batch:
{
script
.
filename
}
"
,
exc_info
=
True
)
def
after_extra_networks_activate
(
self
,
p
,
**
kwargs
):
for
script
in
self
.
alwayson_scripts
:
try
:
script_args
=
p
.
script_args
[
script
.
args_from
:
script
.
args_to
]
script
.
after_extra_networks_activate
(
p
,
*
script_args
,
**
kwargs
)
except
Exception
:
errors
.
report
(
f
"Error running after_extra_networks_activate:
{
script
.
filename
}
"
,
exc_info
=
True
)
def
process_batch
(
self
,
p
,
**
kwargs
):
for
script
in
self
.
alwayson_scripts
:
try
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录