diff options
author | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2023-08-10 13:44:33 +0000 |
---|---|---|
committer | w-e-w <40751091+w-e-w@users.noreply.github.com> | 2023-08-10 13:44:33 +0000 |
commit | 4412398c4b40f0dd3a1692f65141374770fbc3da (patch) | |
tree | b4841ba322fcb9262933587cc782848500cd84cd /modules/ui_loadsave.py | |
parent | 9d78d317ae492db59ebf8b31fda9a049f6c9bd14 (diff) | |
download | stable-diffusion-webui-gfx803-4412398c4b40f0dd3a1692f65141374770fbc3da.tar.gz stable-diffusion-webui-gfx803-4412398c4b40f0dd3a1692f65141374770fbc3da.tar.bz2 stable-diffusion-webui-gfx803-4412398c4b40f0dd3a1692f65141374770fbc3da.zip |
catch float ValueError default -1
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 ef6b0154..a96c71b2 100644 --- a/modules/ui_loadsave.py +++ b/modules/ui_loadsave.py @@ -51,7 +51,10 @@ class UiLoadsave: 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)
elif isinstance(x, gr.Number) and field == 'value':
- saved_value = float(saved_value)
+ try:
+ saved_value = float(saved_value)
+ except ValueError:
+ saved_value = -1
setattr(obj, field, saved_value)
if init_field is not None:
|