Hi n8n community,
I’m running into an issue using the Hugging Face black-forest-labs/FLUX.1-schnell
image generation model in n8n.
Here’s what I’ve observed:
-
HTTP Request node:
-
Method:
POST
-
URL:
https://api-inference.huggingface.co/models/black-forest-labs/FLUX.1-schnell
-
Headers:
Authorization: Bearer <YOUR_TOKEN>
-
Body (raw JSON):
{ "inputs": "A white hat hacker working on a computer, futuristic, secure, digital security, cyber security" }
Result: Works perfectly, image is returned.
-
-
AI Agent HTTP Request(as tool):
-
Using the same parameters and body, generated via
$fromAI()
or similar templating. -
Correct
Content-Type
and Authorization headers are included.
Result: Fails with:
Bad request - please check your parameters
-
What I’ve checked:
-
Token is valid and works in the standalone HTTP Request node
-
inputs
is a string and correctly formatted -
Headers are identical to the working node
Question:
Has anyone successfully used Hugging Face image models in AI Agent HTTP Request nodes? Could this be a templating/formatting issue specific to AI Agent, or is there something else required for image generation endpoints?
Any advice would be greatly appreciated.
Thanks!