Unverified Commit 959404e0 authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #12453 from AUTOMATIC1111/catch-float-ValueError-default-to--1

Catch float value error default to -1
parents 887bcfdf 4412398c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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':
                    try:
                        saved_value = float(saved_value)
                    except ValueError:
                        saved_value = -1

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