Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
e16d7628
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
10 个月 前同步成功
通知
1752
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
体验新版 GitCode,发现更多精彩内容 >>
提交
e16d7628
编写于
9月 14, 2022
作者:
D
DepFA
提交者:
AUTOMATIC1111
9月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add draw legend toggle
上级
35229d94
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
6 deletion
+10
-6
scripts/xy_grid.py
scripts/xy_grid.py
+10
-6
未找到文件。
scripts/xy_grid.py
浏览文件 @
e16d7628
...
@@ -78,7 +78,7 @@ axis_options = [
...
@@ -78,7 +78,7 @@ axis_options = [
]
]
def
draw_xy_grid
(
p
,
xs
,
ys
,
x_label
,
y_label
,
cell
):
def
draw_xy_grid
(
p
,
xs
,
ys
,
x_label
,
y_label
,
cell
,
draw_legend
):
res
=
[]
res
=
[]
ver_texts
=
[[
images
.
GridAnnotation
(
y_label
(
y
))]
for
y
in
ys
]
ver_texts
=
[[
images
.
GridAnnotation
(
y_label
(
y
))]
for
y
in
ys
]
...
@@ -99,7 +99,8 @@ def draw_xy_grid(p, xs, ys, x_label, y_label, cell):
...
@@ -99,7 +99,8 @@ def draw_xy_grid(p, xs, ys, x_label, y_label, cell):
res
.
append
(
processed
.
images
[
0
])
res
.
append
(
processed
.
images
[
0
])
grid
=
images
.
image_grid
(
res
,
rows
=
len
(
ys
))
grid
=
images
.
image_grid
(
res
,
rows
=
len
(
ys
))
grid
=
images
.
draw_grid_annotations
(
grid
,
res
[
0
].
width
,
res
[
0
].
height
,
hor_texts
,
ver_texts
)
if
draw_legend
:
grid
=
images
.
draw_grid_annotations
(
grid
,
res
[
0
].
width
,
res
[
0
].
height
,
hor_texts
,
ver_texts
)
first_pocessed
.
images
=
[
grid
]
first_pocessed
.
images
=
[
grid
]
...
@@ -126,10 +127,12 @@ class Script(scripts.Script):
...
@@ -126,10 +127,12 @@ class Script(scripts.Script):
with
gr
.
Row
():
with
gr
.
Row
():
y_type
=
gr
.
Dropdown
(
label
=
"Y type"
,
choices
=
[
x
.
label
for
x
in
current_axis_options
],
value
=
current_axis_options
[
4
].
label
,
visible
=
False
,
type
=
"index"
,
elem_id
=
"y_type"
)
y_type
=
gr
.
Dropdown
(
label
=
"Y type"
,
choices
=
[
x
.
label
for
x
in
current_axis_options
],
value
=
current_axis_options
[
4
].
label
,
visible
=
False
,
type
=
"index"
,
elem_id
=
"y_type"
)
y_values
=
gr
.
Textbox
(
label
=
"Y values"
,
visible
=
False
,
lines
=
1
)
y_values
=
gr
.
Textbox
(
label
=
"Y values"
,
visible
=
False
,
lines
=
1
)
draw_legend
=
gr
.
Checkbox
(
label
=
'Draw legend'
,
value
=
True
)
return
[
x_type
,
x_values
,
y_type
,
y_values
,
draw_legend
]
return
[
x_type
,
x_values
,
y_type
,
y_values
]
def
run
(
self
,
p
,
x_type
,
x_values
,
y_type
,
y_values
,
draw_legend
):
def
run
(
self
,
p
,
x_type
,
x_values
,
y_type
,
y_values
):
modules
.
processing
.
fix_seed
(
p
)
modules
.
processing
.
fix_seed
(
p
)
p
.
batch_size
=
1
p
.
batch_size
=
1
...
@@ -205,7 +208,8 @@ class Script(scripts.Script):
...
@@ -205,7 +208,8 @@ class Script(scripts.Script):
ys
=
ys
,
ys
=
ys
,
x_label
=
lambda
x
:
x_opt
.
format_value
(
p
,
x_opt
,
x
),
x_label
=
lambda
x
:
x_opt
.
format_value
(
p
,
x_opt
,
x
),
y_label
=
lambda
y
:
y_opt
.
format_value
(
p
,
y_opt
,
y
),
y_label
=
lambda
y
:
y_opt
.
format_value
(
p
,
y_opt
,
y
),
cell
=
cell
cell
=
cell
,
draw_legend
=
draw_legend
)
)
if
opts
.
grid_save
:
if
opts
.
grid_save
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录