I'm trying to get a variant of the image (URL), with OpenAI but fs.CreateReadStream() doesn't work for this, any solutions?
The OpenAI documentation uses fs.createReadStream, although I've tried http.get, Axios.get and neither works :(
const { Configuration, OpenAIApi } = require('openai')
const configuration = new Configuration({
apiKey: 'KEY',
})
const openai = new OpenAIApi(configuration)
const fs = require("node:fs")
async function getVariant() {
const A = await openai.createImageVariation(
fs.createReadStream("https://cdn.discordapp.com/avatars/778761434992476230/691f620e3c0b1ea006c9fabd7a07d485.png"),
1,
"1024x1024");
console.log(`${A.data.data[0].url} \n`)
}
getVariant()
I've tried http.get, Axios.get , Fetch , Buffer. for get a Image Variant With OpenAI but neither works :(