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
3246a2d6
Commit
3246a2d6
authored
Jan 06, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove restriction for saving dropdowns to ui-config.json
parent
5265918b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
9 deletions
+2
-9
scripts.py
modules/scripts.py
+0
-1
ui.py
modules/ui.py
+2
-8
No files found.
modules/scripts.py
View file @
3246a2d6
...
...
@@ -290,7 +290,6 @@ class ScriptRunner:
script
.
group
=
group
dropdown
=
gr
.
Dropdown
(
label
=
"Script"
,
elem_id
=
"script_list"
,
choices
=
[
"None"
]
+
self
.
titles
,
value
=
"None"
,
type
=
"index"
)
dropdown
.
save_to_config
=
True
inputs
[
0
]
=
dropdown
for
script
in
self
.
selectable_scripts
:
...
...
modules/ui.py
View file @
3246a2d6
...
...
@@ -435,11 +435,9 @@ def create_toprow(is_img2img):
with
gr
.
Row
():
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
.
save_to_config
=
True
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
.
save_to_config
=
True
return
prompt
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
button_interrogate
,
button_deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
...
...
@@ -638,7 +636,6 @@ def create_sampler_and_steps_selection(choices, tabname):
if
opts
.
samplers_in_dropdown
:
with
FormRow
(
elem_id
=
f
"sampler_selection_{tabname}"
):
sampler_index
=
gr
.
Dropdown
(
label
=
'Sampling method'
,
elem_id
=
f
"{tabname}_sampling"
,
choices
=
[
x
.
name
for
x
in
choices
],
value
=
choices
[
0
]
.
name
,
type
=
"index"
)
sampler_index
.
save_to_config
=
True
steps
=
gr
.
Slider
(
minimum
=
1
,
maximum
=
150
,
step
=
1
,
elem_id
=
f
"{tabname}_steps"
,
label
=
"Sampling steps"
,
value
=
20
)
else
:
with
FormGroup
(
elem_id
=
f
"sampler_selection_{tabname}"
):
...
...
@@ -1794,7 +1791,7 @@ def create_ui():
if
init_field
is
not
None
:
init_field
(
saved_value
)
if
type
(
x
)
in
[
gr
.
Slider
,
gr
.
Radio
,
gr
.
Checkbox
,
gr
.
Textbox
,
gr
.
Number
]
and
x
.
visible
:
if
type
(
x
)
in
[
gr
.
Slider
,
gr
.
Radio
,
gr
.
Checkbox
,
gr
.
Textbox
,
gr
.
Number
,
gr
.
Dropdown
]
and
x
.
visible
:
apply_field
(
x
,
'visible'
)
if
type
(
x
)
==
gr
.
Slider
:
...
...
@@ -1815,11 +1812,8 @@ def create_ui():
if
type
(
x
)
==
gr
.
Number
:
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
):
if
type
(
x
)
==
gr
.
Dropdown
:
apply_field
(
x
,
'value'
,
lambda
val
:
val
in
x
.
choices
,
getattr
(
x
,
'init_field'
,
None
))
apply_field
(
x
,
'visible'
)
visit
(
txt2img_interface
,
loadsave
,
"txt2img"
)
visit
(
img2img_interface
,
loadsave
,
"img2img"
)
...
...
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