From 400cb218ba4856c62a3e2567f9e2a4335d310e03 Mon Sep 17 00:00:00 2001 From: cmdr2 Date: Thu, 27 Apr 2023 15:58:06 +0530 Subject: [PATCH] Don't override net config if env variables don't exist --- ui/easydiffusion/app.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ui/easydiffusion/app.py b/ui/easydiffusion/app.py index 12f10a5a..658de841 100644 --- a/ui/easydiffusion/app.py +++ b/ui/easydiffusion/app.py @@ -81,12 +81,8 @@ def getConfig(default_val=APP_CONFIG_DEFAULTS): config["net"] = {} if os.getenv("SD_UI_BIND_PORT") is not None: config["net"]["listen_port"] = int(os.getenv("SD_UI_BIND_PORT")) - else: - config["net"]["listen_port"] = 9000 if os.getenv("SD_UI_BIND_IP") is not None: config["net"]["listen_to_network"] = os.getenv("SD_UI_BIND_IP") == "0.0.0.0" - else: - config["net"]["listen_to_network"] = True return config except Exception as e: log.warn(traceback.format_exc()) @@ -188,7 +184,7 @@ def getIPConfig(): def open_browser(): config = getConfig() ui = config.get("ui", {}) - net = config.get("net", {"listen_port": 9000}) + net = config.get("net", {}) port = net.get("listen_port", 9000) if ui.get("open_browser_on_start", True): import webbrowser