From 6d234915298e7db2ee028c9d9734cf4ac53bcb11 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 1 Apr 2023 14:39:48 -0500 Subject: [PATCH] only run correction before highres when selected in options --- api/onnx_web/diffusers/run.py | 28 ++++++++++++++++------------ api/params.json | 2 +- gui/examples/config.json | 2 +- gui/src/strings/en.ts | 1 + 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/api/onnx_web/diffusers/run.py b/api/onnx_web/diffusers/run.py index 26c99a29..a97e0089 100644 --- a/api/onnx_web/diffusers/run.py +++ b/api/onnx_web/diffusers/run.py @@ -97,18 +97,22 @@ def run_txt2img_pipeline( if highres.scale > 1: highres_progress = ChainProgress.from_progress(progress) - image = run_upscale_correction( - job, - server, - StageParams(), - params, - image, - upscale=upscale.with_args( - scale=1, - outscale=1, - ), - callback=highres_progress, - ) + if upscale.faces and ( + upscale.upscale_order == "correction-both" or + upscale.upscale_order == "correction-first" + ): + image = run_upscale_correction( + job, + server, + StageParams(), + params, + image, + upscale=upscale.with_args( + scale=1, + outscale=1, + ), + callback=highres_progress, + ) # load img2img pipeline once highres_pipe = load_pipeline( diff --git a/api/params.json b/api/params.json index e9c18976..92e72438 100644 --- a/api/params.json +++ b/api/params.json @@ -60,7 +60,7 @@ "max": 1024, "step": 8 }, - "highresMethods": { + "highresMethod": { "default": "lanczos", "keys": [ "bilinear", diff --git a/gui/examples/config.json b/gui/examples/config.json index 2d663cdd..4161415b 100644 --- a/gui/examples/config.json +++ b/gui/examples/config.json @@ -64,7 +64,7 @@ "max": 1024, "step": 8 }, - "highresMethods": { + "highresMethod": { "default": "lanczos", "keys": [ "bilinear", diff --git a/gui/src/strings/en.ts b/gui/src/strings/en.ts index 907b7bfb..2fcd4bd7 100644 --- a/gui/src/strings/en.ts +++ b/gui/src/strings/en.ts @@ -130,6 +130,7 @@ export const I18N_STRINGS_EN = { height: 'Height', highres: { label: 'Highres', + method: 'Upscaler', scale: 'Scale', steps: 'Steps', strength: 'Strength',