aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCookieHCl <nhc7502@snu.ac.kr>2022-10-16 04:47:03 +0900
committerAUTOMATIC1111 <16777216c@gmail.com>2022-10-16 10:04:14 +0300
commit20bf99052a9d50b5f99d199f4c449ef1ddd6e3cb (patch)
tree703e1632918ffa323e342f8f57e97185f54b459d
parent3395ba493f93214cf037d084d45693a37610bd85 (diff)
Make style configurable in ui-config.json
-rw-r--r--modules/ui.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/ui.py b/modules/ui.py
index 5c0eaf73..78096f27 100644
--- a/modules/ui.py
+++ b/modules/ui.py
@@ -508,9 +508,11 @@ def create_toprow(is_img2img):
with gr.Row():
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.save_to_config = True
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.save_to_config = True
return prompt, roll, prompt_style, negative_prompt, prompt_style2, submit, button_interrogate, button_deepbooru, prompt_style_apply, save_style, paste, token_counter, token_button
@@ -1739,6 +1741,11 @@ Requested path was: {f}
if type(x) == gr.Number:
apply_field(x, 'value')
+ # Since there are many dropdowns that shouldn't be saved,
+ # we only mark dropdowns that should be saved.
+ if type(x) == gr.Dropdown and getattr(x, 'save_to_config', False):
+ apply_field(x, 'value')
+
visit(txt2img_interface, loadsave, "txt2img")
visit(img2img_interface, loadsave, "img2img")
visit(extras_interface, loadsave, "extras")