Skip to content

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

@chuck-ma

Description

@chuck-ma

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

  • 🤗 Diffusers version: 0.30.0.dev0
  • Platform: Linux-5.15.0-78-generic-x86_64-with-glibc2.35
  • Running on Google Colab?: No
  • Python version: 3.10.13
  • PyTorch version (GPU?): 2.3.0+cu121 (True)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Huggingface_hub version: 0.23.4
  • Transformers version: 4.41.2
  • Accelerate version: 0.29.2
  • PEFT version: 0.10.0
  • Bitsandbytes version: 0.43.1
  • Safetensors version: 0.4.3
  • xFormers version: 0.0.26.post1
  • Accelerator: NVIDIA GeForce RTX 4090, 24564 MiB

Who can help?

@sayakpaul @yiyixuxu @DN6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions