mirror of
https://github.com/GayPizzaSpecifications/stable-diffusion-rpc.git
synced 2025-08-03 13:31:32 +00:00
24 lines
735 B
C++
24 lines
735 B
C++
|
#include "StableDiffusion.pb.h"
|
||
|
#include "StableDiffusion.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;
|
||
|
}
|