mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-06-07 21:20:49 +00:00
Merge pull request #11750 from AUTOMATIC1111/quick-settings-textbox
Use submit and blur for quick settings textbox
This commit is contained in:
commit
cc0a3cc492
@ -260,13 +260,20 @@ class UiSettings:
|
|||||||
component = self.component_dict[k]
|
component = self.component_dict[k]
|
||||||
info = opts.data_labels[k]
|
info = opts.data_labels[k]
|
||||||
|
|
||||||
change_handler = component.release if hasattr(component, 'release') else component.change
|
if isinstance(component, gr.Textbox):
|
||||||
change_handler(
|
methods = [component.submit, component.blur]
|
||||||
fn=lambda value, k=k: self.run_settings_single(value, key=k),
|
elif hasattr(component, 'release'):
|
||||||
inputs=[component],
|
methods = [component.release]
|
||||||
outputs=[component, self.text_settings],
|
else:
|
||||||
show_progress=info.refresh is not None,
|
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 = gr.Button('Change checkpoint', elem_id='change_checkpoint', visible=False)
|
||||||
button_set_checkpoint.click(
|
button_set_checkpoint.click(
|
||||||
|
Loading…
Reference in New Issue
Block a user