Start work on C++ client, and implement streaming of image generation.

This commit is contained in:
alex committed 2023-04-23 14:23:27 -07:00
1 parent 1bb629c18f
commit b063d91b1e
11 files changed
+509 -31

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
/cmake-build-*
/.idea
/.vscode
/src/*.grpc.*
/src/*.pb.*
+22
View File
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.20)
project(sdrpc)
find_package(Protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_library(sdrpc src/StableDiffusion.proto)
get_target_property(grpc_cpp_plugin_location gRPC::grpc_cpp_plugin LOCATION)
protobuf_generate(TARGET sdrpc LANGUAGE cpp)
protobuf_generate(TARGET sdrpc LANGUAGE grpc
GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc
PLUGIN "protoc-gen-grpc=${grpc_cpp_plugin_location}")
target_include_directories(sdrpc PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(sdrpc PUBLIC protobuf::libprotobuf gRPC::grpc gRPC::grpc++)
add_executable(sdrpc_sample src/sample.cpp)
target_include_directories(sdrpc_sample PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(sdrpc_sample PRIVATE sdrpc)
+1
View File
@@ -0,0 +1 @@
../../../Common/StableDiffusion.proto
+11
View File
@@ -0,0 +1,11 @@
#include <StableDiffusion.pb.h>
#include <iostream>
using namespace gay::pizza::stable::diffusion;
int main() {
ModelInfo info;
info.set_name("anything-4.5");
std::cout << info.DebugString() << std::endl;
return 0;
}