Skip to content

Commit

Permalink
Merge pull request #12456 from AUTOMATIC1111/patch-#12453
Browse files Browse the repository at this point in the history
Patch #12453
  • Loading branch information
AUTOMATIC1111 authored Aug 10, 2023
2 parents 9af5cce + a75d756 commit 458eda1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/ui_loadsave.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ def apply_field(obj, field, condition=None, init_field=None):
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
if isinstance(x, gr.Textbox) and field == 'value': # due to an undesirable 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':
try:
saved_value = float(saved_value)
except ValueError:
saved_value = -1
return

setattr(obj, field, saved_value)
if init_field is not None:
Expand Down

0 comments on commit 458eda1

Please sign in to comment.