Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Overbill1683
Stable Diffusion Webui
提交
f93547be
S
Stable Diffusion Webui
项目概览
Overbill1683
/
Stable Diffusion Webui
10 个月 前同步成功
通知
1747
Star
81
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
分析
仓库
DevOps
项目成员
Pages
S
Stable Diffusion Webui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Pages
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
提交
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f93547be
编写于
3月 21, 2023
作者:
A
AUTOMATIC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hide delete button for single-item dropdown
more stylistic changes
上级
46482dec
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
50 addition
and
12 deletion
+50
-12
modules/scripts.py
modules/scripts.py
+13
-2
modules/ui.py
modules/ui.py
+2
-0
modules/ui_common.py
modules/ui_common.py
+1
-1
style.css
style.css
+34
-9
未找到文件。
modules/scripts.py
浏览文件 @
f93547be
...
@@ -513,6 +513,18 @@ def reload_scripts():
...
@@ -513,6 +513,18 @@ def reload_scripts():
scripts_postproc
=
scripts_postprocessing
.
ScriptPostprocessingRunner
()
scripts_postproc
=
scripts_postprocessing
.
ScriptPostprocessingRunner
()
def
add_classes_to_gradio_component
(
comp
):
"""
this adds gradio-* to the component for css styling (ie gradio-button to gr.Button), as well as some others
"""
comp
.
elem_classes
=
[
"gradio-"
+
comp
.
get_block_name
(),
*
(
comp
.
elem_classes
or
[])]
if
getattr
(
comp
,
'multiselect'
,
False
):
comp
.
elem_classes
.
append
(
'multiselect'
)
def
IOComponent_init
(
self
,
*
args
,
**
kwargs
):
def
IOComponent_init
(
self
,
*
args
,
**
kwargs
):
if
scripts_current
is
not
None
:
if
scripts_current
is
not
None
:
scripts_current
.
before_component
(
self
,
**
kwargs
)
scripts_current
.
before_component
(
self
,
**
kwargs
)
...
@@ -521,8 +533,7 @@ def IOComponent_init(self, *args, **kwargs):
...
@@ -521,8 +533,7 @@ def IOComponent_init(self, *args, **kwargs):
res
=
original_IOComponent_init
(
self
,
*
args
,
**
kwargs
)
res
=
original_IOComponent_init
(
self
,
*
args
,
**
kwargs
)
# this adds gradio-* to every component for css styling (ie gradio-button to gr.Button)
add_classes_to_gradio_component
(
self
)
self
.
elem_classes
=
[
"gradio-"
+
self
.
get_block_name
(),
*
(
self
.
elem_classes
or
[])]
script_callbacks
.
after_component_callback
(
self
,
**
kwargs
)
script_callbacks
.
after_component_callback
(
self
,
**
kwargs
)
...
...
modules/ui.py
浏览文件 @
f93547be
...
@@ -1601,11 +1601,13 @@ def create_ui():
...
@@ -1601,11 +1601,13 @@ def create_ui():
for
i
,
k
,
item
in
quicksettings_list
:
for
i
,
k
,
item
in
quicksettings_list
:
component
=
component_dict
[
k
]
component
=
component_dict
[
k
]
info
=
opts
.
data_labels
[
k
]
component
.
change
(
component
.
change
(
fn
=
lambda
value
,
k
=
k
:
run_settings_single
(
value
,
key
=
k
),
fn
=
lambda
value
,
k
=
k
:
run_settings_single
(
value
,
key
=
k
),
inputs
=
[
component
],
inputs
=
[
component
],
outputs
=
[
component
,
text_settings
],
outputs
=
[
component
,
text_settings
],
show_progress
=
info
.
refresh
is
not
None
,
)
)
text_settings
.
change
(
text_settings
.
change
(
...
...
modules/ui_common.py
浏览文件 @
f93547be
...
@@ -129,7 +129,7 @@ Requested path was: {f}
...
@@ -129,7 +129,7 @@ Requested path was: {f}
generation_info
=
None
generation_info
=
None
with
gr
.
Column
():
with
gr
.
Column
():
with
gr
.
Row
(
elem_id
=
f
"image_buttons_
{
tabname
}
"
):
with
gr
.
Row
(
elem_id
=
f
"image_buttons_
{
tabname
}
"
,
elem_classes
=
"image-buttons"
):
open_folder_button
=
gr
.
Button
(
folder_symbol
,
visible
=
not
shared
.
cmd_opts
.
hide_ui_dir_config
)
open_folder_button
=
gr
.
Button
(
folder_symbol
,
visible
=
not
shared
.
cmd_opts
.
hide_ui_dir_config
)
if
tabname
!=
"extras"
:
if
tabname
!=
"extras"
:
...
...
style.css
浏览文件 @
f93547be
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
}
}
.block.padded
{
.block.padded
{
padding
:
0
.2em
0.5em
!important
;
padding
:
0
!important
;
}
}
div
.gradio-container
{
div
.gradio-container
{
...
@@ -38,7 +38,8 @@ div.form{
...
@@ -38,7 +38,8 @@ div.form{
.block.gradio-textbox
,
.block.gradio-textbox
,
.block.gradio-radio
,
.block.gradio-radio
,
.block.gradio-checkboxgroup
,
.block.gradio-checkboxgroup
,
.block.gradio-number
.block.gradio-number
,
.block.gradio-colorpicker
{
{
border-width
:
0
!important
;
border-width
:
0
!important
;
box-shadow
:
none
!important
;
box-shadow
:
none
!important
;
...
@@ -46,11 +47,11 @@ div.form{
...
@@ -46,11 +47,11 @@ div.form{
.gap.compact
{
.gap.compact
{
padding
:
0
;
padding
:
0
;
gap
:
0
;
gap
:
0
.2em
0
;
}
}
div
.compact
{
div
.compact
{
gap
:
0.5
em
;
gap
:
1
em
;
}
}
.gradio-dropdown
ul
.options
{
.gradio-dropdown
ul
.options
{
...
@@ -58,7 +59,10 @@ div.compact{
...
@@ -58,7 +59,10 @@ div.compact{
z-index
:
3000
;
z-index
:
3000
;
}
}
.gradio-dropdown
label
span
:not
(
.has-info
)
{
.gradio-dropdown
label
span
:not
(
.has-info
),
.gradio-textbox
label
span
:not
(
.has-info
),
.gradio-number
label
span
:not
(
.has-info
)
{
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
...
@@ -66,6 +70,14 @@ div.compact{
...
@@ -66,6 +70,14 @@ div.compact{
box-shadow
:
0
1px
2px
0
rgba
(
0
,
0
,
0
,
0.05
);
box-shadow
:
0
1px
2px
0
rgba
(
0
,
0
,
0
,
0.05
);
}
}
.gradio-dropdown
.token-remove.remove-all.remove-all
{
display
:
none
;
}
.gradio-dropdown.multiselect
.token-remove.remove-all.remove-all
{
display
:
flex
;
}
.gradio-slider
input
[
type
=
"number"
]
{
.gradio-slider
input
[
type
=
"number"
]
{
width
:
6em
;
width
:
6em
;
}
}
...
@@ -81,6 +93,17 @@ div.gradio-html.min{
...
@@ -81,6 +93,17 @@ div.gradio-html.min{
min-height
:
0
;
min-height
:
0
;
}
}
.block.gradio-gallery
{
background
:
var
(
--input-background-fill
);
}
.gradio-container
.prose
a
,
.gradio-container
.prose
a
:visited
{
color
:
unset
;
text-decoration
:
none
;
}
/* general styled components */
/* general styled components */
.gradio-button.tool
{
.gradio-button.tool
{
...
@@ -188,9 +211,7 @@ div.gradio-html.min{
...
@@ -188,9 +211,7 @@ div.gradio-html.min{
gap
:
0.5em
;
gap
:
0.5em
;
}
}
.interrogate-col
>
button
{
.interrogate-col
>
button
{
min-width
:
8em
;
flex
:
1
;
max-width
:
8em
;
height
:
5.45em
;
}
}
.generate-box
{
.generate-box
{
...
@@ -241,6 +262,10 @@ div.gradio-html.min{
...
@@ -241,6 +262,10 @@ div.gradio-html.min{
min-height
:
480px
!important
;
min-height
:
480px
!important
;
}
}
.image-buttons
button
{
min-width
:
auto
;
}
/* settings */
/* settings */
#quicksettings
{
#quicksettings
{
...
@@ -254,7 +279,6 @@ div.gradio-html.min{
...
@@ -254,7 +279,6 @@ div.gradio-html.min{
border
:
none
;
border
:
none
;
box-shadow
:
none
;
box-shadow
:
none
;
background
:
none
;
background
:
none
;
margin-right
:
10px
;
}
}
#quicksettings
.gradio-dropdown
.wrap-inner
{
#quicksettings
.gradio-dropdown
.wrap-inner
{
...
@@ -286,6 +310,7 @@ div.gradio-html.min{
...
@@ -286,6 +310,7 @@ div.gradio-html.min{
display
:
block
;
display
:
block
;
border
:
none
;
border
:
none
;
text-align
:
left
;
text-align
:
left
;
white-space
:
initial
;
}
}
#settings_result
{
#settings_result
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录