Parameter size of create_edit is mandatory or optional ?

I am using the create_edit api l like this : response = openai.Image.create_edit(
image=open(original, “rb”),
mask=open(mask, “rb”),
response_format = “url”,
)but, sometime, the size is not 512 x 512, some time it is 256*345 or any other size, how to define the size ? because I want to make the picture of original cannot be notioned

The size to be returned must be one of three square sizes, at 256, 512, or 1024.

As for the image you send:




The image to edit. Must be a valid PNG file, less than 4MB, and square. If mask is not provided, image must have transparency, which will be used as the mask.

The unspoken part is that for any quality and working transparency, you’ll want to send 32 bit PNG images (24 bit + alpha channel) at the highest resolution of 1024x1024.