From 3fd90a667df68bb201bc6d290ffe2bf2b9bac619 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 18 Feb 2023 18:56:56 -0600 Subject: [PATCH] lint(api): remove unused strength param from inpaint pipeline --- api/onnx_web/diffusion/no-init.txt | 1 + api/onnx_web/diffusion/run.py | 1 - api/onnx_web/serve.py | 9 --------- api/onnx_web/server/__init__.py | 9 +++++++++ 4 files changed, 10 insertions(+), 10 deletions(-) create mode 100644 api/onnx_web/diffusion/no-init.txt create mode 100644 api/onnx_web/server/__init__.py diff --git a/api/onnx_web/diffusion/no-init.txt b/api/onnx_web/diffusion/no-init.txt new file mode 100644 index 00000000..5fba48b1 --- /dev/null +++ b/api/onnx_web/diffusion/no-init.txt @@ -0,0 +1 @@ +This directory must not have an __init__.py file, because load.py and run.py need to be included separately. \ No newline at end of file diff --git a/api/onnx_web/diffusion/run.py b/api/onnx_web/diffusion/run.py index daeeebf3..9b9effb9 100644 --- a/api/onnx_web/diffusion/run.py +++ b/api/onnx_web/diffusion/run.py @@ -170,7 +170,6 @@ def run_inpaint_pipeline( border: Border, noise_source: Any, mask_filter: Any, - strength: float, fill_color: str, tile_order: str, ) -> None: diff --git a/api/onnx_web/serve.py b/api/onnx_web/serve.py index 64139600..d4ba6c55 100644 --- a/api/onnx_web/serve.py +++ b/api/onnx_web/serve.py @@ -589,13 +589,6 @@ def inpaint(): fill_color = get_not_empty(request.args, "fillColor", "white") mask_filter = get_from_map(request.args, "filter", mask_filters, "none") noise_source = get_from_map(request.args, "noise", noise_sources, "histogram") - strength = get_and_clamp_float( - request.args, - "strength", - get_config_value("strength"), - get_config_value("strength", "max"), - get_config_value("strength", "min"), - ) tile_order = get_from_list( request.args, "tileOrder", [TileOrder.grid, TileOrder.kernel, TileOrder.spiral] ) @@ -612,7 +605,6 @@ def inpaint(): expand.bottom, mask_filter.__name__, noise_source.__name__, - strength, fill_color, tile_order, ), @@ -634,7 +626,6 @@ def inpaint(): expand, noise_source, mask_filter, - strength, fill_color, tile_order, needs_device=device, diff --git a/api/onnx_web/server/__init__.py b/api/onnx_web/server/__init__.py new file mode 100644 index 00000000..81c49cbf --- /dev/null +++ b/api/onnx_web/server/__init__.py @@ -0,0 +1,9 @@ +from .device_pool import DeviceParams, DevicePoolExecutor +from .hacks import ( + apply_patch_basicsr, + apply_patch_codeformer, + apply_patch_facexlib, + apply_patches, +) +from .model_cache import ModelCache +from .upscale import run_upscale_correction