Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
9 deletions
+2
-9
modules/scripts.py
modules/scripts.py
+0
-1
modules/ui.py
modules/ui.py
+2
-8
No files found.
modules/scripts.py
View file @
3246a2d6
...
@@ -290,7 +290,6 @@ class ScriptRunner:
...
@@ -290,7 +290,6 @@ class ScriptRunner:
script
.
group
=
group
script
.
group
=
group
dropdown
=
gr
.
Dropdown
(
label
=
"Script"
,
elem_id
=
"script_list"
,
choices
=
[
"None"
]
+
self
.
titles
,
value
=
"None"
,
type
=
"index"
)
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
inputs
[
0
]
=
dropdown
for
script
in
self
.
selectable_scripts
:
for
script
in
self
.
selectable_scripts
:
...
...
modules/ui.py
View file @
3246a2d6
...
@@ -435,11 +435,9 @@ def create_toprow(is_img2img):
...
@@ -435,11 +435,9 @@ 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
,
prompt_style
,
negative_prompt
,
prompt_style2
,
submit
,
button_interrogate
,
button_deepbooru
,
prompt_style_apply
,
save_style
,
paste
,
token_counter
,
token_button
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):
...
@@ -638,7 +636,6 @@ def create_sampler_and_steps_selection(choices, tabname):
if
opts
.
samplers_in_dropdown
:
if
opts
.
samplers_in_dropdown
:
with
FormRow
(
elem_id
=
f
"sampler_selection_{tabname}"
):
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
=
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
)
steps
=
gr
.
Slider
(
minimum
=
1
,
maximum
=
150
,
step
=
1
,
elem_id
=
f
"{tabname}_steps"
,
label
=
"Sampling steps"
,
value
=
20
)
else
:
else
:
with
FormGroup
(
elem_id
=
f
"sampler_selection_{tabname}"
):
with
FormGroup
(
elem_id
=
f
"sampler_selection_{tabname}"
):
...
@@ -1794,7 +1791,7 @@ def create_ui():
...
@@ -1794,7 +1791,7 @@ def create_ui():
if
init_field
is
not
None
:
if
init_field
is
not
None
:
init_field
(
saved_value
)
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'
)
apply_field
(
x
,
'visible'
)
if
type
(
x
)
==
gr
.
Slider
:
if
type
(
x
)
==
gr
.
Slider
:
...
@@ -1815,11 +1812,8 @@ def create_ui():
...
@@ -1815,11 +1812,8 @@ def create_ui():
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,
if
type
(
x
)
==
gr
.
Dropdown
:
# we only mark dropdowns that should be saved.
if
type
(
x
)
==
gr
.
Dropdown
and
getattr
(
x
,
'save_to_config'
,
False
):
apply_field
(
x
,
'value'
,
lambda
val
:
val
in
x
.
choices
,
getattr
(
x
,
'init_field'
,
None
))
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
(
txt2img_interface
,
loadsave
,
"txt2img"
)
visit
(
img2img_interface
,
loadsave
,
"img2img"
)
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