#Create image edit documentation says the Mask parameter is optional but it shows as required

15 messages · Page 1 of 1 (latest)

silk tide
#

According to https://beta.openai.com/docs/api-reference/images/create-edit

This should work:

openai.Image.create_edit(
  image=open("otter.png", "rb"),
  prompt="A cute baby sea otter wearing a beret",
  n=2,
  size="1024x1024"
)```

Error: `TypeError: create_edit() missing 1 required positional argument: 'mask'`
exotic falcon
#

does mask=None work?

silk tide
#

let me try

#

Yes, it does execute but no modifications are made to the original image

exotic falcon
#

Right, because the mask is the only place that can be edited when creating an image edit, so if the mask is None, no edits can be done, sorry I should’ve mentioned earlier, I misread the original message

#

I think you need to switch to the generations endpoint

#

Editing is for taking an existing image and using AI on a part of it

#

generations endpoint lets you create an image from a prompt

silk tide
#

Makes sense, thanks.

#

In that case, would not be useful to change the doc about it saying it's mandatory in order to create the edit?

digital knoll
#

Yeah sorry this is my bad

#

I have not released a new sdk version yet

#

For now just send the image as the mask

#

The backend supports optional mask so if you make the raw url request it works

#

If you don’t pass mask it will use alpha channel of image