Skip to content

Commit d95054c

Browse files
committed
flux controlnet inpaint config bug
1 parent 5fb3a98 commit d95054c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/diffusers/pipelines/flux/pipeline_flux_controlnet_inpainting.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,11 +1095,13 @@ def __call__(
10951095
timestep = t.expand(latents.shape[0]).to(latents.dtype)
10961096

10971097
# predict the noise residual
1098-
if self.controlnet.config.guidance_embeds:
1099-
guidance = torch.full([1], guidance_scale, device=device, dtype=torch.float32)
1100-
guidance = guidance.expand(latents.shape[0])
1101-
else:
1102-
guidance = None
1098+
if isinstance(self.controlnet, FluxMultiControlNetModel):
1099+
use_guidance = self.controlnet.nets[0].config.guidance_embeds
1100+
guidance = torch.tensor([guidance_scale], device=device) if use_guidance else None
1101+
else :
1102+
use_guidance = self.controlnet.config.guidance_embeds
1103+
guidance = torch.full([1], guidance_scale, device=device, dtype=torch.float32) if use_guidance else None
1104+
guidance = guidance.expand(latents.shape[0]) if use_guidance else None
11031105

11041106
if isinstance(controlnet_keep[i], list):
11051107
cond_scale = [c * s for c, s in zip(controlnet_conditioning_scale, controlnet_keep[i])]

0 commit comments

Comments
 (0)