Skip to content

Conversation

@namsoo2
Copy link

@namsoo2 namsoo2 commented Jun 9, 2025

Related issue - #2870

Added a model to use the Create image edit API 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.

@namsoo2 namsoo2 marked this pull request as ready for review June 9, 2025 09:00
return "image.png";
}
};
multipartBody.add("image", imageResource);

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";

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";

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

@athegreat90
Copy link

@markpollack makes reference to this closed PR: #2914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants