diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-10 13:15:34 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-08-10 13:15:34 +0000 |
commit | b13806c15065bd9a91edef2b8516c461ce585361 (patch) | |
tree | 5209eeaadd8686f6050a14ca0d81ce6395baa73d | |
parent | 4f6582cb668d4f4beea64f1c7baae721c85cfc69 (diff) | |
download | stable-diffusion-webui-gfx803-b13806c15065bd9a91edef2b8516c461ce585361.tar.gz stable-diffusion-webui-gfx803-b13806c15065bd9a91edef2b8516c461ce585361.tar.bz2 stable-diffusion-webui-gfx803-b13806c15065bd9a91edef2b8516c461ce585361.zip |
fix a bug preventing normal operation if a string is added to a gr.Number component via ui-config.json
-rw-r--r-- | modules/ui_loadsave.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/ui_loadsave.py b/modules/ui_loadsave.py index 99d763e1..ef6b0154 100644 --- a/modules/ui_loadsave.py +++ b/modules/ui_loadsave.py @@ -50,6 +50,8 @@ class UiLoadsave: 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)
+ elif isinstance(x, gr.Number) and field == 'value':
+ saved_value = float(saved_value)
setattr(obj, field, saved_value)
if init_field is not None:
|