From 5e63ab9f201074e525bd7cdffa48ece866904dc2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Nov 2023 05:49:51 -0500 Subject: [PATCH] remove superfluous warning about scripts that would not run anyway --- scripts/spartan/World.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/spartan/World.py b/scripts/spartan/World.py index 13201d4..dd3642b 100644 --- a/scripts/spartan/World.py +++ b/scripts/spartan/World.py @@ -592,7 +592,24 @@ class World: if worker.queried and worker.state == State.IDLE: # TODO worker.queried continue - worker.supported_scripts = worker.session.get(url=worker.full_url('scripts')).json() + # for now skip/remove scripts that are not "always on" since there is currently no way to run + # them at the same time as distributed + supported_scripts = { + 'txt2img': [], + 'img2img': [] + } + script_info = worker.session.get(url=worker.full_url('script-info')).json() + + for key in script_info: + name = key.get('name', None) + + if name is not None: + is_alwayson = key.get('is_alwayson', False) + is_img2img = key.get('is_img2img', False) + if is_alwayson: + supported_scripts['img2img' if is_img2img else 'txt2img'].append(name) + worker.supported_scripts = supported_scripts + logger.info(f"worker '{worker.label}' is online, marking as available") worker.state = State.IDLE else: