remove superfluous warning about scripts that would not run anyway

master
unknown 2023-11-03 05:49:51 -05:00
parent 5e4d6b12fe
commit 5e63ab9f20
No known key found for this signature in database
GPG Key ID: CA376082283AF69A
1 changed files with 18 additions and 1 deletions

View File

@ -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: