Skip to content

Image inpainting, outpainting#4047

Open
atobiszei wants to merge 6 commits intomainfrom
atobisze_image_inpainting
Open

Image inpainting, outpainting#4047
atobiszei wants to merge 6 commits intomainfrom
atobisze_image_inpainting

Conversation

@atobiszei
Copy link
Collaborator

CVS-181770

@atobiszei atobiszei added the WIP Do not merge until resolved label Mar 9, 2026
@atobiszei atobiszei marked this pull request as ready for review March 13, 2026 14:12
Copilot AI review requested due to automatic review settings March 13, 2026 14:13
@atobiszei atobiszei removed the WIP Do not merge until resolved label Mar 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 InpaintingPipeline to the image-generation pipeline bundle and initialize pipelines with weight-sharing + fallbacks.
  • Route /v3/images/edits requests to inpainting when mask is provided; expand request-option validation to accept mask.
  • 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",
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);
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

Successfully merging this pull request may close these issues.

2 participants