I want to change an existing photo. My goal is to transform a selfie into a watercolor style picture.
I make a request using curl in the console. The request passes, but in the response I receive the URL to the original image, as if the space is completely empty. Has anyone had a similar problem? I tried different formats and photo resolutions, added a mask. All to no avail.
My request:
curl -H 'Authorization: Bearer sk-***uPb' https://api.openai.com/v1/images/edits --form 'image=@"./tmp/selfie.png"' --form 'prompt="replace background to river and use watercolor style for photo"' --form 'size="256x256"' --form 'n=1'
The edits endpoint can only modify the image in areas where there is a 32-bit alpha layer that is completely transparent.
Here’s a 256px PNG that has the middle 1/3 as transparent. Click “download” or right-click and save and hopefully you’ll get a version that the forum hasn’t re-encoded, and then use that as your mask file to see if the transparent area is re-drawn.
Edits won’t be able to redo the whole image as a watercolor (and variations takes no prompt).
Thank you, it is working.
But if I use mask file, which all emty-openai erase photo and I see only river. So is impossible to save person and change photo style?
That is correct: Edits is infill and outfill into the transparent areas. If you try to use it as “everything-fill”, you just get a poor DALL-E 2 image based on the prompt.
I read the “Image Edit” and “Image Variation” APIs and it made sense kind of, but we sure could benefit from having some actual examples of use cases.
That’s a great example, thanks! The API documentation would really benefit from having some sample images like these, but people will likely find it here too, if they search this forum.