mirror of
https://github.com/GayPizzaSpecifications/stable-diffusion-rpc.git
synced 2025-08-03 05:30:54 +00:00
25 lines
757 B
C++
25 lines
757 B
C++
#include "host.grpc.pb.h"
|
|
#include "model.grpc.pb.h"
|
|
#include "image_generation.grpc.pb.h"
|
|
|
|
#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;
|
|
}
|