Hi guys,
I try to run stable_diffusion.ipynb on paperspace, after I get logged into Huggingface, when I run
pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16).to("cuda")
I received the following error message:
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
File ~/mambaforge/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:213, in hf_raise_for_status(response, endpoint_name)
212 try:
--> 213 response.raise_for_status()
214 except HTTPError as e:
File ~/mambaforge/lib/python3.9/site-packages/requests/models.py:960, in Response.raise_for_status(self)
959 if http_error_msg:
--> 960 raise HTTPError(http_error_msg, response=self)
HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/CompVis/stable-diffusion-v1-4/resolve/fp16/model_index.json
The above exception was the direct cause of the following exception:
HfHubHTTPError Traceback (most recent call last)
File ~/mambaforge/lib/python3.9/site-packages/diffusers/configuration_utils.py:223, in ConfigMixin.get_config_dict(cls, pretrained_model_name_or_path, **kwargs)
221 try:
222 # Load from URL or cache if already cached
--> 223 config_file = hf_hub_download(
224 pretrained_model_name_or_path,
225 filename=cls.config_name,
226 cache_dir=cache_dir,
227 force_download=force_download,
228 proxies=proxies,
229 resume_download=resume_download,
230 local_files_only=local_files_only,
231 use_auth_token=use_auth_token,
232 user_agent=user_agent,
233 subfolder=subfolder,
234 revision=revision,
235 )
237 except RepositoryNotFoundError:
File ~/mambaforge/lib/python3.9/site-packages/huggingface_hub/file_download.py:1053, in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, user_agent, force_download, force_filename, proxies, etag_timeout, resume_download, use_auth_token, local_files_only, legacy_cache_layout)
1052 try:
-> 1053 metadata = get_hf_file_metadata(
1054 url=url,
1055 use_auth_token=use_auth_token,
1056 proxies=proxies,
1057 timeout=etag_timeout,
1058 )
1059 except EntryNotFoundError as http_error:
1060 # Cache the non-existence of the file and raise
File ~/mambaforge/lib/python3.9/site-packages/huggingface_hub/file_download.py:1359, in get_hf_file_metadata(url, use_auth_token, proxies, timeout)
1350 r = _request_wrapper(
1351 method="HEAD",
1352 url=url,
(...)
1357 timeout=timeout,
1358 )
-> 1359 hf_raise_for_status(r)
1361 # Return
File ~/mambaforge/lib/python3.9/site-packages/huggingface_hub/utils/_errors.py:254, in hf_raise_for_status(response, endpoint_name)
252 # Convert `HTTPError` into a `HfHubHTTPError` to display request information
253 # as well (request id and/or server error message)
--> 254 raise HfHubHTTPError(str(HTTPError), response=response) from e
HfHubHTTPError: <class 'requests.exceptions.HTTPError'> (Request ID: D43zpesQMDw2FCdgEwYc6)
During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16).to("cuda")
File ~/mambaforge/lib/python3.9/site-packages/diffusers/pipeline_utils.py:345, in DiffusionPipeline.from_pretrained(cls, pretrained_model_name_or_path, **kwargs)
342 # 1. Download the checkpoints and configs
343 # use snapshot download here to get it working from from_pretrained
344 if not os.path.isdir(pretrained_model_name_or_path):
--> 345 config_dict = cls.get_config_dict(
346 pretrained_model_name_or_path,
347 cache_dir=cache_dir,
348 resume_download=resume_download,
349 proxies=proxies,
350 local_files_only=local_files_only,
351 use_auth_token=use_auth_token,
352 revision=revision,
353 )
354 # make sure we only download sub-folders and `diffusers` filenames
355 folder_names = [k for k in config_dict.keys() if not k.startswith("_")]
File ~/mambaforge/lib/python3.9/site-packages/diffusers/configuration_utils.py:255, in ConfigMixin.get_config_dict(cls, pretrained_model_name_or_path, **kwargs)
251 raise EnvironmentError(
252 f"{pretrained_model_name_or_path} does not appear to have a file named {cls.config_name}."
253 )
254 except HTTPError as err:
--> 255 raise EnvironmentError(
256 "There was a specific connection error when trying to load"
257 f" {pretrained_model_name_or_path}:\n{err}"
258 )
259 except ValueError:
260 raise EnvironmentError(
261 f"We couldn't connect to '{HUGGINGFACE_CO_RESOLVE_ENDPOINT}' to load this model, couldn't find it"
262 f" in the cached files and it looks like {pretrained_model_name_or_path} is not the path to a"
(...)
265 " 'https://huggingface.co/docs/diffusers/installation#offline-mode'."
266 )
OSError: There was a specific connection error when trying to load CompVis/stable-diffusion-v1-4:
<class 'requests.exceptions.HTTPError'> (Request ID: D43zpesQMDw2FCdgEwYc6)
I have no experience of dealing with this kind of problem. Could anyone have a look? Thanks!