mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-04-27 15:20:50 -07:00
fix --use-textbox-seed
This commit is contained in:
parent
4d93f48f09
commit
1b3093fe3a
3 changed files with 19 additions and 4 deletions
|
|
@ -8,7 +8,7 @@ from modules.ui_components import ToolButton
|
|||
|
||||
|
||||
class UiLoadsave:
|
||||
"""allows saving and restorig default values for gradio components"""
|
||||
"""allows saving and restoring default values for gradio components"""
|
||||
|
||||
def __init__(self, filename):
|
||||
self.filename = filename
|
||||
|
|
@ -48,6 +48,9 @@ class UiLoadsave:
|
|||
elif condition and not condition(saved_value):
|
||||
pass
|
||||
else:
|
||||
if isinstance(x, gr.Textbox) and field == 'value': # due to an undersirable behavior of gr.Textbox, if you give it an int value instead of str, everything dies
|
||||
saved_value = str(saved_value)
|
||||
|
||||
setattr(obj, field, saved_value)
|
||||
if init_field is not None:
|
||||
init_field(saved_value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue