From fd055335055e46f304e0d6aeae87b9176d82f71e Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sat, 2 Mar 2024 22:21:10 -0600 Subject: [PATCH] enable Compel parsing for SDXL --- api/onnx_web/diffusers/load.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/api/onnx_web/diffusers/load.py b/api/onnx_web/diffusers/load.py index f674b652..8fd74b79 100644 --- a/api/onnx_web/diffusers/load.py +++ b/api/onnx_web/diffusers/load.py @@ -664,13 +664,15 @@ def patch_pipeline( ) -> None: logger.debug("patching SD pipeline") - if not params.is_lpw() and not params.is_xl(): - if server.has_feature("compel-prompts"): - logger.debug("patching prompt encoder with Compel") - pipe._encode_prompt = expand_prompt_compel.__get__(pipe, pipeline) - else: + if server.has_feature("compel-prompts"): + logger.debug("patching prompt encoder with Compel") + pipe._encode_prompt = expand_prompt_compel.__get__(pipe, pipeline) + else: + if not params.is_lpw() and not params.is_xl(): logger.debug("patching prompt encoder with ONNX legacy method") pipe._encode_prompt = expand_prompt_onnx_legacy.__get__(pipe, pipeline) + else: + logger.warning("no prompt encoder patch available") # the pipeline requested in params may not be the one currently being used, especially during the later img2img # stages of a highres pipeline, so we need to check the pipeline type