diff --git a/src/diffusers/loaders.py b/src/diffusers/loaders.py index d0a9b3e2d382..35204ea72cc2 100644 --- a/src/diffusers/loaders.py +++ b/src/diffusers/loaders.py @@ -2433,8 +2433,8 @@ def from_single_file(cls, pretrained_model_link_or_path, **kwargs): from .models.controlnet import ControlNetModel from .pipelines.controlnet.multicontrolnet import MultiControlNetModel - # Model type will be inferred from the checkpoint. - if not isinstance(controlnet, (ControlNetModel, MultiControlNetModel)): + # list/tuple or a single instance of ControlNetModel or MultiControlNetModel + if not (isinstance(controlnet, (ControlNetModel, MultiControlNetModel)) or isinstance(controlnet, (list, tuple)) and isinstance(controlnet[0], ControlNetModel)): raise ValueError("ControlNet needs to be passed if loading from ControlNet pipeline.") elif "StableDiffusion" in pipeline_name: # Model type will be inferred from the checkpoint.