Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite294e46

Browse files
committed
split UI settings page into many
1 parentb58d061 commite294e46

File tree

2 files changed

+40
-30
lines changed

2 files changed

+40
-30
lines changed

‎extensions-builtin/extra-options-section/scripts/extra_options_section.py‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,14 @@ def before_process(self, p, *args):
6464
p.override_settings[name]=value
6565

6666

67-
shared.options_templates.update(shared.options_section(('ui',"User interface"), {
68-
"extra_options_txt2img":shared.OptionInfo([],"Options in main UI - txt2img",ui_components.DropdownMulti,lambda: {"choices":list(shared.opts.data_labels.keys())}).js("info","settingsHintsShowQuicksettings").info("setting entries that also appear in txt2img interfaces").needs_reload_ui(),
69-
"extra_options_img2img":shared.OptionInfo([],"Options in main UI - img2img",ui_components.DropdownMulti,lambda: {"choices":list(shared.opts.data_labels.keys())}).js("info","settingsHintsShowQuicksettings").info("setting entries that also appear in img2img interfaces").needs_reload_ui(),
70-
"extra_options_cols":shared.OptionInfo(1,"Options in main UI - number of columns",gr.Number, {"precision":0}).needs_reload_ui(),
71-
"extra_options_accordion":shared.OptionInfo(False,"Options in main UI - place into an accordion").needs_reload_ui()
67+
shared.options_templates.update(shared.options_section(('settings_in_ui',"Settings in UI","ui"), {
68+
"settings_in_ui":shared.OptionHTML("""
69+
This page allows you to add some settings to the main interface of txt2img and img2img tabs.
70+
"""),
71+
"extra_options_txt2img":shared.OptionInfo([],"Settings for txt2img",ui_components.DropdownMulti,lambda: {"choices":list(shared.opts.data_labels.keys())}).js("info","settingsHintsShowQuicksettings").info("setting entries that also appear in txt2img interfaces").needs_reload_ui(),
72+
"extra_options_img2img":shared.OptionInfo([],"Settings for img2img",ui_components.DropdownMulti,lambda: {"choices":list(shared.opts.data_labels.keys())}).js("info","settingsHintsShowQuicksettings").info("setting entries that also appear in img2img interfaces").needs_reload_ui(),
73+
"extra_options_cols":shared.OptionInfo(1,"Number of columns for added settings",gr.Number, {"precision":0}).needs_reload_ui(),
74+
"extra_options_accordion":shared.OptionInfo(False,"Place added settings into an accordion").needs_reload_ui()
7275
}))
7376

7477

‎modules/shared_options.py‎

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -250,38 +250,45 @@
250250
"sd_hypernetwork":OptionInfo("None","Add hypernetwork to prompt",gr.Dropdown,lambda: {"choices": ["None",*shared.hypernetworks]},refresh=shared_items.reload_hypernetworks),
251251
}))
252252

253-
options_templates.update(options_section(('ui',"User interface","ui"), {
254-
"localization":OptionInfo("None","Localization",gr.Dropdown,lambda: {"choices": ["None"]+list(localization.localizations.keys())},refresh=lambda:localization.list_localizations(cmd_opts.localizations_dir)).needs_reload_ui(),
255-
"gradio_theme":OptionInfo("Default","Gradio theme",ui_components.DropdownEditable,lambda: {"choices": ["Default"]+shared_gradio_themes.gradio_hf_hub_themes}).info("you can also manually enter any of themes from the <a href='https://huggingface.co/spaces/gradio/theme-gallery'>gallery</a>.").needs_reload_ui(),
256-
"gradio_themes_cache":OptionInfo(True,"Cache gradio themes locally").info("disable to update the selected Gradio theme"),
257-
"gallery_height":OptionInfo("","Gallery height",gr.Textbox).info("an be any valid CSS value").needs_reload_ui(),
258-
"return_grid":OptionInfo(True,"Show grid in results for web"),
259-
"do_not_show_images":OptionInfo(False,"Do not show any images in results for web"),
260-
"send_seed":OptionInfo(True,"Send seed when sending prompt or image to other interface"),
261-
"send_size":OptionInfo(True,"Send size when sending prompt or image to another interface"),
262-
"js_modal_lightbox":OptionInfo(True,"Enable full page image viewer"),
263-
"js_modal_lightbox_initially_zoomed":OptionInfo(True,"Show images zoomed in by default in full page image viewer"),
264-
"js_modal_lightbox_gamepad":OptionInfo(False,"Navigate image viewer with gamepad"),
265-
"js_modal_lightbox_gamepad_repeat":OptionInfo(250,"Gamepad repeat period, in milliseconds"),
266-
"show_progress_in_title":OptionInfo(True,"Show generation progress in window title."),
253+
options_templates.update(options_section(('ui_prompt_editing',"Prompt editing","ui"), {
254+
"keyedit_precision_attention":OptionInfo(0.1,"Precision for (attention:1.1) when editing the prompt with Ctrl+up/down",gr.Slider, {"minimum":0.01,"maximum":0.2,"step":0.001}),
255+
"keyedit_precision_extra":OptionInfo(0.05,"Precision for <extra networks:0.9> when editing the prompt with Ctrl+up/down",gr.Slider, {"minimum":0.01,"maximum":0.2,"step":0.001}),
256+
"keyedit_delimiters":OptionInfo(r".,\/!?%^*;:{}=`~() ","Word delimiters when editing the prompt with Ctrl+up/down"),
257+
"disable_token_counters":OptionInfo(False,"Disable prompt token counters").needs_reload_ui(),
258+
}))
259+
260+
options_templates.update(options_section(('ui_gallery',"Gallery","ui"), {
261+
"return_grid":OptionInfo(True,"Show grid in gallery"),
262+
"do_not_show_images":OptionInfo(False,"Do not show any images in gallery"),
263+
"js_modal_lightbox":OptionInfo(True,"Full page image viewer: enable"),
264+
"js_modal_lightbox_initially_zoomed":OptionInfo(True,"Full page image viewer: show images zoomed in by default"),
265+
"js_modal_lightbox_gamepad":OptionInfo(False,"Full page image viewer: navigate with gamepad"),
266+
"js_modal_lightbox_gamepad_repeat":OptionInfo(250,"Full page image viewer: gamepad repeat period").info("in milliseconds"),
267+
"gallery_height":OptionInfo("","Gallery height",gr.Textbox).info("can be any valid CSS value, for example 768px or 20em").needs_reload_ui(),
268+
}))
269+
270+
options_templates.update(options_section(('ui_alternatives',"UI alternatives","ui"), {
271+
"compact_prompt_box":OptionInfo(False,"Compact prompt layout").info("puts prompt and negative prompt inside the Generate tab, leaving more vertical space for the image on the right").needs_reload_ui(),
267272
"samplers_in_dropdown":OptionInfo(True,"Use dropdown for sampler selection instead of radio group").needs_reload_ui(),
268273
"dimensions_and_batch_together":OptionInfo(True,"Show Width/Height and Batch sliders in same row").needs_reload_ui(),
269-
"keyedit_precision_attention":OptionInfo(0.1,"Ctrl+up/down precision when editing (attention:1.1)",gr.Slider, {"minimum":0.01,"maximum":0.2,"step":0.001}),
270-
"keyedit_precision_extra":OptionInfo(0.05,"Ctrl+up/down precision when editing <extra networks:0.9>",gr.Slider, {"minimum":0.01,"maximum":0.2,"step":0.001}),
271-
"keyedit_delimiters":OptionInfo(r".,\/!?%^*;:{}=`~() ","Ctrl+up/down word delimiters"),
272-
"keyedit_delimiters_whitespace":OptionInfo(["Tab","Carriage Return","Line Feed"],"Ctrl+up/down whitespace delimiters",gr.CheckboxGroup,lambda: {"choices": ["Tab","Carriage Return","Line Feed"]}),
273-
"keyedit_move":OptionInfo(True,"Alt+left/right moves prompt elements"),
274-
"quicksettings_list":OptionInfo(["sd_model_checkpoint"],"Quicksettings list",ui_components.DropdownMulti,lambda: {"choices":list(shared.opts.data_labels.keys())}).js("info","settingsHintsShowQuicksettings").info("setting entries that appear at the top of page rather than in settings tab").needs_reload_ui(),
275-
"ui_tab_order":OptionInfo([],"UI tab order",ui_components.DropdownMulti,lambda: {"choices":list(shared.tab_names)}).needs_reload_ui(),
276-
"hidden_tabs":OptionInfo([],"Hidden UI tabs",ui_components.DropdownMulti,lambda: {"choices":list(shared.tab_names)}).needs_reload_ui(),
277-
"ui_reorder_list":OptionInfo([],"txt2img/img2img UI item order",ui_components.DropdownMulti,lambda: {"choices":list(shared_items.ui_reorder_categories())}).info("selected items appear first").needs_reload_ui(),
278274
"sd_checkpoint_dropdown_use_short":OptionInfo(False,"Checkpoint dropdown: use filenames without paths").info("models in subdirectories like photo/sd15.ckpt will be listed as just sd15.ckpt"),
279275
"hires_fix_show_sampler":OptionInfo(False,"Hires fix: show hires checkpoint and sampler selection").needs_reload_ui(),
280276
"hires_fix_show_prompts":OptionInfo(False,"Hires fix: show hires prompt and negative prompt").needs_reload_ui(),
281-
"disable_token_counters":OptionInfo(False,"Disable prompt token counters").needs_reload_ui(),
282277
"txt2img_settings_accordion":OptionInfo(False,"Settings in txt2img hidden under Accordion").needs_reload_ui(),
283278
"img2img_settings_accordion":OptionInfo(False,"Settings in img2img hidden under Accordion").needs_reload_ui(),
284-
"compact_prompt_box":OptionInfo(False,"Compact prompt layout").info("puts prompt and negative prompt inside the Generate tab, leaving more vertical space for the image on the right").needs_reload_ui(),
279+
}))
280+
281+
options_templates.update(options_section(('ui',"User interface","ui"), {
282+
"localization":OptionInfo("None","Localization",gr.Dropdown,lambda: {"choices": ["None"]+list(localization.localizations.keys())},refresh=lambda:localization.list_localizations(cmd_opts.localizations_dir)).needs_reload_ui(),
283+
"quicksettings_list":OptionInfo(["sd_model_checkpoint"],"Quicksettings list",ui_components.DropdownMulti,lambda: {"choices":list(shared.opts.data_labels.keys())}).js("info","settingsHintsShowQuicksettings").info("setting entries that appear at the top of page rather than in settings tab").needs_reload_ui(),
284+
"ui_tab_order":OptionInfo([],"UI tab order",ui_components.DropdownMulti,lambda: {"choices":list(shared.tab_names)}).needs_reload_ui(),
285+
"hidden_tabs":OptionInfo([],"Hidden UI tabs",ui_components.DropdownMulti,lambda: {"choices":list(shared.tab_names)}).needs_reload_ui(),
286+
"ui_reorder_list":OptionInfo([],"UI item order for txt2img/img2img tabs",ui_components.DropdownMulti,lambda: {"choices":list(shared_items.ui_reorder_categories())}).info("selected items appear first").needs_reload_ui(),
287+
"gradio_theme":OptionInfo("Default","Gradio theme",ui_components.DropdownEditable,lambda: {"choices": ["Default"]+shared_gradio_themes.gradio_hf_hub_themes}).info("you can also manually enter any of themes from the <a href='https://huggingface.co/spaces/gradio/theme-gallery'>gallery</a>.").needs_reload_ui(),
288+
"gradio_themes_cache":OptionInfo(True,"Cache gradio themes locally").info("disable to update the selected Gradio theme"),
289+
"show_progress_in_title":OptionInfo(True,"Show generation progress in window title."),
290+
"send_seed":OptionInfo(True,"Send seed when sending prompt or image to other interface"),
291+
"send_size":OptionInfo(True,"Send size when sending prompt or image to another interface"),
285292
}))
286293

287294

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp