Make style configurable in ui-config.json
This commit is contained in:
parent
3395ba493f
commit
20bf99052a
1 changed files with 7 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue