Merge pull request #11750 from AUTOMATIC1111/quick-settings-textbox

Use submit and blur for quick settings textbox
This commit is contained in:
AUTOMATIC1111 2023-07-13 14:49:48 +03:00 committed by GitHub
commit cc0a3cc492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -260,13 +260,20 @@ class UiSettings:
component = self.component_dict[k]
info = opts.data_labels[k]
change_handler = component.release if hasattr(component, 'release') else component.change
change_handler(
fn=lambda value, k=k: self.run_settings_single(value, key=k),
inputs=[component],
outputs=[component, self.text_settings],
show_progress=info.refresh is not None,
)
if isinstance(component, gr.Textbox):
methods = [component.submit, component.blur]
elif hasattr(component, 'release'):
methods = [component.release]
else:
methods = [component.change]
for method in methods:
method(
fn=lambda value, k=k: self.run_settings_single(value, key=k),
inputs=[component],
outputs=[component, self.text_settings],
show_progress=info.refresh is not None,
)
button_set_checkpoint = gr.Button('Change checkpoint', elem_id='change_checkpoint', visible=False)
button_set_checkpoint.click(