2023-05-08 16:06:07 -07:00
|
|
|
#include "host.grpc.pb.h"
|
2023-05-08 22:12:24 -07:00
|
|
|
#include "model.grpc.pb.h"
|
2023-05-08 16:06:07 -07:00
|
|
|
#include "image_generation.grpc.pb.h"
|
2023-05-01 18:05:47 -07:00
|
|
|
|
|
|
|
#include <grpc++/grpc++.h>
|
|
|
|
|
|
|
|
using namespace gay::pizza::stable::diffusion;
|
|
|
|
|
|
|
|
int main() {
|
|
|
|
auto channel = grpc::CreateChannel("localhost:4546", grpc::InsecureChannelCredentials());
|
|
|
|
auto modelService = ModelService::NewStub(channel);
|
|
|
|
auto imageGenerationService = ImageGenerationService::NewStub(channel);
|
|
|
|
|
|
|
|
grpc::ClientContext context;
|
|
|
|
|
|
|
|
ListModelsRequest listModelsRequest;
|
|
|
|
ListModelsResponse response;
|
|
|
|
modelService->ListModels(&context, listModelsRequest, &response);
|
|
|
|
auto models = response.available_models();
|
|
|
|
for (const auto &item: models) {
|
|
|
|
std::cout << "Model Name: " << item.name() << std::endl;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|