1
0
Fork 0

enable Compel parsing for SDXL

This commit is contained in:
Sean Sube 2024-03-02 22:21:10 -06:00
parent 504c1ce084
commit fd05533505
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 7 additions and 5 deletions

View File

@ -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 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