I am getting “Request failed with status code 400” when running this function createImageEdit() with the official openai SDK in nodejs. Any thoughts?
const response = await openai
.createImageEdit(
fs.createReadStream("testImage.png"),
fs.createReadStream("maskImage.png"),
"A cartoon cute baby otter with blue eyes",
1,
"256x256"
)
.catch((error) => {
console.log(error);
return res.status(200).send({ error: error });
});
var image_url = response;
return res.status(200).send({ test: image_url });
Hast du in den Community-Foren gesucht? Schau mal bitte hier.
I finally solved it. The values (e.g. temperature) retrieved from environment variables were text, and changing them to numeric types fixed the problem. This was a bug on my side since I changed only this part yesterday. I’m ashamed to admit it, but I’ll leave a record of it for the sake of others to follow. (I’m writing this here because I’ve reached the maximum number of replies.)
Suddenly I got this error today, Jan 17, 2023…
Until yesterday, our code has been running correctly.
Error: R…
1 Like
Have you found a resolution for the 400 error? I get it exactly with createImageEdit as well.
I found a solution for creatImageEdit 400 error. It appears that the order of arguments should be image, prompt, mask etc instead of image, mask, prompt etc as described in the documentation.