Skip to content

Commit ea5f448

Browse files
committed
save
1 parent 944c8ec commit ea5f448

File tree

6 files changed

+79
-0
lines changed

6 files changed

+79
-0
lines changed

src/image_gen/BUILD

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,21 @@ cc_library(
3838
alwayslink = 1,
3939
)
4040

41+
cc_library(
42+
name = "pipelines",
43+
hdrs = ["pipelines.hpp"],
44+
srcs = ["pipelines.cpp"],
45+
deps = select({
46+
"//conditions:default": ["//third_party:genai", ":llm_engine"],
47+
"//:not_genai_bin" : [":llm_engine"],
48+
}),
49+
visibility = ["//visibility:public"],
50+
local_defines = COMMON_LOCAL_DEFINES,
51+
copts = COPTS_ADJUSTED,
52+
linkopts = LINKOPTS_ADJUSTED,
53+
alwayslink = 1,
54+
)
55+
4156
cc_library(
4257
name = "image_gen_calculator",
4358
srcs = ["http_image_gen_calculator.cc"],

src/image_gen/http_image_gen_calculator.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ using namespace ovms;
2929

3030
namespace mediapipe {
3131

32+
const std::string IMAGE_GEN_SESSION_SIDE_PACKET_TAG = "IMAGE_GEN_NODE_RESOURCES";
33+
3234
class HttpImageGenCalculator : public CalculatorBase {
3335
static const std::string INPUT_TAG_NAME;
3436
static const std::string OUTPUT_TAG_NAME;

src/image_gen/pipelines.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//*****************************************************************************
2+
// Copyright 2025 Intel Corporation
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//*****************************************************************************
16+
#include "pipelines.hpp"
17+
18+
namespace ovms {
19+
20+
ImageGenerationPipelines::ImageGenerationPipelines(const std::string& models_path) :
21+
text2ImagePipeline(ov::genai::Text2ImagePipeline(models_path/*TODO Device*/)) {
22+
// TODO: Make other pipelines out of the basic one, with shared models, GenAI API supports that
23+
}
24+
25+
} // namespace ovms

src/image_gen/pipelines.hpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//*****************************************************************************
2+
// Copyright 2025 Intel Corporation
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//*****************************************************************************
16+
#pragma once
17+
18+
#include <string>
19+
20+
#include <openvino/genai/image_generation/text2image_pipeline.hpp>
21+
22+
namespace ovms {
23+
24+
struct ImageGenerationPipelines {
25+
ov::genai::Text2ImagePipeline text2ImagePipeline;
26+
27+
ImageGenerationPipelines() = delete;
28+
ImageGenerationPipelines(const std::string& models_path);
29+
ImageGenerationPipelines(const ImageGenerationPipelines&) = delete;
30+
ImageGenerationPipelines& operator=(const ImageGenerationPipelines&) = delete;
31+
ImageGenerationPipelines(ImageGenerationPipelines&&) = delete;
32+
ImageGenerationPipelines& operator=(ImageGenerationPipelines&&) = delete;
33+
};
34+
35+
} // namespace ovms

src/mediapipe_internal/mediapipegraphexecutor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ MediapipeGraphExecutor::MediapipeGraphExecutor(
6060

6161
const std::string MediapipeGraphExecutor::PYTHON_SESSION_SIDE_PACKET_TAG = "py";
6262
const std::string MediapipeGraphExecutor::LLM_SESSION_SIDE_PACKET_TAG = "llm";
63+
const std::string MediapipeGraphExecutor::IMAGE_GEN_SESSION_SIDE_PACKET_TAG = "pipes";
6364
const ::mediapipe::Timestamp MediapipeGraphExecutor::STARTING_TIMESTAMP = ::mediapipe::Timestamp(0);
6465

6566
} // namespace ovms

src/mediapipe_internal/mediapipegraphexecutor.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class MediapipeGraphExecutor {
9191
public:
9292
static const std::string PYTHON_SESSION_SIDE_PACKET_TAG;
9393
static const std::string LLM_SESSION_SIDE_PACKET_TAG;
94+
static const std::string IMAGE_GEN_SESSION_SIDE_PACKET_TAG;
9495
static const ::mediapipe::Timestamp STARTING_TIMESTAMP;
9596

9697
MediapipeGraphExecutor(const std::string& name, const std::string& version, const ::mediapipe::CalculatorGraphConfig& config,

0 commit comments

Comments
 (0)