Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
e5f1a37c
Commit
e5f1a37c
authored
Jan 01, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make refresh buttons look more nice
parent
b46b97fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
10 deletions
+42
-10
ui.py
modules/ui.py
+3
-3
ui_components.py
modules/ui_components.py
+18
-0
style.css
style.css
+21
-7
No files found.
modules/ui.py
View file @
e5f1a37c
...
...
@@ -19,7 +19,7 @@ import numpy as np
from
PIL
import
Image
,
PngImagePlugin
from
modules.call_queue
import
wrap_gradio_gpu_call
,
wrap_queued_call
,
wrap_gradio_call
from
modules
import
sd_hijack
,
sd_models
,
localization
,
script_callbacks
,
ui_extensions
,
deepbooru
from
modules
import
sd_hijack
,
sd_models
,
localization
,
script_callbacks
,
ui_extensions
,
deepbooru
,
ui_components
from
modules.paths
import
script_path
from
modules.shared
import
opts
,
cmd_opts
,
restricted_opts
...
...
@@ -532,7 +532,7 @@ def create_refresh_button(refresh_component, refresh_method, refreshed_args, ele
return
gr
.
update
(
**
(
args
or
{}))
refresh_button
=
gr
.
Button
(
value
=
refresh_symbol
,
elem_id
=
elem_id
)
refresh_button
=
ui_components
.
Tool
Button
(
value
=
refresh_symbol
,
elem_id
=
elem_id
)
refresh_button
.
click
(
fn
=
refresh
,
inputs
=
[],
...
...
@@ -1476,7 +1476,7 @@ def create_ui():
res
=
comp
(
label
=
info
.
label
,
value
=
fun
(),
elem_id
=
elem_id
,
**
(
args
or
{}))
create_refresh_button
(
res
,
info
.
refresh
,
info
.
component_args
,
"refresh_"
+
key
)
else
:
with
gr
.
Row
(
variant
=
"compact"
):
with
ui_components
.
FormRow
(
):
res
=
comp
(
label
=
info
.
label
,
value
=
fun
(),
elem_id
=
elem_id
,
**
(
args
or
{}))
create_refresh_button
(
res
,
info
.
refresh
,
info
.
component_args
,
"refresh_"
+
key
)
else
:
...
...
modules/ui_components.py
0 → 100644
View file @
e5f1a37c
import
gradio
as
gr
class
ToolButton
(
gr
.
Button
,
gr
.
components
.
FormComponent
):
"""Small button with single emoji as text, fits inside gradio forms"""
def
__init__
(
self
,
**
kwargs
):
super
()
.
__init__
(
variant
=
"tool"
,
**
kwargs
)
def
get_block_name
(
self
):
return
"button"
class
FormRow
(
gr
.
Row
,
gr
.
components
.
FormComponent
):
"""Same as gr.Row but fits inside gradio forms"""
def
get_block_name
(
self
):
return
"row"
style.css
View file @
e5f1a37c
...
...
@@ -496,13 +496,6 @@ input[type="range"]{
padding
:
0
;
}
#refresh_sd_model_checkpoint
,
#refresh_sd_vae
,
#refresh_sd_hypernetwork
,
#refresh_train_hypernetwork_name
,
#refresh_train_embedding_name
,
#refresh_localization
,
#refresh_checkpoint_A
,
#refresh_checkpoint_B
,
#refresh_checkpoint_C
{
max-width
:
2.5em
;
min-width
:
2.5em
;
height
:
2.4em
;
}
canvas
[
key
=
"mask"
]
{
z-index
:
12
!important
;
filter
:
invert
();
...
...
@@ -569,6 +562,27 @@ img2maskimg, #img2maskimg > .h-60, #img2maskimg > .h-60 > div, #img2maskimg > .h
padding-right
:
0.5em
;
}
.gr-form
{
background-color
:
white
;
}
.dark
.gr-form
{
background-color
:
rgb
(
31
41
55
/
var
(
--tw-bg-opacity
));
}
.gr-button-tool
{
max-width
:
2.5em
;
min-width
:
2.5em
!important
;
height
:
2.4em
;
margin
:
0.55em
0
;
}
#quicksettings
.gr-button-tool
{
margin
:
0
;
}
/* The following handles localization for right-to-left (RTL) languages like Arabic.
The rtl media type will only be activated by the logic in javascript/localization.js.
If you change anything above, you need to make sure it is RTL compliant by just running
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment