Upload black-forest-labs_FLUX.2-klein-9B_1.txt with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384```CODE: import torchfrom diffusers import DiffusionPipelinefrom diffusers.utils import load_image
# switch to "mps" for apple devicespipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-9B", dtype=torch.bfloat16, device_map="cuda")
prompt = "Turn this cat into a dog"input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png")
image = pipe(image=input_image, prompt=prompt).images[0]```
ERROR: Traceback (most recent call last): File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/utils/_http.py", line 402, in hf_raise_for_status response.raise_for_status() ~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/requests/models.py", line 1026, in raise_for_status raise HTTPError(http_error_msg, response=self)requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://huggingface.co/black-forest-labs/FLUX.2-klein-9B/resolve/main/model_index.json
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/tmp/black-forest-labs_FLUX.2-klein-9B_1JiYCYy.py", line 28, in <module> pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-9B", dtype=torch.bfloat16, device_map="cuda") File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 829, in from_pretrained cached_folder = cls.download( pretrained_model_name_or_path, ...<14 lines>... **kwargs, ) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/diffusers/pipelines/pipeline_utils.py", line 1605, in download config_file = hf_hub_download( pretrained_model_name, ...<5 lines>... token=token, ) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1007, in hf_hub_download return _hf_hub_download_to_cache_dir( # Destination ...<14 lines>... force_download=force_download, ) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1114, in _hf_hub_download_to_cache_dir _raise_on_head_call_error(head_call_error, force_download, local_files_only) ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1655, in _raise_on_head_call_error raise head_call_error File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1543, in _get_metadata_or_catch_error metadata = get_hf_file_metadata( url=url, proxies=proxies, timeout=etag_timeout, headers=headers, token=token, endpoint=endpoint ) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn return fn(*args, **kwargs) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 1460, in get_hf_file_metadata r = _request_wrapper( method="HEAD", ...<5 lines>... timeout=timeout, ) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 283, in _request_wrapper response = _request_wrapper( method=method, ...<2 lines>... **params, ) File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/file_download.py", line 307, in _request_wrapper hf_raise_for_status(response) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/tmp/.cache/uv/environments-v2/c056ef216bacca27/lib/python3.13/site-packages/huggingface_hub/utils/_http.py", line 419, in hf_raise_for_status raise _format(GatedRepoError, message, response) from ehuggingface_hub.errors.GatedRepoError: 403 Client Error. (Request ID: Root=1-6969e5ea-6dcb569e7e17ef55641fee41;040de5a3-e689-4333-ae9d-fba06e330d6f)
Cannot access gated repo for url https://huggingface.co/black-forest-labs/FLUX.2-klein-9B/resolve/main/model_index.json.Access to model black-forest-labs/FLUX.2-klein-9B is restricted and you are not in the authorized list. Visit https://huggingface.co/black-forest-labs/FLUX.2-klein-9B to ask for access.black-forest-labs_FLUX.2-klein-9B_1.txtAdded+84