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
6d1c01c9
Commit
6d1c01c9
authored
Sep 22, 2022
by
DepFA
Committed by
AUTOMATIC1111
Sep 22, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add section splitting to settings ui
parent
dec75849
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
ui.py
modules/ui.py
+16
-7
No files found.
modules/ui.py
View file @
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
,
...
...
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