diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-10 12:58:53 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-10 12:58:53 +0000 |
commit | 1b3093fe3aedb20aa8d505ceeea7900ac592e6fe (patch) | |
tree | 6493d911a9771da6dba7729fad76663542523aee /modules/ui_loadsave.py | |
parent | 4d93f48f090e19a81d1608837e8e6449045601a8 (diff) | |
download | stable-diffusion-webui-gfx803-1b3093fe3aedb20aa8d505ceeea7900ac592e6fe.tar.gz stable-diffusion-webui-gfx803-1b3093fe3aedb20aa8d505ceeea7900ac592e6fe.tar.bz2 stable-diffusion-webui-gfx803-1b3093fe3aedb20aa8d505ceeea7900ac592e6fe.zip |
fix --use-textbox-seed
Diffstat (limited to 'modules/ui_loadsave.py')
-rw-r--r-- | modules/ui_loadsave.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/ui_loadsave.py b/modules/ui_loadsave.py index 0052a5cc..99d763e1 100644 --- a/modules/ui_loadsave.py +++ b/modules/ui_loadsave.py @@ -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)
|