- n8n Self-Hosted Community Edition 1.112.6
- Fusion Brain (Kandinsky) AI service — offers 100 free image requests per month
This turned out to be harder than I expected.
I found a community node "n8n-nodes-fusionbrain". But “This node is no longer maintained”. The reason is “Due to recent updates, the Fusion Brain API has become too unstable and unreliable for production use”.
So, it doesn’t work anymore. When I tried it, I got this error: “Cannot read properties of undefined (reading 'length')”
Okay, let’s do it ourselves!
There is official documentation here: https://fusionbrain.ai/docs/en/doc/api-dokumentaciya/
The Python example in the docs works perfectly. But how can I use it in n8n?
Image generation workflow in Fusion Brain consist of 3 stages:
- Get the pipeline ID
- Send the generate request
- Get the generated image
I just need 3 “HTTP Request” nodes. But I had a big problem in step 2.
Fusion Brain expects two parameters in the body (Content-Type: multipart/form-data):
But n8n’s HTTP Request node can only use one Content-Type at a time.
- If I choose “Form-Data”, I get this error: “Unsupported Media Type, status=415. Content-Type 'application/octet-stream' is not supported.”
- If I choose “Raw”, n8n auto-generates a boundary and the API doesn’t understand it.
I tried many options, but nothing worked.
As far I understand, at the moment there is no way do to it by HTTP Request node.
The Solution
I installed the “n8n-nodes-curl” community node.
This node lets me send requests exactly like in curl - with full control over headers and body format.
Share with you my workflow - https://github.com/ruschestor/n8n_templates/blob/main/n8n_Fusion_Brain_Image_Generation.json
Hope it helps someone.
No comments:
Post a Comment