From 233dffdc3f56b26abaaba8363a5dd30dab7f0e40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20Yi=C4=9Fit=20=C3=96zgen=C3=A7?= <47952284+yigitozgenc@users.noreply.github.com> Date: Sat, 21 Dec 2024 21:44:43 +0300 Subject: [PATCH] flux controlnet inpaint config bug (#10291) * flux controlnet inpaint config bug * Update src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py --------- Co-authored-by: yigitozgenc Co-authored-by: hlky --- .../pipelines/flux/pipeline_flux_controlnet_inpainting.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py index c557cf134b05..85943b278dc6 100644 --- a/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py +++ b/src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py @@ -1095,7 +1095,11 @@ def __call__( timestep = t.expand(latents.shape[0]).to(latents.dtype) # predict the noise residual - if self.controlnet.config.guidance_embeds: + if isinstance(self.controlnet, FluxMultiControlNetModel): + use_guidance = self.controlnet.nets[0].config.guidance_embeds + else: + use_guidance = self.controlnet.config.guidance_embeds + if use_guidance: guidance = torch.full([1], guidance_scale, device=device, dtype=torch.float32) guidance = guidance.expand(latents.shape[0]) else: