From f36c4d8a2b2c0336e710453fef2295ca48f725a0 Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 14 Nov 2024 11:22:20 -0500 Subject: [PATCH] cleanup Signed-off-by: Vladimir Mandic --- cli/api-txt2img.js | 2 +- modules/api/script.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/api-txt2img.js b/cli/api-txt2img.js index 43e09449b..8d0e9f5d1 100755 --- a/cli/api-txt2img.js +++ b/cli/api-txt2img.js @@ -5,7 +5,7 @@ const fs = require('fs'); // eslint-disable-line no-undef const process = require('process'); // eslint-disable-line no-undef -const sd_url = process.env.SDAPI_URL || 'http://127.0.0.1:32769'; +const sd_url = process.env.SDAPI_URL || 'http://127.0.0.1:7860'; const sd_username = process.env.SDAPI_USR; const sd_password = process.env.SDAPI_PWD; const sd_options = { diff --git a/modules/api/script.py b/modules/api/script.py index 6ccaa161e..e7d6b1f1a 100644 --- a/modules/api/script.py +++ b/modules/api/script.py @@ -7,7 +7,7 @@ from modules.errors import log def script_name_to_index(name, scripts_list): - if name is None or len(name) == 0: + if name is None or len(name) == 0 or name == 'none': return None try: return [script.title().lower() for script in scripts_list].index(name.lower()) @@ -17,7 +17,7 @@ def script_name_to_index(name, scripts_list): # raise HTTPException(status_code=422, detail=f"Script '{name}' not found") from e def get_selectable_script(script_name, script_runner): - if script_name is None or script_name == "": + if script_name is None or script_name == "" or script_name == 'none': return None, None script_idx = script_name_to_index(script_name, script_runner.selectable_scripts) if script_idx is None: @@ -40,7 +40,7 @@ def get_script_info(script_name: Optional[str] = None): return res def get_script(script_name, script_runner): - if script_name is None or script_name == "": + if script_name is None or script_name == "" or script_name == 'none': return None, None script_idx = script_name_to_index(script_name, script_runner.scripts) if script_idx is None: