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
20bf9905
Commit
20bf9905
authored
Oct 15, 2022
by
CookieHCl
Committed by
AUTOMATIC1111
Oct 16, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make style configurable in ui-config.json
parent
3395ba49
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
ui.py
modules/ui.py
+7
-0
No files found.
modules/ui.py
View file @
20bf9905
...
@@ -508,9 +508,11 @@ def create_toprow(is_img2img):
...
@@ -508,9 +508,11 @@ def create_toprow(is_img2img):
with
gr
.
Row
():
with
gr
.
Row
():
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"style_pos_col"
):
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"style_pos_col"
):
prompt_style
=
gr
.
Dropdown
(
label
=
"Style 1"
,
elem_id
=
f
"{id_part}_style_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())))
prompt_style
=
gr
.
Dropdown
(
label
=
"Style 1"
,
elem_id
=
f
"{id_part}_style_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())))
prompt_style
.
save_to_config
=
True
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"style_neg_col"
):
with
gr
.
Column
(
scale
=
1
,
elem_id
=
"style_neg_col"
):
prompt_style2
=
gr
.
Dropdown
(
label
=
"Style 2"
,
elem_id
=
f
"{id_part}_style2_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())))
prompt_style2
=
gr
.
Dropdown
(
label
=
"Style 2"
,
elem_id
=
f
"{id_part}_style2_index"
,
choices
=
[
k
for
k
,
v
in
shared
.
prompt_styles
.
styles
.
items
()],
value
=
next
(
iter
(
shared
.
prompt_styles
.
styles
.
keys
())))
prompt_style2
.
save_to_config
=
True
return
prompt
,
roll
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
button_interrogate
,
button_deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
return
prompt
,
roll
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
button_interrogate
,
button_deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
...
@@ -1739,6 +1741,11 @@ Requested path was: {f}
...
@@ -1739,6 +1741,11 @@ Requested path was: {f}
if
type
(
x
)
==
gr
.
Number
:
if
type
(
x
)
==
gr
.
Number
:
apply_field
(
x
,
'value'
)
apply_field
(
x
,
'value'
)
# Since there are many dropdowns that shouldn't be saved,
# we only mark dropdowns that should be saved.
if
type
(
x
)
==
gr
.
Dropdown
and
getattr
(
x
,
'save_to_config'
,
False
):
apply_field
(
x
,
'value'
)
visit
(
txt2img_interface
,
loadsave
,
"txt2img"
)
visit
(
txt2img_interface
,
loadsave
,
"txt2img"
)
visit
(
img2img_interface
,
loadsave
,
"img2img"
)
visit
(
img2img_interface
,
loadsave
,
"img2img"
)
visit
(
extras_interface
,
loadsave
,
"extras"
)
visit
(
extras_interface
,
loadsave
,
"extras"
)
...
...
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