diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-24 10:05:45 +0300 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-24 10:05:45 +0300 |
commit | 42a70d74771e8920f658e741679768ed145dd76a (patch) | |
tree | 387420173546af948a850adf947513fa174cb3ad /modules/api/api.py | |
parent | 8b903322e66a694245970832f7fa89e2faa2ad0a (diff) |
repair sdapi/v1/upscalers returning bogus results
Diffstat (limited to 'modules/api/api.py')
-rw-r--r-- | modules/api/api.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/modules/api/api.py b/modules/api/api.py index e6e31e41..da2a5daf 100644 --- a/modules/api/api.py +++ b/modules/api/api.py @@ -375,13 +375,15 @@ class Api: return [{"name": sampler[0], "aliases":sampler[2], "options":sampler[3]} for sampler in sd_samplers.all_samplers] def get_upscalers(self): - upscalers = [] - - for upscaler in shared.sd_upscalers: - u = upscaler.scaler - upscalers.append({"name":u.name, "model_name":u.model_name, "model_path":u.model_path, "model_url":u.model_url}) - - return upscalers + return [ + { + "name": upscaler.name, + "model_name": upscaler.scaler.model_name, + "model_path": upscaler.data_path, + "scale": upscaler.scale, + } + for upscaler in shared.sd_upscalers + ] def get_sd_models(self): return [{"title": x.title, "model_name": x.model_name, "hash": x.shorthash, "sha256": x.sha256, "filename": x.filename, "config": find_checkpoint_config(x)} for x in checkpoints_list.values()] |