Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends OVMS image-generation support to cover inpainting/outpainting via the OpenAI-compatible /v3/images/edits endpoint (using an uploaded mask), and updates pipeline initialization to include OpenVINO GenAI’s InpaintingPipeline.
Changes:
- Add
InpaintingPipelineto the image-generation pipeline bundle and initialize pipelines with weight-sharing + fallbacks. - Route
/v3/images/editsrequests to inpainting whenmaskis provided; expand request-option validation to acceptmask. - Extend multipart parser interface with a “files array” accessor and update demos/docs/assets accordingly.
Reviewed changes
Copilot reviewed 13 out of 20 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/image_gen/http_image_gen_calculator.cc |
Routes edit requests to inpainting when mask is present; removes per-request pipeline cloning. |
src/image_gen/pipelines.hpp |
Adds InpaintingPipeline member and include. |
src/image_gen/pipelines.cpp |
Builds/compiles inpainting pipeline and derives other pipelines with fallbacks. |
src/image_gen/imagegenutils.cpp |
Accepts mask in allowed fields for generation/edit option parsing. |
src/multi_part_parser.hpp |
Adds getFilesArrayByFieldName() to the multipart parser API. |
src/http_frontend/multi_part_parser_drogon_impl.hpp/.cpp |
Implements getFilesArrayByFieldName() for Drogon multipart parser. |
src/test/text2image_test.cpp |
Updates MockedMultiPartParser to match the new interface. |
src/test/test_http_utils.hpp |
Updates multipart parser mock to match the new interface. |
src/test/pull_hf_model_test.cpp |
Adds test coverage for image-generation export command with extra params. |
src/pull_module/optimum_export.cpp |
Appends extraQuantizationParams for image-generation export command. |
demos/image_generation/README.md |
Documents inpainting/outpainting usage via cURL and OpenAI Python client. |
demos/image_generation/cat_mask.png |
Demo asset for inpainting mask. |
demos/image_generation/outpaint_mask.png |
Demo asset for outpainting mask. |
.gitignore |
Reorders/adds Bazel output directories to ignore list. |
.dockerignore |
Expands ignored local/dev and build artifacts; ignores models/ and logs. |
You can also share your feedback on Copilot code review. Take the survey.
| static std::set<std::string> acceptedFields{ | ||
| "prompt", "prompt_2", "prompt_3", | ||
| "image", | ||
| "mask", |
Comment on lines
528
to
532
| static std::set<std::string> acceptedFields{ | ||
| "prompt", "prompt_2", "prompt_3", | ||
| "image", | ||
| "mask", | ||
| "negative_prompt", "negative_prompt_2", "negative_prompt_3", |
src/pull_module/optimum_export.cpp
Outdated
| oss << " --weight-format " << this->exportSettings.precision; | ||
| if (this->exportSettings.extraQuantizationParams.has_value()) { | ||
| oss << " " << this->exportSettings.extraQuantizationParams.value(); | ||
| } // TODO FIXME check if its not needed to propagate to other exports |
Comment on lines
+182
to
+185
| // single request assumption - use pipeline instance directly | ||
| if (!pipe->text2ImagePipeline) | ||
| return absl::FailedPreconditionError("Text-to-image pipeline is not available for this model"); | ||
| auto status = generateTensor(*pipe->text2ImagePipeline, prompt, requestOptions, images); |
Comment on lines
+224
to
+227
| if (!pipe->image2ImagePipeline) | ||
| return absl::FailedPreconditionError("Image-to-image pipeline is not available for this model"); | ||
| // image-to-image path - single pipeline instance, no clone needed | ||
| status = generateTensorImg2Img(*pipe->image2ImagePipeline, prompt, imageTensor, requestOptions, images); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CVS-181770