diff --git a/src/diffusers/pipelines/pipeline_utils.py b/src/diffusers/pipelines/pipeline_utils.py index df2a7c6c40..b0e7ec9efc 100644 --- a/src/diffusers/pipelines/pipeline_utils.py +++ b/src/diffusers/pipelines/pipeline_utils.py @@ -1033,6 +1033,10 @@ class DiffusionPipeline(ConfigMixin, PushToHubMixin): # 1. Download the checkpoints and configs # use snapshot download here to get it working from from_pretrained if not os.path.isdir(pretrained_model_name_or_path): + if pretrained_model_name_or_path.count("/") > 1: + raise ValueError( + f"The provided pretrained_model_name_or_path \"{pretrained_model_name_or_path}\"" + " is neither a valid local path nor a valid repo id. Please check the parameter.") cached_folder = cls.download( pretrained_model_name_or_path, cache_dir=cache_dir,