mirror of
https://github.com/GayPizzaSpecifications/stable-diffusion-rpc.git
synced 2025-08-04 14:01:32 +00:00
Document API, make the implementation match the API, and update the same.
This commit is contained in:
@ -11,20 +11,15 @@ class ModelServiceProvider: SdModelServiceAsyncProvider {
|
||||
}
|
||||
|
||||
func listModels(request _: SdListModelsRequest, context _: GRPCAsyncServerCallContext) async throws -> SdListModelsResponse {
|
||||
let models = await modelManager.listModels()
|
||||
let models = try await modelManager.listAvailableModels()
|
||||
var response = SdListModelsResponse()
|
||||
response.models.append(contentsOf: models)
|
||||
response.availableModels.append(contentsOf: models)
|
||||
return response
|
||||
}
|
||||
|
||||
func reloadModels(request _: SdReloadModelsRequest, context _: GRPCAsyncServerCallContext) async throws -> SdReloadModelsResponse {
|
||||
try await modelManager.reloadModels()
|
||||
return SdReloadModelsResponse()
|
||||
}
|
||||
|
||||
func loadModel(request: SdLoadModelRequest, context _: GRPCAsyncServerCallContext) async throws -> SdLoadModelResponse {
|
||||
let state = try await modelManager.createModelState(name: request.modelName)
|
||||
try await state.load()
|
||||
try await state.load(request: request)
|
||||
return SdLoadModelResponse()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user