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
25.11k stars 5.18k forks source link

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

Open chuck-ma opened 1 month ago

chuck-ma commented 1 month 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 1 month ago

Cc: @gnobitab