Error 422 when calling FAL.AI API

What are you trying to achieve?

I’m trying to create AI images using FAL.AI API but it’s giving me an error 422, which I believe that’s probably caused by unexpected new line characters or spaces. Here is the error:

Error: 422 Unprocessable Entity
{“detail”:[{“type”:“json_invalid”,“loc”:[“body”,355],“msg”:“JSON decode error”,“input”:{},“ctx”:{“error”:“Invalid control character at”}}]}

Can anyone help?

Steps taken so far

I have tried running the module alone and it works by inputting the result from the previous module.

Screenshots: scenario setup, module configuration, errors

I have the same problem. were you able to find solution?

Sorry, I didn’t. Deleted scenario and now I’m running on Fal.AI and just downloading the files as needed.

You probably fixed this, but anyone googling for this: Probably an issue with some special character in your prompt. I got the same error when my prompt contained a " character.

I had the same problem but with FLUX.1 from Blackforestlabs.
I had to tell the AI to not include any special character and no white space at the end.
To get sure I added a find replace to replace empty strings at the end.

I made a video about it, you can find it here: https://www.youtube.com/watch?v=t5YD9Q3Iy3I