Qwen/image 401 error unauthorized

Hello.
I encountered a Issue with Qwen/Image.
I have pro membership and created access token that I valided with in playground on different llm. and curl command. even by taking directly the code snipet in the different models.

Are there specific condition for image generation or access to request for qwen/image or any debugging tips ?

1 Like

You might be accessing the old Inference API endpoint. Try with the Inference Providers format.

It was exactly the same code.

import os
from huggingface_hub import InferenceClient

client = InferenceClient(api_key=hf_token, provider="fal-ai")

image = client.text_to_image(
    "A serene lake surrounded by mountains at sunset, photorealistic style",
    model="Qwen/Qwen-Image"
)

# Save the generated image
image.save("generated_image.png")
1 Like

I even set provider to “auto”

1 Like

I got this…

Try pip install -U huggingface_hub ?

already installed and at last version 0.34.4.
It seems that all the image models are concerned.

1 Like