From 00db9a278721425c750d39f3c7e90871f38f4fda Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 31 Dec 2023 13:00:34 -0600 Subject: [PATCH] fix(api): make sure ControlNet constructor is used for same pipeline (#449) --- api/onnx_web/diffusers/load.py | 2 +- api/onnx_web/params.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/onnx_web/diffusers/load.py b/api/onnx_web/diffusers/load.py index 582a10f5..9e8a4e50 100644 --- a/api/onnx_web/diffusers/load.py +++ b/api/onnx_web/diffusers/load.py @@ -230,7 +230,7 @@ def load_pipeline( add_watermarker=False, # not so invisible: https://github.com/ssube/onnx-web/issues/438 ) else: - if "controlnet" in components: + if params.is_control(): logger.debug( "assembling SD pipeline for %s with ControlNet", pipeline_class.__name__, diff --git a/api/onnx_web/params.py b/api/onnx_web/params.py index b3e03670..8d255183 100644 --- a/api/onnx_web/params.py +++ b/api/onnx_web/params.py @@ -292,7 +292,7 @@ class ImageParams: return group def is_control(self): - return self.pipeline == "controlnet" + return self.pipeline in ["controlnet", "controlnet-sdxl"] def is_lpw(self): return self.pipeline == "lpw"