diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/cache.py | 3 | ||||
-rw-r--r-- | modules/ui.py | 2 | ||||
-rw-r--r-- | modules/ui_extra_networks_user_metadata.py | 2 | ||||
-rw-r--r-- | modules/ui_loadsave.py | 5 |
4 files changed, 8 insertions, 4 deletions
diff --git a/modules/cache.py b/modules/cache.py index 71fe6302..a7cd3aeb 100644 --- a/modules/cache.py +++ b/modules/cache.py @@ -1,11 +1,12 @@ import json
+import os
import os.path
import threading
import time
from modules.paths import data_path, script_path
-cache_filename = os.path.join(data_path, "cache.json")
+cache_filename = os.environ.get('SD_WEBUI_CACHE_FILE', os.path.join(data_path, "cache.json"))
cache_data = None
cache_lock = threading.Lock()
diff --git a/modules/ui.py b/modules/ui.py index c08f412d..05292734 100644 --- a/modules/ui.py +++ b/modules/ui.py @@ -632,7 +632,7 @@ def create_ui(): extra_tabs = gr.Tabs(elem_id="img2img_extra_tabs")
extra_tabs.__enter__()
- with gr.Tab("Generation", id="img2img_generation") as img2img_generation_tab, FormRow().style(equal_height=False):
+ with gr.Tab("Generation", id="img2img_generation") as img2img_generation_tab, FormRow(equal_height=False):
with gr.Column(variant='compact', elem_id="img2img_settings"):
copy_image_buttons = []
copy_image_destinations = {}
diff --git a/modules/ui_extra_networks_user_metadata.py b/modules/ui_extra_networks_user_metadata.py index a5423fd8..cda471e4 100644 --- a/modules/ui_extra_networks_user_metadata.py +++ b/modules/ui_extra_networks_user_metadata.py @@ -125,7 +125,7 @@ class UserMetadataEditor: basename, ext = os.path.splitext(filename)
with open(basename + '.json', "w", encoding="utf8") as file:
- json.dump(metadata, file)
+ json.dump(metadata, file, indent=4)
def save_user_metadata(self, name, desc, notes):
user_metadata = self.get_user_metadata(name)
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:
|