mirror of
https://github.com/GayPizzaSpecifications/stable-diffusion-rpc.git
synced 2025-08-05 14:31:32 +00:00
Split out worker related things to a separate service definition.
This commit is contained in:
@ -11,21 +11,6 @@ import "shared.proto";
|
||||
option swift_prefix = "Sd";
|
||||
option java_multiple_files = true;
|
||||
|
||||
/**
|
||||
* Represents a request to list the models available on the host.
|
||||
*/
|
||||
message ListModelsRequest {}
|
||||
|
||||
/**
|
||||
* Represents a response to listing the models available on the host.
|
||||
*/
|
||||
message ListModelsResponse {
|
||||
/**
|
||||
* The available models on the Stable Diffusion server.
|
||||
*/
|
||||
repeated ModelInfo available_models = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a request to load a model into a specified compute unit.
|
||||
*/
|
||||
@ -49,13 +34,7 @@ message LoadModelResponse {}
|
||||
/**
|
||||
* The model service, for management and loading of models.
|
||||
*/
|
||||
service ModelService {
|
||||
/**
|
||||
* Lists the available models on the host.
|
||||
* This will return both models that are currently loaded, and models that are not yet loaded.
|
||||
*/
|
||||
rpc ListModels(ListModelsRequest) returns (ListModelsResponse);
|
||||
|
||||
service HostModelService {
|
||||
/**
|
||||
* Loads a model onto a compute unit.
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@ enum JobState {
|
||||
/**
|
||||
* The job is in an unknown state.
|
||||
*/
|
||||
unknown = 0;
|
||||
unknown_state = 0;
|
||||
|
||||
/**
|
||||
* The job is queued. It has not started the work.
|
||||
|
30
Common/metadata.proto
Normal file
30
Common/metadata.proto
Normal file
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Server metadata for the Stable Diffusion RPC service.
|
||||
*/
|
||||
syntax = "proto3";
|
||||
package gay.pizza.stable.diffusion;
|
||||
|
||||
/**
|
||||
* Utilize a prefix of 'Sd' for Swift.
|
||||
*/
|
||||
option swift_prefix = "Sd";
|
||||
option java_multiple_files = true;
|
||||
|
||||
enum ServerRole {
|
||||
unknown_role = 0;
|
||||
node = 1;
|
||||
coordinator = 2;
|
||||
}
|
||||
|
||||
message ServerMetadata {
|
||||
ServerRole role = 1;
|
||||
}
|
||||
|
||||
message GetServerMetadataRequest {}
|
||||
message GetServerMetadataResponse {
|
||||
ServerMetadata metadata = 1;
|
||||
}
|
||||
|
||||
service ServerMetadataService {
|
||||
rpc GetServerMetadata(GetServerMetadataRequest) returns (GetServerMetadataResponse);
|
||||
}
|
38
Common/model.proto
Normal file
38
Common/model.proto
Normal file
@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Host management for the Stable Diffusion RPC service.
|
||||
*/
|
||||
syntax = "proto3";
|
||||
package gay.pizza.stable.diffusion;
|
||||
import "shared.proto";
|
||||
|
||||
/**
|
||||
* Utilize a prefix of 'Sd' for Swift.
|
||||
*/
|
||||
option swift_prefix = "Sd";
|
||||
option java_multiple_files = true;
|
||||
|
||||
/**
|
||||
* Represents a request to list the models available on the host.
|
||||
*/
|
||||
message ListModelsRequest {}
|
||||
|
||||
/**
|
||||
* Represents a response to listing the models available on the host.
|
||||
*/
|
||||
message ListModelsResponse {
|
||||
/**
|
||||
* The available models on the Stable Diffusion server.
|
||||
*/
|
||||
repeated ModelInfo available_models = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The model service, for management and loading of models.
|
||||
*/
|
||||
service ModelService {
|
||||
/**
|
||||
* Lists the available models on the host.
|
||||
* This will return both models that are currently loaded, and models that are not yet loaded.
|
||||
*/
|
||||
rpc ListModels(ListModelsRequest) returns (ListModelsResponse);
|
||||
}
|
@ -10,6 +10,21 @@ package gay.pizza.stable.diffusion;
|
||||
option swift_prefix = "Sd";
|
||||
option java_multiple_files = true;
|
||||
|
||||
/**
|
||||
* Represents a 128-bit UUID value.
|
||||
*/
|
||||
message UniqueIdentifier {
|
||||
/**
|
||||
* The upper bits of the UUID.
|
||||
*/
|
||||
uint64 upper_bits = 1;
|
||||
|
||||
/**
|
||||
* The lower bits of the UUID.
|
||||
*/
|
||||
uint64 lower_bits = 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the model attention. Model attention has to do with how the model is encoded, and
|
||||
* can determine what compute units are able to support a particular model.
|
||||
@ -73,9 +88,7 @@ enum ComputeUnits {
|
||||
*/
|
||||
message ModelInfo {
|
||||
/**
|
||||
* The name of the available model. Note that within the context of a single RPC server,
|
||||
* the name of a model is a unique identifier. This may not be true when utilizing a cluster or
|
||||
* load balanced server, so keep that in mind.
|
||||
* The name of the available model. Note that a model name is considered a unique identifier.
|
||||
*/
|
||||
string name = 1;
|
||||
|
||||
@ -85,17 +98,6 @@ message ModelInfo {
|
||||
*/
|
||||
ModelAttention attention = 2;
|
||||
|
||||
/**
|
||||
* Whether the model is currently loaded onto an available compute unit.
|
||||
*/
|
||||
bool is_loaded = 3;
|
||||
|
||||
/**
|
||||
* The compute unit that the model is currently loaded into, if it is loaded to one at all.
|
||||
* When is_loaded is false, the value of this field should be null.
|
||||
*/
|
||||
ComputeUnits loaded_compute_units = 4;
|
||||
|
||||
/**
|
||||
* The compute units that this model supports using.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user