From 270425de700f7c04f7b24919cc7d356770a4d917 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Thu, 6 Mar 2025 14:45:15 +0100 Subject: [PATCH] Update lollms_sd.py --- lollms/services/tti/sd/lollms_sd.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/lollms/services/tti/sd/lollms_sd.py b/lollms/services/tti/sd/lollms_sd.py index e840e87..0bbfbb7 100644 --- a/lollms/services/tti/sd/lollms_sd.py +++ b/lollms/services/tti/sd/lollms_sd.py @@ -307,6 +307,18 @@ class LollmsSD(LollmsTTI): "value": None, "help": "The base URL for the Auto SD service. If not provided, a default or local URL will be used." }, + { + "name": "local_service", + "type": "bool", + "value": False, + "help": "If set to true, a local instance of the service will be installed and used." + }, + { + "name": "start_service_at_startup", + "type": "bool", + "value": False, + "help": "If set to true, the service will automatically start at startup. This also enables the local service option." + }, { "name": "share", "type": "bool", @@ -327,10 +339,11 @@ class LollmsSD(LollmsTTI): root_dir = lollms_paths.personal_path # Store the path to the script - if service_config.auto_sd_base_url is None: - self.service_config.base_url = "http://127.0.0.1:7860" - if not LollmsSD.verify(app): - install_sd(app.lollms_paths) + if service_config.local_service and service_config.start_service_at_startup: + if service_config.auto_sd_base_url is None: + self.service_config.base_url = "http://127.0.0.1:7860" + if not LollmsSD.verify(app): + install_sd(app) self.auto_sd_url = self.service_config.base_url+"/sdapi/v1"