mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-07-21 21:01:24 +08:00
dialogue
This commit is contained in:
parent
8d8ce983f2
commit
748fd33b0a
@ -2,9 +2,9 @@ import gradio as gr
|
||||
|
||||
from modules import shared, ui_common, ui_components, styles
|
||||
|
||||
styles_edit_symbol = '\U0001f58c\uFE0F' # 🖌️
|
||||
styles_materialize_symbol = '\U0001f4cb' # 📋
|
||||
styles_copy_symbol = '\U0001f4dd' # 📝
|
||||
styles_edit_symbol = "\U0001f58c\ufe0f" # 🖌️
|
||||
styles_materialize_symbol = "\U0001f4cb" # 📋
|
||||
styles_copy_symbol = "\U0001f4dd" # 📝
|
||||
|
||||
|
||||
def select_style(name):
|
||||
@ -39,7 +39,7 @@ def delete_style(name):
|
||||
shared.prompt_styles.styles.pop(name, None)
|
||||
shared.prompt_styles.save_styles()
|
||||
|
||||
return '', '', ''
|
||||
return "", "", ""
|
||||
|
||||
|
||||
def materialize_styles(prompt, negative_prompt, styles):
|
||||
@ -71,15 +71,15 @@ class UiPromptStyles:
|
||||
self.copy = ui_components.ToolButton(value=styles_copy_symbol, elem_id=f"{tabname}_style_copy", tooltip="Copy main UI prompt to style.")
|
||||
|
||||
with gr.Row():
|
||||
self.prompt = gr.Textbox(label="Prompt", show_label=True, elem_id=f"{tabname}_edit_style_prompt", lines=3, elem_classes=["prompt"])
|
||||
self.prompt = gr.Textbox(label="Prompt", show_label=True, elem_id=f"{tabname}_edit_style_prompt", lines=4, max_lines=16, elem_classes=["prompt"])
|
||||
|
||||
with gr.Row():
|
||||
self.neg_prompt = gr.Textbox(label="Negative prompt", show_label=True, elem_id=f"{tabname}_edit_style_neg_prompt", lines=3, elem_classes=["prompt"])
|
||||
self.neg_prompt = gr.Textbox(label="Negative prompt", show_label=True, elem_id=f"{tabname}_edit_style_neg_prompt", lines=4, max_lines=16, elem_classes=["prompt"])
|
||||
|
||||
with gr.Row():
|
||||
self.save = gr.Button('Save', variant='primary', elem_id=f'{tabname}_edit_style_save', visible=False)
|
||||
self.delete = gr.Button('Delete', variant='primary', elem_id=f'{tabname}_edit_style_delete', visible=False)
|
||||
self.close = gr.Button('Close', variant='secondary', elem_id=f'{tabname}_edit_style_close')
|
||||
self.save = gr.Button("Save", variant="primary", elem_id=f"{tabname}_edit_style_save", visible=False)
|
||||
self.delete = gr.Button("Delete", variant="primary", elem_id=f"{tabname}_edit_style_delete", visible=False)
|
||||
self.close = gr.Button("Close", variant="secondary", elem_id=f"{tabname}_edit_style_close")
|
||||
|
||||
self.selection.change(
|
||||
fn=select_style,
|
||||
@ -120,4 +120,4 @@ class UiPromptStyles:
|
||||
inputs=[self.main_ui_prompt, self.main_ui_negative_prompt, self.dropdown],
|
||||
outputs=[self.main_ui_prompt, self.main_ui_negative_prompt, self.dropdown],
|
||||
show_progress=False,
|
||||
).then(fn=None, _js="function(){update_"+self.tabname+"_tokens(); closePopup();}", show_progress=False)
|
||||
).then(fn=None, _js="function(){update_" + self.tabname + "_tokens(); closePopup();}", show_progress=False)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user