Skip to content

Error when trying to execute the run.py script #3

@LucaCappelletti94

Description

@LucaCappelletti94

Hello and thank you for creating this library.

I have tried it out after installing it as described in the README, and I have executed the following bash command:

python run.py \
    --qrcode_path qrcode/thanks_reviewer.png \
    --prompt "Artistic Renaissance Leonardo Da Vinci Style" \
    --output_folder outputs

Here is the full traceback, it seems like trying to access the URL https://huggingface.co/checkpoints/control_v1p_sd15_qrcode_monster/resolve/main/config.json requires some user and password. Could you kindly make the model open?

Traceback (most recent call last):
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/utils/_http.py", line 409, in hf_raise_for_status
    response.raise_for_status()
  File "diffqrcoder/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/checkpoints/control_v1p_sd15_qrcode_monster/resolve/main/config.json

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "diffqrcoder/lib/python3.12/site-packages/diffusers/configuration_utils.py", line 379, in load_config
    config_file = hf_hub_download(
                  ^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 961, in hf_hub_download
    return _hf_hub_download_to_cache_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1068, in _hf_hub_download_to_cache_dir
    _raise_on_head_call_error(head_call_error, force_download, local_files_only)
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1596, in _raise_on_head_call_error
    raise head_call_error
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1484, in _get_metadata_or_catch_error
    metadata = get_hf_file_metadata(
               ^^^^^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 1401, in get_hf_file_metadata
    r = _request_wrapper(
        ^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 285, in _request_wrapper
    response = _request_wrapper(
               ^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/file_download.py", line 309, in _request_wrapper
    hf_raise_for_status(response)
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/utils/_http.py", line 459, in hf_raise_for_status
    raise _format(RepositoryNotFoundError, message, response) from e
huggingface_hub.errors.RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-67f3af7e-73d3bfb7003c97cb3439d71e;a78e190c-fa6e-4aa7-9bc0-2f6c5c5790a2)

Repository Not Found for url: https://huggingface.co/checkpoints/control_v1p_sd15_qrcode_monster/resolve/main/config.json.
Please make sure you specified the correct `repo_id` and `repo_type`.
If you are trying to access a private or gated repo, make sure you are authenticated. For more details, see https://huggingface.co/docs/huggingface_hub/authentication
Invalid username or password.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/luca/github/DiffQRCoder/run.py", line 99, in <module>
    controlnet = ControlNetModel.from_pretrained(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/diffusers/models/modeling_utils.py", line 687, in from_pretrained
    config, unused_kwargs, commit_hash = cls.load_config(
                                         ^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
    return fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^
  File "diffqrcoder/lib/python3.12/site-packages/diffusers/configuration_utils.py", line 394, in load_config
    raise EnvironmentError(
OSError: checkpoints/control_v1p_sd15_qrcode_monster is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with `token` or log in with `huggingface-cli login`.

Best,
Luca

P.S. If you are interested in what I would like to do with the library, I work on an open source metabolomics project, and I hope to use this library to make the QR codes we use to track plant specimens have some artistic flare, so they are not just a plain boring qr code, and might attract the interest of visitors in botanical gardens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions