I’m having trouble with the OpenAI Dall-e 2 image editing feature using the NodeJS SDK. My code looks like this:
const imageStream = fs.createReadStream(`./images/user_${userId}.png`)
const maskStream = fs.createReadStream(`./images/user_${userId}_mask.png`)
try {
const result = await aiClient.images.edit({
image: imageStream,
mask: maskStream,
prompt: userPrompt || 'Modify image based on prompt',
})
} catch (error) {
console.error('Error:', error.message)
}
But I’m getting a 400 error saying the image must be PNG and under 4MB. I’ve double-checked my files, and they meet these requirements. Any ideas what might be causing this? Could it be a problem with how I’m passing the image streams to the API? Thanks for any help!