Looks fine here now. Raf responded a while back.
Happy New Year. We’ve been trying to hold down the fort, so to speak. ![]()
Looks fine here now. Raf responded a while back.
Happy New Year. We’ve been trying to hold down the fort, so to speak. ![]()
i’m still encountering issues with this endpoint. i’m now passing my PNGs exactly like the reference in the docs, but i’m getting
error: { code: null, message: "Invalid input image - format must be in ['RGBA', 'LA', 'L'], got 1.", param: null, type: 'invalid_request_error' }

Did you try the solution up-thread?
@PaulBellow yes. those return ‘message: ‘Uploaded image must be a PNG and less than 4 MB.’’, which is even further away from the last error i posted
There is another recent post in the community that may relevant. It talks about the file being 24 bit vs 32 bit PNG files.
My understanding is that the file.name setting in my example above is important in Typescript. It helps the AI understand that it is a valid PNG file. I suspect you may need to give your image and mask buffers names, and also cast them as type any
didnt mean to tag you in that last reply, sorry raymon. thanks for the help, but it isn’t working for me sadly
Do you have your code with the changes made?


i’m not even getting a useful error message anymore
Can you cast while calling a function?
I would set it up like one of the two examples above…
Also, you’re not setting image.name so it’s certain it’s a PNG… might be the problem?
Can you upload the image and mask you’re using?
Are they 24bit or 32bit PNGs?
Is the normal generation endpoint working for you?
ETA: Might also try casting and setting up the images within the function?
Can you also give us the console.log output for the response object (remove any sensitive info first)
If that is what is in the second image you posted, then response is undefined at the time the log is being called
generation works. i’m using a function to save the generation response as a PNG, then using that as my edits image. i’m not sure if it’s 24b or 32b, but i’ll dig into it.
i do have some console logs in my code, but it seems they aren’t even triggering. i’m getting some massive block of data from the API, and the second image is what i can gather as the relevant part of it. i think it’s returning undefined because something is wrong with my request. hopefully it’s the bits thing.
I’m betting that might be something to do with it?
What are you using to save the PNG?
i’m using the npm library ‘image-downloader’

I’m starting to think maybe it’s not saving the PNG correctly…or rather, not saving in a form DALLE2 can use…
Can you upload the image and mask you’re using?
Might also try to return it as base64 rather than url…
Can you give us an example of what you get for the url variable?
Is it a url, or is it a string starting with “data:image/gif;base64,R0l” etc…
If it is undefined, can you also get the value for response.data[0][“url”]
Note: this only has one reference to data
I have some ideas - but the answer will help go in the right direction
Finally, can you also give the line where you define the download object in your final bit of code
this is a URL returned by my request to image generations. i’ve tried many different ways of converting both URL and b64 data to a valid PNG, but i had no idea what exactly constitutes such a thing. so i eventually ended up on the npm package ‘image-installer’, which is where the download object is from.
import * as download from 'image-downloader'
as for using b64 @PaulBellow, i’m just not certain how exactly to convert it to a valid PNG. i’ve tried several methods but haven’t landed on the right way. i knew absolutely nothing about images before this project, so it’s tough for me to identify where the issues are coming from
i tried logging the url response from edits, but it doesn’t even trigger the log. the call fails and logs a huge object that i’m not familiar with

OK, so you are getting the image url back (excellent)
It is a url, so we need to download the url and save it locally as a PNG file (At least that will get you able to move forward)
You need to use the variable “url” instead of “image” (Assuming the output you gave me above was from the url variable)
I also assume the path …/…/images can be accessed by your code when it is running. Try removing the …/…/images prefix if this doesn’t work.
const download = require(‘image-downloader’);
options = {
url: url,
dest: ‘…/…/images/cover.png’,
};
download.image(options)
.then(({ filename }) => {
console.log(‘Saved to’, filename);
})
.catch((err) => console.error(err));