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
29a3a7eb
Commit
29a3a7eb
authored
Jan 01, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show sampler selection in dropdown, add option selection to revert to old radio group
parent
360feed9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
7 deletions
+16
-7
modules/shared.py
modules/shared.py
+1
-0
modules/ui.py
modules/ui.py
+15
-7
No files found.
modules/shared.py
View file @
29a3a7eb
...
...
@@ -406,6 +406,7 @@ options_templates.update(options_section(('ui', "User interface"), {
"js_modal_lightbox"
:
OptionInfo
(
True
,
"Enable full page image viewer"
),
"js_modal_lightbox_initially_zoomed"
:
OptionInfo
(
True
,
"Show images zoomed in by default in full page image viewer"
),
"show_progress_in_title"
:
OptionInfo
(
True
,
"Show generation progress in window title."
),
"samplers_in_dropdown"
:
OptionInfo
(
True
,
"Use dropdown for sampler selection instead of radio group"
),
'quicksettings'
:
OptionInfo
(
"sd_model_checkpoint"
,
"Quicksettings list"
),
'localization'
:
OptionInfo
(
"None"
,
"Localization (requires restart)"
,
gr
.
Dropdown
,
lambda
:
{
"choices"
:
[
"None"
]
+
list
(
localization
.
localizations
.
keys
())},
refresh
=
lambda
:
localization
.
list_localizations
(
cmd_opts
.
localizations_dir
)),
}))
...
...
modules/ui.py
View file @
29a3a7eb
...
...
@@ -643,6 +643,19 @@ Requested path was: {f}
return
result_gallery
,
generation_info
if
tabname
!=
"extras"
else
html_info_x
,
html_info
,
html_log
def
create_sampler_and_steps_selection
(
choices
,
tabname
):
if
opts
.
samplers_in_dropdown
:
with
gr
.
Row
(
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"
)
steps
=
gr
.
Slider
(
minimum
=
1
,
maximum
=
150
,
step
=
1
,
elem_id
=
f
"{tabname}_steps"
,
label
=
"Sampling Steps"
,
value
=
20
)
else
:
with
gr
.
Group
(
elem_id
=
f
"sampler_selection_{tabname}"
):
steps
=
gr
.
Slider
(
minimum
=
1
,
maximum
=
150
,
step
=
1
,
elem_id
=
f
"{tabname}_steps"
,
label
=
"Sampling Steps"
,
value
=
20
)
sampler_index
=
gr
.
Radio
(
label
=
'Sampling method'
,
elem_id
=
f
"{tabname}_sampling"
,
choices
=
[
x
.
name
for
x
in
choices
],
value
=
choices
[
0
]
.
name
,
type
=
"index"
)
return
steps
,
sampler_index
def
create_ui
():
import
modules.img2img
import
modules.txt2img
...
...
@@ -660,9 +673,6 @@ def create_ui():
dummy_component
=
gr
.
Label
(
visible
=
False
)
txt_prompt_img
=
gr
.
File
(
label
=
""
,
elem_id
=
"txt2img_prompt_image"
,
file_count
=
"single"
,
type
=
"bytes"
,
visible
=
False
)
with
gr
.
Row
(
elem_id
=
'txt2img_progress_row'
):
with
gr
.
Column
(
scale
=
1
):
pass
...
...
@@ -674,8 +684,7 @@ def create_ui():
with
gr
.
Row
()
.
style
(
equal_height
=
False
):
with
gr
.
Column
(
variant
=
'panel'
,
elem_id
=
"txt2img_settings"
):
steps
=
gr
.
Slider
(
minimum
=
1
,
maximum
=
150
,
step
=
1
,
label
=
"Sampling Steps"
,
value
=
20
)
sampler_index
=
gr
.
Radio
(
label
=
'Sampling method'
,
elem_id
=
"txt2img_sampling"
,
choices
=
[
x
.
name
for
x
in
samplers
],
value
=
samplers
[
0
]
.
name
,
type
=
"index"
)
steps
,
sampler_index
=
create_sampler_and_steps_selection
(
samplers
,
"txt2img"
)
with
gr
.
Group
():
width
=
gr
.
Slider
(
minimum
=
64
,
maximum
=
2048
,
step
=
8
,
label
=
"Width"
,
value
=
512
)
...
...
@@ -875,8 +884,7 @@ def create_ui():
with
gr
.
Row
():
resize_mode
=
gr
.
Radio
(
label
=
"Resize mode"
,
elem_id
=
"resize_mode"
,
show_label
=
False
,
choices
=
[
"Just resize"
,
"Crop and resize"
,
"Resize and fill"
,
"Just resize (latent upscale)"
],
type
=
"index"
,
value
=
"Just resize"
)
steps
=
gr
.
Slider
(
minimum
=
1
,
maximum
=
150
,
step
=
1
,
label
=
"Sampling Steps"
,
value
=
20
)
sampler_index
=
gr
.
Radio
(
label
=
'Sampling method'
,
choices
=
[
x
.
name
for
x
in
samplers_for_img2img
],
value
=
samplers_for_img2img
[
0
]
.
name
,
type
=
"index"
)
steps
,
sampler_index
=
create_sampler_and_steps_selection
(
samplers_for_img2img
,
"img2img"
)
with
gr
.
Group
():
width
=
gr
.
Slider
(
minimum
=
64
,
maximum
=
2048
,
step
=
8
,
label
=
"Width"
,
value
=
512
,
elem_id
=
"img2img_width"
)
...
...
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