Skip to content

Commit

Permalink
config attribute not foud error for FluxImagetoImage Pipeline for mul…
Browse files Browse the repository at this point in the history
…ti controlnet solved (huggingface#9586)

Co-authored-by: YiYi Xu <[email protected]>
  • Loading branch information
rshah240 and yiyixuxu authored Oct 23, 2024
1 parent bfa0aa4 commit 24c7d57
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,12 @@ def __call__(

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

guidance = (
torch.tensor([guidance_scale], device=device) if self.controlnet.config.guidance_embeds else None
)
if isinstance(self.controlnet, FluxMultiControlNetModel):
use_guidance = self.controlnet.nets[0].config.guidance_embeds
else:
use_guidance = self.controlnet.config.guidance_embeds

guidance = torch.tensor([guidance_scale], device=device) if use_guidance else None
guidance = guidance.expand(latents.shape[0]) if guidance is not None else None

if isinstance(controlnet_keep[i], list):
Expand Down

0 comments on commit 24c7d57

Please sign in to comment.