mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 19:05:05 +08:00
feat: Add option to sort XYZ plot alphabetically
This commit is contained in:
parent
d5e26274c8
commit
d1a262eeea
@ -322,6 +322,7 @@ options_templates.update(options_section(('ui_alternatives', "UI alternatives",
|
||||
"txt2img_settings_accordion": OptionInfo(False, "Settings in txt2img hidden under Accordion").needs_reload_ui(),
|
||||
"img2img_settings_accordion": OptionInfo(False, "Settings in img2img hidden under Accordion").needs_reload_ui(),
|
||||
"interrupt_after_current": OptionInfo(True, "Don't Interrupt in the middle").info("when using Interrupt button, if generating more than one image, stop after the generation of an image has finished, instead of immediately"),
|
||||
"xyz_plot_sort_alphabetical": OptionInfo(True, "Sort XYZ plot options alphabetically").needs_reload_ui(),
|
||||
}))
|
||||
|
||||
options_templates.update(options_section(('ui', "User interface", "ui"), {
|
||||
|
@ -417,7 +417,11 @@ class Script(scripts.Script):
|
||||
return "X/Y/Z plot"
|
||||
|
||||
def ui(self, is_img2img):
|
||||
self.current_axis_options = [x for x in axis_options if type(x) == AxisOption or x.is_img2img == is_img2img]
|
||||
_axis_options = copy(axis_options)
|
||||
if opts.xyz_plot_sort_alphabetical:
|
||||
_axis_options.sort(key=lambda x: (x.label != "Nothing", x.label)) # Sort by label, but keep "Nothing" first
|
||||
|
||||
self.current_axis_options = [x for x in _axis_options if type(x) == AxisOption or x.is_img2img == is_img2img]
|
||||
|
||||
with gr.Row():
|
||||
with gr.Column(scale=19):
|
||||
|
Loading…
Reference in New Issue
Block a user