From ead82fedeaa141be437e0647e933ca3d20959578 Mon Sep 17 00:00:00 2001 From: YiYi Xu Date: Tue, 26 Mar 2024 16:38:32 -1000 Subject: [PATCH] fix torch.compile for multi-controlnet of sdxl inpaint (#7476) fix Co-authored-by: Sayak Paul --- .../controlnet/pipeline_controlnet_inpaint_sd_xl.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py index eedc7ef979..3eb8f31b6a 100644 --- a/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py +++ b/src/diffusers/pipelines/controlnet/pipeline_controlnet_inpaint_sd_xl.py @@ -1601,10 +1601,7 @@ class StableDiffusionXLControlNetInpaintPipeline( 1.0 - float(i / len(timesteps) < s or (i + 1) / len(timesteps) > e) for s, e in zip(control_guidance_start, control_guidance_end) ] - if isinstance(self.controlnet, MultiControlNetModel): - controlnet_keep.append(keeps) - else: - controlnet_keep.append(keeps[0]) + controlnet_keep.append(keeps if isinstance(controlnet, MultiControlNetModel) else keeps[0]) # 9. Prepare extra step kwargs. TODO: Logic should ideally just be moved out of the pipeline height, width = latents.shape[-2:]