Unverified Commit 458eda13 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #12456 from AUTOMATIC1111/patch-#12453

Patch #12453
parents 9af5cce4 a75d756a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -48,13 +48,13 @@ 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
                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: