Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
S
Stable Diffusion Webui
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
Hunter0726
Stable Diffusion Webui
提交
6d1c01c9
提交
6d1c01c9
编辑于
2 years ago
作者:
DepFA
提交者:
AUTOMATIC1111
2 years ago
浏览文件
操作
下载
补丁
差异文件
Add section splitting to settings ui
上级
dec75849
No related branches found
No related tags found
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
modules/ui.py
+16
-7
16 个添加, 7 个删除
modules/ui.py
有
16 个添加
和
7 个删除
modules/ui.py
+
16
−
7
浏览文件 @
6d1c01c9
...
@@ -9,6 +9,7 @@ import random
...
@@ -9,6 +9,7 @@ import random
import
sys
import
sys
import
time
import
time
import
traceback
import
traceback
import
itertools
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
...
@@ -842,14 +843,22 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
...
@@ -842,14 +843,22 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
settings_submit
=
gr
.
Button
(
value
=
"
Apply settings
"
,
variant
=
'
primary
'
)
settings_submit
=
gr
.
Button
(
value
=
"
Apply settings
"
,
variant
=
'
primary
'
)
result
=
gr
.
HTML
()
result
=
gr
.
HTML
()
with
gr
.
Row
(
elem_id
=
"
settings
"
).
style
(
equal_height
=
False
):
sortedKeys
=
sorted
([(
opts
.
data_labels
[
key
].
section
,
key
)
for
key
in
keys
],
key
=
lambda
x
:
x
[
0
])
for
colno
in
range
(
settings_cols
):
groupedKeys
=
itertools
.
groupby
(
sortedKeys
,
key
=
lambda
x
:
x
[
0
])
with
gr
.
Column
(
variant
=
'
panel
'
):
for
rowno
in
range
(
items_per_col
):
index
=
rowno
+
colno
*
items_per_col
if
index
<
len
(
keys
):
for
(
sectionNumber
,
sectionName
),
sectionGroup
in
groupedKeys
:
components
.
append
(
create_setting_component
(
keys
[
index
]))
with
gr
.
Row
(
elem_id
=
"
settings_header_{}
"
.
format
(
sectionNumber
)).
style
(
equal_height
=
False
):
gr
.
HTML
(
elem_id
=
"
settings_header_text_{}
"
.
format
(
sectionNumber
),
value
=
'
<h1 class=
"
gr-button-lg
"
>{}</h1>
'
.
format
(
sectionName
))
with
gr
.
Row
(
elem_id
=
"
settings_{}
"
.
format
(
sectionNumber
)).
style
(
equal_height
=
False
):
columnLookup
=
{}
for
colNum
,
element
in
zip
(
itertools
.
cycle
(
range
(
settings_cols
)),
sectionGroup
):
columnLookup
.
setdefault
(
colNum
,[]).
append
(
element
)
for
colno
,
elements
in
sorted
(
columnLookup
.
items
()):
with
gr
.
Column
(
variant
=
'
panel
'
):
for
_
,
keyElement
in
elements
:
components
.
append
(
create_setting_component
(
keyElement
))
settings_submit
.
click
(
settings_submit
.
click
(
fn
=
run_settings
,
fn
=
run_settings
,
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录