From 4a728cb9ae0016f79ab9b12d58e0b9b436a047c8 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 5 Feb 2023 10:50:15 -0600 Subject: [PATCH] lint(api): include more params in JSON response and file --- api/onnx_web/device_pool.py | 6 +++++- api/onnx_web/params.py | 19 +++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/api/onnx_web/device_pool.py b/api/onnx_web/device_pool.py index 907d4b70..0a5e2026 100644 --- a/api/onnx_web/device_pool.py +++ b/api/onnx_web/device_pool.py @@ -192,7 +192,11 @@ class DevicePoolExecutor: f.result() logger.info("job %s finished successfully", key) except Exception as err: - logger.warn("job %s failed with an error: %s", key, format_exception(type(err), err, err.__traceback__)) + logger.warn( + "job %s failed with an error: %s", + key, + format_exception(type(err), err, err.__traceback__), + ) future.add_done_callback(job_done) diff --git a/api/onnx_web/params.py b/api/onnx_web/params.py index 67793866..26a6363a 100644 --- a/api/onnx_web/params.py +++ b/api/onnx_web/params.py @@ -96,17 +96,17 @@ class ImageParams: self.prompt = prompt self.negative_prompt = negative_prompt self.cfg = cfg - self.steps = steps self.seed = seed + self.steps = steps def tojson(self) -> Dict[str, Optional[Param]]: return { "model": self.model, "scheduler": self.scheduler.__name__, - "seed": self.seed, "prompt": self.prompt, - "cfg": self.cfg, "negativePrompt": self.negative_prompt, + "cfg": self.cfg, + "seed": self.seed, "steps": self.steps, } @@ -175,8 +175,15 @@ class UpscaleParams: def tojson(self): return { - "model": self.upscale_model, - "scale": self.scale, + "upscale_model": self.upscale_model, + "correction_model": self.correction_model, + "denoise": self.denoise, + "faces": self.faces, + "face_strength": self.face_strength, + "format": self.format, + "half": self.half, "outscale": self.outscale, - # TODO: add more + "pre_pad": self.pre_pad, + "scale": self.scale, + "tile_pad": self.tile_pad, }