Skip to content

Commit 24c7d57

Browse files
rshah240yiyixuxu
andauthored
config attribute not foud error for FluxImagetoImage Pipeline for multi controlnet solved (#9586)
Co-authored-by: YiYi Xu <[email protected]>
1 parent bfa0aa4 commit 24c7d57

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/diffusers/pipelines/flux/pipeline_flux_controlnet_image_to_image.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -903,9 +903,12 @@ def __call__(
903903

904904
timestep = t.expand(latents.shape[0]).to(latents.dtype)
905905

906-
guidance = (
907-
torch.tensor([guidance_scale], device=device) if self.controlnet.config.guidance_embeds else None
908-
)
906+
if isinstance(self.controlnet, FluxMultiControlNetModel):
907+
use_guidance = self.controlnet.nets[0].config.guidance_embeds
908+
else:
909+
use_guidance = self.controlnet.config.guidance_embeds
910+
911+
guidance = torch.tensor([guidance_scale], device=device) if use_guidance else None
909912
guidance = guidance.expand(latents.shape[0]) if guidance is not None else None
910913

911914
if isinstance(controlnet_keep[i], list):

0 commit comments

Comments
 (0)