Allow user input for gradio theme selection
This commit is contained in:
parent
e018c8a391
commit
b06205eaf6
@ -410,7 +410,7 @@ options_templates.update(options_section(('ui', "User interface"), {
|
|||||||
"ui_reorder": OptionInfo(", ".join(ui_reorder_categories), "txt2img/img2img UI item order"),
|
"ui_reorder": OptionInfo(", ".join(ui_reorder_categories), "txt2img/img2img UI item order"),
|
||||||
"ui_extra_networks_tab_reorder": OptionInfo("", "Extra networks tab order"),
|
"ui_extra_networks_tab_reorder": OptionInfo("", "Extra networks tab order"),
|
||||||
"localization": OptionInfo("None", "Localization (requires restart)", gr.Dropdown, lambda: {"choices": ["None"] + list(localization.localizations.keys())}, refresh=lambda: localization.list_localizations(cmd_opts.localizations_dir)),
|
"localization": OptionInfo("None", "Localization (requires restart)", gr.Dropdown, lambda: {"choices": ["None"] + list(localization.localizations.keys())}, refresh=lambda: localization.list_localizations(cmd_opts.localizations_dir)),
|
||||||
"gradio_theme": OptionInfo("Default", "Gradio theme (requires restart)", gr.Dropdown, lambda: {"choices": ["Default"] + gradio_hf_hub_themes})
|
"gradio_theme": OptionInfo("Default", "Gradio theme (requires restart)", ui_components.DropdownEditable, lambda: {"choices": ["Default"] + gradio_hf_hub_themes})
|
||||||
}))
|
}))
|
||||||
|
|
||||||
options_templates.update(options_section(('ui', "Live previews"), {
|
options_templates.update(options_section(('ui', "Live previews"), {
|
||||||
|
@ -62,3 +62,13 @@ class DropdownMulti(FormComponent, gr.Dropdown):
|
|||||||
|
|
||||||
def get_block_name(self):
|
def get_block_name(self):
|
||||||
return "dropdown"
|
return "dropdown"
|
||||||
|
|
||||||
|
|
||||||
|
class DropdownEditable(FormComponent, gr.Dropdown):
|
||||||
|
"""Same as gr.Dropdown but allows editing value"""
|
||||||
|
def __init__(self, **kwargs):
|
||||||
|
super().__init__(allow_custom_value=True, **kwargs)
|
||||||
|
|
||||||
|
def get_block_name(self):
|
||||||
|
return "dropdown"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user