huggingface / diffusers

🤗 Diffusers: State-of-the-art diffusion models for image and audio generation in PyTorch and FLAX.
https://huggingface.co/docs/diffusers
Apache License 2.0
26.25k stars 5.41k forks source link

AttributeError: 'list' object has no attribute '__module__' :hunyuan dit cannot load multiple controlnets #9142

Open chuck-ma opened 3 months ago

chuck-ma commented 3 months ago

Describe the bug

Can not use multiple controlnets, https://huggingface.co/docs/diffusers/main/en/api/pipelines/controlnet_hunyuandit. According to the docs above, it seems that I just need to use a list of controlnets to init the pipeline.

image

Reproduction

from diffusers import HunyuanDiT2DControlNetModel, HunyuanDiTControlNetPipeline, HunyuanDiT2DModel
import torch

model_id = "Tencent-Hunyuan/HunyuanDiT-v1.2-Diffusers-Distilled"

depth_controlnet = HunyuanDiT2DControlNetModel.from_pretrained("Tencent-Hunyuan/HunyuanDiT-v1.2-ControlNet-Diffusers-Depth", 
                                                         torch_dtype=torch.float16)
controlnets = [
    depth_controlnet, depth_controlnet
]

hunyuan_inpaint_pipe = HunyuanDiTControlNetPipeline.from_pretrained(model_id,
                                                    controlnet=controlnets, 
                                                    torch_dtype=torch.float16)

Logs

No response

System Info

Who can help?

@sayakpaul @yiyixuxu @DN6

sayakpaul commented 3 months ago

Cc: @gnobitab

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the contributing guidelines are likely to be ignored.

a-r-r-o-w commented 2 weeks ago

Thanks for reporting, and sorry for the delay in responding! Is this still an issue btw? I think it is since I can't find any relevant PRs. Opening it for community contributions, but if not completed soon, I'll fix it asap.