-
Notifications
You must be signed in to change notification settings - Fork 2k
Add support for OpenAI's Create Image Edit API #3484
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
base: main
Are you sure you want to change the base?
Conversation
Related issue: spring-projects#2870 Signed-off-by: minsoo.nam <[email protected]>
| return "image.png"; | ||
| } | ||
| }; | ||
| multipartBody.add("image", imageResource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use image[] instead of image, to take into consideration if the array of images is more than 1
| Resource imageResource = new ByteArrayResource(image) { | ||
| @Override | ||
| public String getFilename() { | ||
| return "image.png"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take into consideration that the filename should be unique if the array size is more than one, and the extension does not always come as PNG
| Resource imageResource = new ByteArrayResource(openAiImageEditRequest.mask()) { | ||
| @Override | ||
| public String getFilename() { | ||
| return "mask.png"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take in consideration if the mask have another extension
- spring-projects#3484 (comment) - spring-projects#3484 (comment) - spring-projects#3484 (comment) Signed-off-by: minsoo.nam <[email protected]>
|
@markpollack makes reference to this closed PR: #2914 |
Related issue - #2870
Added a model to use the
Create image editAPI provided by OpenAI.https://platform.openai.com/docs/api-reference/images/createEdit
I'm submitting this new PR to replace #2914, which had problems caused by a mistaken rebase.
Sorry for the inconvenience, and thank you for your understanding.