HuggingFace Inference API cannot determine image type of the image I am sending

Hi. I am using meta-llama/Llama-3.2-11B-Vision-Instruct model from the endpoint https://api-inference.huggingface.co/models/meta-llama/Llama-3.2-11B-Vision-Instruct/v1/chat/completions and, due to a misconfiguration in my server, or something related from HF, I cant feed the image.

I am getting hit with the response “Input validation error: invalid image: The image format could not be determined” when I try to use image => https://static.cansu.dev/DTF%20Wallets/Wallets/Walllets%20logos%20%20(National%20Football%20League)/Walllets%20logos%20%20(National%20Football%20League)-06.jpg

from cURL,

HTTP/2 200 
date: Fri, 21 Mar 2025 22:03:44 GMT
content-type: image/jpeg
content-disposition: attachment; filename=image.jpg
etag: W/"1269648391-br"
last-modified: Wed, 12 Mar 2025 13:21:23 GMT
vary: Accept-Encoding
x-content-type-options: nosniff
cache-control: max-age=14400
cf-cache-status: MISS
report-to: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=eYHY2KYXJVb89gHUe0lnG6X7aSTLJ2PEYc%2Fy2UUysK4E8QEcuae9IWaVlahiG0KOZ%2FWU%2B7AmO8%2FQvVAKynNEjg9e7KzoFSul9udVS5pBYVEdGRJFvcdE7O9ktWFQ5tLly67w"}],"group":"cf-nel","max_age":604800}
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
server: cloudflare
cf-ray: 9240bdb1cbedd251-AMS
alt-svc: h3=":443"; ma=86400
server-timing: cfL4;desc="?proto=TCP&rtt=99423&min_rtt=80127&rtt_var=37870&sent=5&recv=8&lost=0&retrans=0&sent_bytes=3379&recv_bytes=857&delivery_rate=36142&cwnd=238&unsent_bytes=0&cid=23ff9705addda769&ts=187&x=0"

As you can see here, I am helping Hugging Face as much as I can to determine the image type. Content-Type is set to image/jpeg, x-content-type-options set to nosniff for no confusions, content-disposition set to attachment, file name is clear, what am I doing wrong? When I feed Google Drive link, it is all fine, what is wrong here?

1 Like

Fixed. All I had to do was changing the endpoint URL to https://router.huggingface.co/novita/v3/openai/chat/completions

such a fucking shame. thanks for wasting my 2 hours with your own “Huggingface Inference” provider, Novita worked on first try.

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.