2023-04-22 14:52:27 -07:00
|
|
|
// DO NOT EDIT.
|
|
|
|
// swift-format-ignore-file
|
|
|
|
//
|
|
|
|
// Generated by the Swift generator plugin for the protocol buffer compiler.
|
|
|
|
// Source: StableDiffusion.proto
|
|
|
|
//
|
|
|
|
// For information on using the generated types, please see the documentation:
|
|
|
|
// https://github.com/apple/swift-protobuf/
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Stable Diffusion RPC service for Apple Platforms.
|
|
|
|
|
2023-04-22 14:52:27 -07:00
|
|
|
import Foundation
|
|
|
|
import SwiftProtobuf
|
|
|
|
|
|
|
|
// If the compiler emits an error on this type, it is because this file
|
|
|
|
// was generated by a version of the `protoc` Swift plug-in that is
|
|
|
|
// incompatible with the version of SwiftProtobuf to which you are linking.
|
|
|
|
// Please ensure that you are building against the same version of the API
|
|
|
|
// that was used to generate this file.
|
|
|
|
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
|
|
|
|
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
|
|
|
|
typealias Version = _2
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// 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.
|
|
|
|
public enum SdModelAttention: SwiftProtobuf.Enum {
|
|
|
|
public typealias RawValue = Int
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// The model is an original attention type. It can be loaded only onto CPU & GPU compute units.
|
|
|
|
case original // = 0
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// The model is a split-ein-sum attention type. It can be loaded onto all compute units,
|
|
|
|
/// including the Apple Neural Engine.
|
|
|
|
case splitEinSum // = 1
|
|
|
|
case UNRECOGNIZED(Int)
|
|
|
|
|
|
|
|
public init() {
|
|
|
|
self = .original
|
|
|
|
}
|
|
|
|
|
|
|
|
public init?(rawValue: Int) {
|
|
|
|
switch rawValue {
|
|
|
|
case 0: self = .original
|
|
|
|
case 1: self = .splitEinSum
|
|
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public var rawValue: Int {
|
|
|
|
switch self {
|
|
|
|
case .original: return 0
|
|
|
|
case .splitEinSum: return 1
|
|
|
|
case .UNRECOGNIZED(let i): return i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#if swift(>=4.2)
|
|
|
|
|
|
|
|
extension SdModelAttention: CaseIterable {
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
|
|
public static var allCases: [SdModelAttention] = [
|
|
|
|
.original,
|
|
|
|
.splitEinSum,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // swift(>=4.2)
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// Represents the schedulers that are used to sample images.
|
2023-04-22 14:52:27 -07:00
|
|
|
public enum SdScheduler: SwiftProtobuf.Enum {
|
|
|
|
public typealias RawValue = Int
|
2023-04-23 02:09:50 -07:00
|
|
|
|
|
|
|
///*
|
|
|
|
/// The PNDM (Pseudo numerical methods for diffusion models) scheduler.
|
2023-04-22 14:52:27 -07:00
|
|
|
case pndm // = 0
|
2023-04-23 02:09:50 -07:00
|
|
|
|
|
|
|
///*
|
|
|
|
/// The DPM-Solver++ scheduler.
|
2023-04-22 14:52:27 -07:00
|
|
|
case dpmSolverPlusPlus // = 1
|
|
|
|
case UNRECOGNIZED(Int)
|
|
|
|
|
|
|
|
public init() {
|
|
|
|
self = .pndm
|
|
|
|
}
|
|
|
|
|
|
|
|
public init?(rawValue: Int) {
|
|
|
|
switch rawValue {
|
|
|
|
case 0: self = .pndm
|
|
|
|
case 1: self = .dpmSolverPlusPlus
|
|
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public var rawValue: Int {
|
|
|
|
switch self {
|
|
|
|
case .pndm: return 0
|
|
|
|
case .dpmSolverPlusPlus: return 1
|
|
|
|
case .UNRECOGNIZED(let i): return i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#if swift(>=4.2)
|
|
|
|
|
|
|
|
extension SdScheduler: CaseIterable {
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
|
|
public static var allCases: [SdScheduler] = [
|
|
|
|
.pndm,
|
|
|
|
.dpmSolverPlusPlus,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // swift(>=4.2)
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents a specifier for what compute units are available for ML tasks.
|
2023-04-22 14:52:27 -07:00
|
|
|
public enum SdComputeUnits: SwiftProtobuf.Enum {
|
|
|
|
public typealias RawValue = Int
|
2023-04-23 02:09:50 -07:00
|
|
|
|
|
|
|
///*
|
|
|
|
/// The CPU as a singular compute unit.
|
2023-04-22 14:52:27 -07:00
|
|
|
case cpu // = 0
|
2023-04-23 02:09:50 -07:00
|
|
|
|
|
|
|
///*
|
|
|
|
/// The CPU & GPU combined into a singular compute unit.
|
2023-04-22 14:52:27 -07:00
|
|
|
case cpuAndGpu // = 1
|
2023-04-23 02:09:50 -07:00
|
|
|
|
|
|
|
///*
|
|
|
|
/// Allow the usage of all compute units. CoreML will decided where the model is loaded.
|
2023-04-22 14:52:27 -07:00
|
|
|
case all // = 2
|
2023-04-23 02:09:50 -07:00
|
|
|
|
|
|
|
///*
|
|
|
|
/// The CPU & Neural Engine combined into a singular compute unit.
|
2023-04-22 14:52:27 -07:00
|
|
|
case cpuAndNeuralEngine // = 3
|
|
|
|
case UNRECOGNIZED(Int)
|
|
|
|
|
|
|
|
public init() {
|
|
|
|
self = .cpu
|
|
|
|
}
|
|
|
|
|
|
|
|
public init?(rawValue: Int) {
|
|
|
|
switch rawValue {
|
|
|
|
case 0: self = .cpu
|
|
|
|
case 1: self = .cpuAndGpu
|
|
|
|
case 2: self = .all
|
|
|
|
case 3: self = .cpuAndNeuralEngine
|
|
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public var rawValue: Int {
|
|
|
|
switch self {
|
|
|
|
case .cpu: return 0
|
|
|
|
case .cpuAndGpu: return 1
|
|
|
|
case .all: return 2
|
|
|
|
case .cpuAndNeuralEngine: return 3
|
|
|
|
case .UNRECOGNIZED(let i): return i
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#if swift(>=4.2)
|
|
|
|
|
|
|
|
extension SdComputeUnits: CaseIterable {
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
|
|
public static var allCases: [SdComputeUnits] = [
|
|
|
|
.cpu,
|
|
|
|
.cpuAndGpu,
|
|
|
|
.all,
|
|
|
|
.cpuAndNeuralEngine,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // swift(>=4.2)
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents the format of an image.
|
|
|
|
public enum SdImageFormat: SwiftProtobuf.Enum {
|
|
|
|
public typealias RawValue = Int
|
2023-04-22 14:52:27 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The PNG image format.
|
|
|
|
case png // = 0
|
|
|
|
case UNRECOGNIZED(Int)
|
2023-04-22 14:52:27 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
public init() {
|
|
|
|
self = .png
|
|
|
|
}
|
2023-04-22 14:52:27 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
public init?(rawValue: Int) {
|
|
|
|
switch rawValue {
|
|
|
|
case 0: self = .png
|
|
|
|
default: self = .UNRECOGNIZED(rawValue)
|
|
|
|
}
|
|
|
|
}
|
2023-04-22 16:32:54 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
public var rawValue: Int {
|
|
|
|
switch self {
|
|
|
|
case .png: return 0
|
|
|
|
case .UNRECOGNIZED(let i): return i
|
|
|
|
}
|
|
|
|
}
|
2023-04-22 14:52:27 -07:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
#if swift(>=4.2)
|
|
|
|
|
|
|
|
extension SdImageFormat: CaseIterable {
|
|
|
|
// The compiler won't synthesize support with the UNRECOGNIZED case.
|
|
|
|
public static var allCases: [SdImageFormat] = [
|
|
|
|
.png,
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // swift(>=4.2)
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// Represents information about an available model.
|
|
|
|
/// The primary key of a model is it's 'name' field.
|
|
|
|
public struct SdModelInfo {
|
2023-04-22 14:52:27 -07:00
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// 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.
|
|
|
|
public var name: String = String()
|
2023-04-22 14:52:27 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The attention of the model. Model attention determines what compute units can be used to
|
|
|
|
/// load the model and make predictions.
|
|
|
|
public var attention: SdModelAttention = .original
|
2023-04-22 14:52:27 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Whether the model is currently loaded onto an available compute unit.
|
|
|
|
public var isLoaded: Bool = false
|
2023-04-22 14:52:27 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// 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.
|
|
|
|
public var loadedComputeUnits: SdComputeUnits = .cpu
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// The compute units that this model supports using.
|
|
|
|
public var supportedComputeUnits: [SdComputeUnits] = []
|
2023-04-22 14:52:27 -07:00
|
|
|
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents an image within the Stable Diffusion context.
|
|
|
|
/// This could be an input image for an image generation request, or it could be
|
|
|
|
/// a generated image from the Stable Diffusion model.
|
|
|
|
public struct SdImage {
|
2023-04-22 14:52:27 -07:00
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The format of the image.
|
|
|
|
public var format: SdImageFormat = .png
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// The raw data of the image, in the specified format.
|
|
|
|
public var data: Data = Data()
|
2023-04-22 14:52:27 -07:00
|
|
|
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents a request to list the models available on the host.
|
|
|
|
public struct SdListModelsRequest {
|
2023-04-22 14:52:27 -07:00
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents a response to listing the models available on the host.
|
|
|
|
public struct SdListModelsResponse {
|
2023-04-22 14:52:27 -07:00
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The available models on the Stable Diffusion server.
|
|
|
|
public var availableModels: [SdModelInfo] = []
|
|
|
|
|
2023-04-22 14:52:27 -07:00
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents a request to load a model into a specified compute unit.
|
2023-04-22 14:52:27 -07:00
|
|
|
public struct SdLoadModelRequest {
|
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The model name to load onto the compute unit.
|
2023-04-22 14:52:27 -07:00
|
|
|
public var modelName: String = String()
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The compute units to load the model onto.
|
2023-04-22 14:52:27 -07:00
|
|
|
public var computeUnits: SdComputeUnits = .cpu
|
|
|
|
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents a response to loading a model.
|
2023-04-22 14:52:27 -07:00
|
|
|
public struct SdLoadModelResponse {
|
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents a request to generate images using a loaded model.
|
2023-04-22 14:52:27 -07:00
|
|
|
public struct SdGenerateImagesRequest {
|
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The model name to use for generation.
|
|
|
|
/// The model must be already be loaded using ModelService.LoadModel RPC method.
|
2023-04-22 14:52:27 -07:00
|
|
|
public var modelName: String = String()
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The output format for generated images.
|
|
|
|
public var outputImageFormat: SdImageFormat = .png
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// The number of batches of images to generate.
|
|
|
|
public var batchCount: UInt32 = 0
|
2023-04-22 14:52:27 -07:00
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The number of images inside a single batch.
|
|
|
|
public var batchSize: UInt32 = 0
|
|
|
|
|
|
|
|
///*
|
|
|
|
/// The positive textual prompt for image generation.
|
2023-04-22 14:52:27 -07:00
|
|
|
public var prompt: String = String()
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The negative prompt for image generation.
|
2023-04-22 14:52:27 -07:00
|
|
|
public var negativePrompt: String = String()
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The random seed to use.
|
|
|
|
/// Zero indicates that the seed should be random.
|
|
|
|
public var seed: UInt32 = 0
|
|
|
|
|
2023-04-22 14:52:27 -07:00
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// Represents the response from image generation.
|
2023-04-22 14:52:27 -07:00
|
|
|
public struct SdGenerateImagesResponse {
|
|
|
|
// SwiftProtobuf.Message conformance is added in an extension below. See the
|
|
|
|
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
|
|
|
|
// methods supported on all messages.
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The set of generated images by the Stable Diffusion pipeline.
|
2023-04-22 14:52:27 -07:00
|
|
|
public var images: [SdImage] = []
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
///*
|
|
|
|
/// The seeds that were used to generate the images.
|
|
|
|
public var seeds: [UInt32] = []
|
|
|
|
|
2023-04-22 14:52:27 -07:00
|
|
|
public var unknownFields = SwiftProtobuf.UnknownStorage()
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#if swift(>=5.5) && canImport(_Concurrency)
|
2023-04-23 02:09:50 -07:00
|
|
|
extension SdModelAttention: @unchecked Sendable {}
|
2023-04-22 14:52:27 -07:00
|
|
|
extension SdScheduler: @unchecked Sendable {}
|
|
|
|
extension SdComputeUnits: @unchecked Sendable {}
|
2023-04-23 02:09:50 -07:00
|
|
|
extension SdImageFormat: @unchecked Sendable {}
|
2023-04-22 14:52:27 -07:00
|
|
|
extension SdModelInfo: @unchecked Sendable {}
|
|
|
|
extension SdImage: @unchecked Sendable {}
|
|
|
|
extension SdListModelsRequest: @unchecked Sendable {}
|
|
|
|
extension SdListModelsResponse: @unchecked Sendable {}
|
|
|
|
extension SdLoadModelRequest: @unchecked Sendable {}
|
|
|
|
extension SdLoadModelResponse: @unchecked Sendable {}
|
|
|
|
extension SdGenerateImagesRequest: @unchecked Sendable {}
|
|
|
|
extension SdGenerateImagesResponse: @unchecked Sendable {}
|
|
|
|
#endif // swift(>=5.5) && canImport(_Concurrency)
|
|
|
|
|
|
|
|
// MARK: - Code below here is support for the SwiftProtobuf runtime.
|
|
|
|
|
|
|
|
fileprivate let _protobuf_package = "gay.pizza.stable.diffusion"
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
extension SdModelAttention: SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
0: .same(proto: "original"),
|
|
|
|
1: .same(proto: "split_ein_sum"),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-04-22 14:52:27 -07:00
|
|
|
extension SdScheduler: SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
0: .same(proto: "pndm"),
|
2023-04-23 02:09:50 -07:00
|
|
|
1: .same(proto: "dpm_solver_plus_plus"),
|
2023-04-22 14:52:27 -07:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdComputeUnits: SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
0: .same(proto: "cpu"),
|
|
|
|
1: .same(proto: "cpu_and_gpu"),
|
|
|
|
2: .same(proto: "all"),
|
|
|
|
3: .same(proto: "cpu_and_neural_engine"),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-04-23 02:09:50 -07:00
|
|
|
extension SdImageFormat: SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
0: .same(proto: "png"),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2023-04-22 14:52:27 -07:00
|
|
|
extension SdModelInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".ModelInfo"
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
1: .same(proto: "name"),
|
|
|
|
2: .same(proto: "attention"),
|
2023-04-22 16:32:54 -07:00
|
|
|
3: .standard(proto: "is_loaded"),
|
2023-04-23 02:09:50 -07:00
|
|
|
4: .standard(proto: "loaded_compute_units"),
|
|
|
|
5: .standard(proto: "supported_compute_units"),
|
2023-04-22 14:52:27 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
|
|
// allocates stack space for every case branch when no optimizations are
|
|
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
|
|
switch fieldNumber {
|
|
|
|
case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
|
2023-04-23 02:09:50 -07:00
|
|
|
case 2: try { try decoder.decodeSingularEnumField(value: &self.attention) }()
|
2023-04-22 16:32:54 -07:00
|
|
|
case 3: try { try decoder.decodeSingularBoolField(value: &self.isLoaded) }()
|
2023-04-23 02:09:50 -07:00
|
|
|
case 4: try { try decoder.decodeSingularEnumField(value: &self.loadedComputeUnits) }()
|
|
|
|
case 5: try { try decoder.decodeRepeatedEnumField(value: &self.supportedComputeUnits) }()
|
2023-04-22 14:52:27 -07:00
|
|
|
default: break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
|
|
if !self.name.isEmpty {
|
|
|
|
try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
|
|
|
|
}
|
2023-04-23 02:09:50 -07:00
|
|
|
if self.attention != .original {
|
|
|
|
try visitor.visitSingularEnumField(value: self.attention, fieldNumber: 2)
|
2023-04-22 14:52:27 -07:00
|
|
|
}
|
2023-04-22 16:32:54 -07:00
|
|
|
if self.isLoaded != false {
|
|
|
|
try visitor.visitSingularBoolField(value: self.isLoaded, fieldNumber: 3)
|
|
|
|
}
|
2023-04-23 02:09:50 -07:00
|
|
|
if self.loadedComputeUnits != .cpu {
|
|
|
|
try visitor.visitSingularEnumField(value: self.loadedComputeUnits, fieldNumber: 4)
|
|
|
|
}
|
|
|
|
if !self.supportedComputeUnits.isEmpty {
|
|
|
|
try visitor.visitPackedEnumField(value: self.supportedComputeUnits, fieldNumber: 5)
|
|
|
|
}
|
2023-04-22 14:52:27 -07:00
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdModelInfo, rhs: SdModelInfo) -> Bool {
|
|
|
|
if lhs.name != rhs.name {return false}
|
|
|
|
if lhs.attention != rhs.attention {return false}
|
2023-04-22 16:32:54 -07:00
|
|
|
if lhs.isLoaded != rhs.isLoaded {return false}
|
2023-04-23 02:09:50 -07:00
|
|
|
if lhs.loadedComputeUnits != rhs.loadedComputeUnits {return false}
|
|
|
|
if lhs.supportedComputeUnits != rhs.supportedComputeUnits {return false}
|
2023-04-22 14:52:27 -07:00
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdImage: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".Image"
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
2023-04-23 02:09:50 -07:00
|
|
|
1: .same(proto: "format"),
|
|
|
|
2: .same(proto: "data"),
|
2023-04-22 14:52:27 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
|
|
// allocates stack space for every case branch when no optimizations are
|
|
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
|
|
switch fieldNumber {
|
2023-04-23 02:09:50 -07:00
|
|
|
case 1: try { try decoder.decodeSingularEnumField(value: &self.format) }()
|
|
|
|
case 2: try { try decoder.decodeSingularBytesField(value: &self.data) }()
|
2023-04-22 14:52:27 -07:00
|
|
|
default: break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
2023-04-23 02:09:50 -07:00
|
|
|
if self.format != .png {
|
|
|
|
try visitor.visitSingularEnumField(value: self.format, fieldNumber: 1)
|
|
|
|
}
|
|
|
|
if !self.data.isEmpty {
|
|
|
|
try visitor.visitSingularBytesField(value: self.data, fieldNumber: 2)
|
2023-04-22 14:52:27 -07:00
|
|
|
}
|
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdImage, rhs: SdImage) -> Bool {
|
2023-04-23 02:09:50 -07:00
|
|
|
if lhs.format != rhs.format {return false}
|
|
|
|
if lhs.data != rhs.data {return false}
|
2023-04-22 14:52:27 -07:00
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdListModelsRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".ListModelsRequest"
|
|
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let _ = try decoder.nextFieldNumber() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdListModelsRequest, rhs: SdListModelsRequest) -> Bool {
|
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdListModelsResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".ListModelsResponse"
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
2023-04-23 02:09:50 -07:00
|
|
|
1: .standard(proto: "available_models"),
|
2023-04-22 14:52:27 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
|
|
// allocates stack space for every case branch when no optimizations are
|
|
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
|
|
switch fieldNumber {
|
2023-04-23 02:09:50 -07:00
|
|
|
case 1: try { try decoder.decodeRepeatedMessageField(value: &self.availableModels) }()
|
2023-04-22 14:52:27 -07:00
|
|
|
default: break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
2023-04-23 02:09:50 -07:00
|
|
|
if !self.availableModels.isEmpty {
|
|
|
|
try visitor.visitRepeatedMessageField(value: self.availableModels, fieldNumber: 1)
|
2023-04-22 14:52:27 -07:00
|
|
|
}
|
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdListModelsResponse, rhs: SdListModelsResponse) -> Bool {
|
2023-04-23 02:09:50 -07:00
|
|
|
if lhs.availableModels != rhs.availableModels {return false}
|
2023-04-22 14:52:27 -07:00
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdLoadModelRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".LoadModelRequest"
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
1: .standard(proto: "model_name"),
|
|
|
|
2: .standard(proto: "compute_units"),
|
|
|
|
]
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
|
|
// allocates stack space for every case branch when no optimizations are
|
|
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
|
|
switch fieldNumber {
|
|
|
|
case 1: try { try decoder.decodeSingularStringField(value: &self.modelName) }()
|
|
|
|
case 2: try { try decoder.decodeSingularEnumField(value: &self.computeUnits) }()
|
|
|
|
default: break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
|
|
if !self.modelName.isEmpty {
|
|
|
|
try visitor.visitSingularStringField(value: self.modelName, fieldNumber: 1)
|
|
|
|
}
|
|
|
|
if self.computeUnits != .cpu {
|
|
|
|
try visitor.visitSingularEnumField(value: self.computeUnits, fieldNumber: 2)
|
|
|
|
}
|
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdLoadModelRequest, rhs: SdLoadModelRequest) -> Bool {
|
|
|
|
if lhs.modelName != rhs.modelName {return false}
|
|
|
|
if lhs.computeUnits != rhs.computeUnits {return false}
|
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdLoadModelResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".LoadModelResponse"
|
|
|
|
public static let _protobuf_nameMap = SwiftProtobuf._NameMap()
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let _ = try decoder.nextFieldNumber() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdLoadModelResponse, rhs: SdLoadModelResponse) -> Bool {
|
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdGenerateImagesRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".GenerateImagesRequest"
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
1: .standard(proto: "model_name"),
|
2023-04-23 02:09:50 -07:00
|
|
|
2: .standard(proto: "output_image_format"),
|
|
|
|
3: .standard(proto: "batch_count"),
|
|
|
|
4: .standard(proto: "batch_size"),
|
|
|
|
5: .same(proto: "prompt"),
|
|
|
|
6: .standard(proto: "negative_prompt"),
|
|
|
|
7: .same(proto: "seed"),
|
2023-04-22 14:52:27 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
|
|
// allocates stack space for every case branch when no optimizations are
|
|
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
|
|
switch fieldNumber {
|
|
|
|
case 1: try { try decoder.decodeSingularStringField(value: &self.modelName) }()
|
2023-04-23 02:09:50 -07:00
|
|
|
case 2: try { try decoder.decodeSingularEnumField(value: &self.outputImageFormat) }()
|
|
|
|
case 3: try { try decoder.decodeSingularUInt32Field(value: &self.batchCount) }()
|
|
|
|
case 4: try { try decoder.decodeSingularUInt32Field(value: &self.batchSize) }()
|
|
|
|
case 5: try { try decoder.decodeSingularStringField(value: &self.prompt) }()
|
|
|
|
case 6: try { try decoder.decodeSingularStringField(value: &self.negativePrompt) }()
|
|
|
|
case 7: try { try decoder.decodeSingularUInt32Field(value: &self.seed) }()
|
2023-04-22 14:52:27 -07:00
|
|
|
default: break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
|
|
if !self.modelName.isEmpty {
|
|
|
|
try visitor.visitSingularStringField(value: self.modelName, fieldNumber: 1)
|
|
|
|
}
|
2023-04-23 02:09:50 -07:00
|
|
|
if self.outputImageFormat != .png {
|
|
|
|
try visitor.visitSingularEnumField(value: self.outputImageFormat, fieldNumber: 2)
|
|
|
|
}
|
|
|
|
if self.batchCount != 0 {
|
|
|
|
try visitor.visitSingularUInt32Field(value: self.batchCount, fieldNumber: 3)
|
|
|
|
}
|
|
|
|
if self.batchSize != 0 {
|
|
|
|
try visitor.visitSingularUInt32Field(value: self.batchSize, fieldNumber: 4)
|
2023-04-22 14:52:27 -07:00
|
|
|
}
|
|
|
|
if !self.prompt.isEmpty {
|
2023-04-23 02:09:50 -07:00
|
|
|
try visitor.visitSingularStringField(value: self.prompt, fieldNumber: 5)
|
2023-04-22 14:52:27 -07:00
|
|
|
}
|
|
|
|
if !self.negativePrompt.isEmpty {
|
2023-04-23 02:09:50 -07:00
|
|
|
try visitor.visitSingularStringField(value: self.negativePrompt, fieldNumber: 6)
|
|
|
|
}
|
|
|
|
if self.seed != 0 {
|
|
|
|
try visitor.visitSingularUInt32Field(value: self.seed, fieldNumber: 7)
|
2023-04-22 14:52:27 -07:00
|
|
|
}
|
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdGenerateImagesRequest, rhs: SdGenerateImagesRequest) -> Bool {
|
|
|
|
if lhs.modelName != rhs.modelName {return false}
|
2023-04-23 02:09:50 -07:00
|
|
|
if lhs.outputImageFormat != rhs.outputImageFormat {return false}
|
|
|
|
if lhs.batchCount != rhs.batchCount {return false}
|
|
|
|
if lhs.batchSize != rhs.batchSize {return false}
|
2023-04-22 14:52:27 -07:00
|
|
|
if lhs.prompt != rhs.prompt {return false}
|
|
|
|
if lhs.negativePrompt != rhs.negativePrompt {return false}
|
2023-04-23 02:09:50 -07:00
|
|
|
if lhs.seed != rhs.seed {return false}
|
2023-04-22 14:52:27 -07:00
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
extension SdGenerateImagesResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
|
|
|
|
public static let protoMessageName: String = _protobuf_package + ".GenerateImagesResponse"
|
|
|
|
public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
|
|
|
|
1: .same(proto: "images"),
|
2023-04-23 02:09:50 -07:00
|
|
|
2: .same(proto: "seeds"),
|
2023-04-22 14:52:27 -07:00
|
|
|
]
|
|
|
|
|
|
|
|
public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
|
|
|
|
while let fieldNumber = try decoder.nextFieldNumber() {
|
|
|
|
// The use of inline closures is to circumvent an issue where the compiler
|
|
|
|
// allocates stack space for every case branch when no optimizations are
|
|
|
|
// enabled. https://github.com/apple/swift-protobuf/issues/1034
|
|
|
|
switch fieldNumber {
|
|
|
|
case 1: try { try decoder.decodeRepeatedMessageField(value: &self.images) }()
|
2023-04-23 02:09:50 -07:00
|
|
|
case 2: try { try decoder.decodeRepeatedUInt32Field(value: &self.seeds) }()
|
2023-04-22 14:52:27 -07:00
|
|
|
default: break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
|
|
|
|
if !self.images.isEmpty {
|
|
|
|
try visitor.visitRepeatedMessageField(value: self.images, fieldNumber: 1)
|
|
|
|
}
|
2023-04-23 02:09:50 -07:00
|
|
|
if !self.seeds.isEmpty {
|
|
|
|
try visitor.visitPackedUInt32Field(value: self.seeds, fieldNumber: 2)
|
|
|
|
}
|
2023-04-22 14:52:27 -07:00
|
|
|
try unknownFields.traverse(visitor: &visitor)
|
|
|
|
}
|
|
|
|
|
|
|
|
public static func ==(lhs: SdGenerateImagesResponse, rhs: SdGenerateImagesResponse) -> Bool {
|
|
|
|
if lhs.images != rhs.images {return false}
|
2023-04-23 02:09:50 -07:00
|
|
|
if lhs.seeds != rhs.seeds {return false}
|
2023-04-22 14:52:27 -07:00
|
|
|
if lhs.unknownFields != rhs.unknownFields {return false}
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
}
|