Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The CreateEditImage API should have an optional Mask parameter. #149

Closed
itegel opened this issue Mar 13, 2023 · 0 comments
Closed

The CreateEditImage API should have an optional Mask parameter. #149

itegel opened this issue Mar 13, 2023 · 0 comments

Comments

@itegel
Copy link
Contributor

itegel commented Mar 13, 2023

In image.go func CreateEditImage,
Mask is required in current implementation:
// mask
mask, err := writer.CreateFormFile("mask", request.Mask.Name())
if err != nil {
return
}
But it is optional in official docs:
https://platform.openai.com/docs/api-reference/images/create-edit
/*
mask
string
Optional
An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where image should be edited. Must be a valid PNG file, less than 4MB, and have the same dimensions as image.
*/

@itegel itegel mentioned this issue Mar 13, 2023
sashabaranov pushed a commit that referenced this issue Mar 13, 2023
* Compatible with the situation where the mask is empty in CreateEditImage.

* Fix the test for the unnecessary removal of the mask.png file.

* add image variation implementation
sashabaranov added a commit that referenced this issue Mar 13, 2023
This reverts commit 00eac3c.
sashabaranov added a commit that referenced this issue Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant