Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
eeb07330
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
10 个月 前同步成功
通知
1743
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
eeb07330
编写于
11月 04, 2022
作者:
A
AUTOMATIC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change process_one virtual function for script to process_batch, add extra args and docs
上级
99043f33
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
6 deletion
+12
-6
modules/processing.py
modules/processing.py
+1
-1
modules/scripts.py
modules/scripts.py
+11
-5
未找到文件。
modules/processing.py
浏览文件 @
eeb07330
...
...
@@ -502,7 +502,7 @@ def process_images_inner(p: StableDiffusionProcessing) -> Processed:
break
if
p
.
scripts
is
not
None
:
p
.
scripts
.
process_
one
(
p
,
n
)
p
.
scripts
.
process_
batch
(
p
,
batch_number
=
n
,
prompts
=
prompts
,
seeds
=
seeds
,
subseeds
=
subseeds
)
with
devices
.
autocast
():
uc
=
prompt_parser
.
get_learned_conditioning
(
shared
.
sd_model
,
len
(
prompts
)
*
[
p
.
negative_prompt
],
p
.
steps
)
...
...
modules/scripts.py
浏览文件 @
eeb07330
...
...
@@ -73,9 +73,15 @@ class Script:
pass
def
process_
one
(
self
,
p
,
n
,
*
args
):
def
process_
batch
(
self
,
p
,
*
args
,
**
kw
args
):
"""
Same as process(), but called for every iteration
Same as process(), but called for every batch.
**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
"""
pass
...
...
@@ -303,13 +309,13 @@ class ScriptRunner:
print
(
f
"Error running process:
{
script
.
filename
}
"
,
file
=
sys
.
stderr
)
print
(
traceback
.
format_exc
(),
file
=
sys
.
stderr
)
def
process_
one
(
self
,
p
,
n
):
def
process_
batch
(
self
,
p
,
**
kwargs
):
for
script
in
self
.
alwayson_scripts
:
try
:
script_args
=
p
.
script_args
[
script
.
args_from
:
script
.
args_to
]
script
.
process_
one
(
p
,
n
,
*
script_
args
)
script
.
process_
batch
(
p
,
*
script_args
,
**
kw
args
)
except
Exception
:
print
(
f
"Error running process_
one
:
{
script
.
filename
}
"
,
file
=
sys
.
stderr
)
print
(
f
"Error running process_
batch
:
{
script
.
filename
}
"
,
file
=
sys
.
stderr
)
print
(
traceback
.
format_exc
(),
file
=
sys
.
stderr
)
def
postprocess
(
self
,
p
,
processed
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录