diff --git a/CHANGELOG.md b/CHANGELOG.md index 64279e45e..4f1f03b61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,9 @@ And (*as always*) many bugfixes and improvements to existing features! - prompt parser allow explict `BOS` and `EOS` tokens in prompt - **Nunchaku** support for *FLUX.1-Fill* and *FLUX.1-Depth* models - update requirements/packages +- **Other** + - remove LDSR + - remove `api-only` cli option - **Fixes** - refactor legacy processing loop - fix settings components mismatch diff --git a/launch.py b/launch.py index 7f7d3c335..85ea0337a 100755 --- a/launch.py +++ b/launch.py @@ -221,10 +221,7 @@ def start_server(immediate=True, server=None): installer.log.trace('Logging: level=trace') server.wants_restart = False else: - if args.api_only: - uvicorn = server.api_only() - else: - uvicorn = server.webui(restart=not immediate) + uvicorn = server.webui(restart=not immediate) if args.profile: pr.disable() installer.print_profile(pr, 'WebUI') diff --git a/modules/api/api.py b/modules/api/api.py index 8b0ae3400..539001ea4 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -117,8 +117,6 @@ class Api: def add_api_route(self, path: str, endpoint, **kwargs): - if (shared.cmd_opts.auth or shared.cmd_opts.auth_file) and shared.cmd_opts.api_only: - kwargs['dependencies'] = [Depends(self.auth)] if shared.opts.subpath is not None and len(shared.opts.subpath) > 0: self.app.add_api_route(f'{shared.opts.subpath}{path}', endpoint, **kwargs) self.app.add_api_route(path, endpoint, **kwargs) diff --git a/modules/api/middleware.py b/modules/api/middleware.py index 5c72f2204..0d258c878 100644 --- a/modules/api/middleware.py +++ b/modules/api/middleware.py @@ -42,7 +42,7 @@ def setup_middleware(app: FastAPI, cmd_opts): res.headers["X-Process-Time"] = duration endpoint = req.scope.get('path', 'err') token = req.cookies.get("access-token") or req.cookies.get("access-token-unsecure") - if (cmd_opts.api_log or cmd_opts.api_only) and endpoint.startswith('/sdapi'): + if (cmd_opts.api_log) and endpoint.startswith('/sdapi'): if '/sdapi/v1/log' in endpoint or '/sdapi/v1/browser' in endpoint: return res log.info('API user={user} code={code} {prot}/{ver} {method} {endpoint} {cli} {duration}'.format( # pylint: disable=consider-using-f-string, logging-format-interpolation diff --git a/modules/civitai/search_civitai.py b/modules/civitai/search_civitai.py index 8f0f2bad5..12d74fce3 100644 --- a/modules/civitai/search_civitai.py +++ b/modules/civitai/search_civitai.py @@ -7,7 +7,7 @@ from installer import install, log full_dct = False full_html = False -base_models = ['', 'ODOR', 'SD 1.4', 'SD 1.5', 'SD 1.5 LCM', 'SD 1.5 Hyper', 'SD 2.0', 'SD 2.0 768', 'SD 2.1', 'SD 2.1 768', 'SD 2.1 Unclip', 'SDXL 0.9', 'SDXL 1.0', 'SD 3', 'SD 3.5', 'SD 3.5 Medium', 'SD 3.5 Large', 'SD 3.5 Large Turbo', 'Pony', 'Flux.1 S', 'Flux.1 D', 'Flux.1 Kontext', 'AuraFlow', 'SDXL 1.0 LCM', 'SDXL Distilled', 'SDXL Turbo', 'SDXL Lightning', 'SDXL Hyper', 'Stable Cascade', 'SVD', 'SVD XT', 'Playground v2', 'PixArt a', 'PixArt E', 'Hunyuan 1', 'Hunyuan Video', 'Lumina', 'Kolors', 'Illustrious', 'Mochi', 'LTXV', 'CogVideoX', 'NoobAI', 'Wan Video', 'Wan Video 1.3B t2v', 'Wan Video 14B t2v', 'Wan Video 14B i2v 480p', 'Wan Video 14B i2v 720p', 'HiDream', 'OpenAI', 'Imagen4', 'Other'] # noqa: E501 +base_models = ['', 'ODOR', 'SD 1.4', 'SD 1.5', 'SD 1.5 LCM', 'SD 1.5 Hyper', 'SD 2.0', 'SD 2.0 768', 'SD 2.1', 'SD 2.1 768', 'SD 2.1 Unclip', 'SDXL 0.9', 'SDXL 1.0', 'SD 3', 'SD 3.5', 'SD 3.5 Medium', 'SD 3.5 Large', 'SD 3.5 Large Turbo', 'Pony', 'Flux.1 S', 'Flux.1 D', 'Flux.1 Kontext', 'AuraFlow', 'SDXL 1.0 LCM', 'SDXL Distilled', 'SDXL Turbo', 'SDXL Lightning', 'SDXL Hyper', 'Stable Cascade', 'SVD', 'SVD XT', 'Playground v2', 'PixArt a', 'PixArt E', 'Hunyuan 1', 'Hunyuan Video', 'Lumina', 'Kolors', 'Illustrious', 'Mochi', 'LTXV', 'CogVideoX', 'NoobAI', 'Wan Video', 'Wan Video 1.3B t2v', 'Wan Video 14B t2v', 'Wan Video 14B i2v 480p', 'Wan Video 14B i2v 720p', 'HiDream', 'OpenAI', 'Imagen4', 'Other'] @dataclass diff --git a/modules/cmd_args.py b/modules/cmd_args.py index 84da8f5f6..d368babb5 100644 --- a/modules/cmd_args.py +++ b/modules/cmd_args.py @@ -62,7 +62,6 @@ def main_args(): group_http.add_argument('--docs', default=os.environ.get("SD_DOCS", False), action='store_true', help = "Mount API docs, default: %(default)s") group_http.add_argument("--auth", type=str, default=os.environ.get("SD_AUTH", None), help='Set access authentication like "user:pwd,user:pwd""') group_http.add_argument("--auth-file", type=str, default=os.environ.get("SD_AUTHFILE", None), help='Set access authentication using file, default: %(default)s') - group_http.add_argument('--api-only', default=os.environ.get("SD_APIONLY", False), action='store_true', help = "Run in API only mode without starting UI") group_http.add_argument("--allowed-paths", nargs='+', default=[], type=str, required=False, help="add additional paths to paths allowed for web access") group_http.add_argument("--share", default=os.environ.get("SD_SHARE", False), action='store_true', help="Enable UI accessible through Gradio site, default: %(default)s") group_http.add_argument("--insecure", default=os.environ.get("SD_INSECURE", False), action='store_true', help="Enable extensions tab regardless of other options, default: %(default)s") @@ -89,6 +88,7 @@ def compatibility_args(): group_compat.add_argument("--disable-extension-access", default=False, action='store_true', help=argparse.SUPPRESS) group_compat.add_argument("--api", action='store_true', help=argparse.SUPPRESS, default=True) group_compat.add_argument("--api-auth", type=str, help=argparse.SUPPRESS, default=None) + group_compat.add_argument('--api-only', default=False, help=argparse.SUPPRESS) group_compat.add_argument("--disable-queue", default=os.environ.get("SD_DISABLEQUEUE", False), action='store_true', help=argparse.SUPPRESS) diff --git a/modules/ui_settings.py b/modules/ui_settings.py index 042941692..9a5a47a13 100644 --- a/modules/ui_settings.py +++ b/modules/ui_settings.py @@ -119,8 +119,8 @@ def run_settings(*args): changed = [] for key, value, comp in zip(shared.opts.data_labels.keys(), args, components): if comp == dummy_component or value=='dummy': # or getattr(comp, 'visible', True) is False or key in hidden_list: - actual = shared.opts.data.get(key, None) # ensure the key is in data - default = shared.opts.data_labels[key].default + # actual = shared.opts.data.get(key, None) # ensure the key is in data + # default = shared.opts.data_labels[key].default # shared.log.warning(f'Setting skip: key={key} value={value} actual={actual} default={default} comp={comp}') continue if not shared.opts.same_type(value, shared.opts.data_labels[key].default): diff --git a/webui.py b/webui.py index 22735c6f1..2e9a555a7 100644 --- a/webui.py +++ b/webui.py @@ -413,23 +413,5 @@ def webui(restart=False): return shared.demo.server -def api_only(): - start_common() - from fastapi import FastAPI - app = FastAPI(**fastapi_args) - modules.api.middleware.setup_middleware(app, shared.cmd_opts) - shared.api = create_api(app) - shared.api.register() - shared.api.wants_restart = False - modules.script_callbacks.app_started_callback(None, app) - modules.sd_models.write_metadata() - log.info(f"Startup time: {timer.startup.summary()}") - server = shared.api.launch() - return server - - if __name__ == "__main__": - if shared.cmd_opts.api_only: - api_only() - else: - webui() + webui()