openapi: 3.0.0 info: title: generation_doc.proto version: version not set tags: - name: GenerationService paths: /grpcgateway/asyncCancel: post: operationId: AsyncCancel responses: '200': description: A successful response. content: application/json: schema: $ref: '#/components/schemas/AsyncCancelAnswer' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Status' requestBody: $ref: '#/components/requestBodies/AsyncHandle' tags: - GenerationService /grpcgateway/asyncGenerate: post: operationId: AsyncGenerate responses: '200': description: A successful response. content: application/json: schema: $ref: '#/components/schemas/AsyncHandle' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Status' requestBody: $ref: '#/components/requestBodies/Request' tags: - GenerationService /grpcgateway/asyncResult: post: operationId: AsyncResult responses: '200': description: A successful response. content: application/json: schema: $ref: '#/components/schemas/AsyncAnswer' default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Status' requestBody: $ref: '#/components/requestBodies/AsyncHandle' tags: - GenerationService /grpcgateway/generate: post: operationId: Generate responses: '200': description: A successful response.(streaming responses) content: application/json: schema: type: object properties: result: $ref: '#/components/schemas/Answer' error: $ref: '#/components/schemas/Status' title: Stream result of Answer default: description: An unexpected error response. content: application/json: schema: $ref: '#/components/schemas/Status' requestBody: $ref: '#/components/requestBodies/Request' tags: - GenerationService components: requestBodies: Request: content: application/json: schema: $ref: '#/components/schemas/Request' description: >- A Request is a set of Artifacts, which can be of any type with model or transform parameters. It is sent to the server, which will respond with an Answer. required: true AsyncHandle: content: application/json: schema: $ref: '#/components/schemas/AsyncHandle' required: true schemas: Answer: type: object properties: answerId: type: string requestId: type: string received: type: string format: uint64 created: type: string format: uint64 meta: $ref: '#/components/schemas/AnswerMeta' artifacts: type: array items: $ref: '#/components/schemas/Artifact' description: >- An Answer is a response to a Request. It is a set of Artifacts, which can be of any type and forwarded to the client or the next stage. AnswerMeta: type: object properties: gpuId: type: string cpuId: type: string nodeId: type: string engineId: type: string description: |- AnswerMeta is a set of metadata about an answer, usually the operating environment. Any: type: object properties: '@type': type: string additionalProperties: {} Artifact: type: object properties: id: type: string format: uint64 type: $ref: '#/components/schemas/ArtifactType' mime: type: string title: MIME type identifier, e.g. "image/png" magic: type: string title: Magic number, e.g. "PNG" binary: type: string format: byte title: Binary data, e.g. PNG image text: type: string title: Text data, e.g. text prompt tokens: $ref: '#/components/schemas/Tokens' tensor: $ref: '#/components/schemas/Tensor' lora: $ref: '#/components/schemas/Lora' index: type: integer format: int64 title: Index of this artifact in input/output list finishReason: $ref: '#/components/schemas/FinishReason' seed: type: integer format: int64 title: Seed used to generate this artifact uuid: type: string title: UUIDv4 of the artifact, used for asset lookup size: type: string format: uint64 title: Size of the artifact in bytes adjustments: type: array items: $ref: '#/components/schemas/ImageAdjustment' title: Adjustments to this image / mask before generation postAdjustments: type: array items: $ref: '#/components/schemas/ImageAdjustment' title: Adjustments to this image / mask after generation description: >- A tangible Artifact, such as an image, video, or text that is used for input or output. ArtifactType: type: string enum: - ARTIFACT_NONE - ARTIFACT_IMAGE - ARTIFACT_VIDEO - ARTIFACT_TEXT - ARTIFACT_TOKENS - ARTIFACT_EMBEDDING - ARTIFACT_CLASSIFICATIONS - ARTIFACT_MASK - ARTIFACT_LATENT - ARTIFACT_TENSOR - ARTIFACT_LORA default: ARTIFACT_NONE AsyncAnswer: type: object properties: answer: type: array items: $ref: '#/components/schemas/Answer' complete: type: boolean status: $ref: '#/components/schemas/AsyncStatus' AsyncCancelAnswer: type: object AsyncHandle: type: object properties: requestId: type: string asyncHandle: type: string AsyncStatus: type: object properties: code: type: integer format: int32 title: The status code, which should be an enum value of google.rpc.Code message: type: string title: Any message title: >- The status of an async job. Mirrors google.rpc.Status but avoids needing to include that file in the repo AttributeType: type: string enum: - AT_PARAMETER - AT_BUFFER default: AT_PARAMETER ChannelSource: type: string enum: - CHANNEL_R - CHANNEL_G - CHANNEL_B - CHANNEL_A - CHANNEL_ZERO - CHANNEL_ONE - CHANNEL_DISCARD default: CHANNEL_R ChurnSettings: type: object properties: churn: type: number format: float churnTmin: type: number format: float churnTmax: type: number format: float CutoutParameters: type: object properties: cutouts: type: array items: $ref: '#/components/schemas/CutoutParameters' title: Nested cutouts, unsupported count: type: integer format: int64 title: 0 to n, usually 8 to 32, 0 inner gray: type: number format: float title: 0.0 to 1.0, defaults to 0.2 blur: type: number format: float title: percentage of cutouts to blur sizePower: type: number format: float title: 'defaults to inner: 0.5, outer: 0.0' DiffusionSampler: type: string enum: - SAMPLER_DDIM - SAMPLER_DDPM - SAMPLER_K_EULER - SAMPLER_K_EULER_ANCESTRAL - SAMPLER_K_HEUN - SAMPLER_K_DPM_2 - SAMPLER_K_DPM_2_ANCESTRAL - SAMPLER_K_LMS - SAMPLER_DPMSOLVERPP_1ORDER - SAMPLER_DPMSOLVERPP_2ORDER - SAMPLER_DPMSOLVERPP_3ORDER - SAMPLER_DPM_FAST - SAMPLER_DPM_ADAPTIVE - SAMPLER_DPMSOLVERPP_2S_ANCESTRAL - SAMPLER_DPMSOLVERPP_SDE - SAMPLER_DPMSOLVERPP_2M default: SAMPLER_DDIM description: >- DiffusionSampler identifies which sampler to use for Diffusion, and represents the internal set of supported samplers. Dtype: type: string enum: - DT_INVALID - DT_FLOAT32 - DT_FLOAT64 - DT_FLOAT16 - DT_BFLOAT16 - DT_COMPLEX32 - DT_COMPLEX64 - DT_COMPLEX128 - DT_UINT8 - DT_INT8 - DT_INT16 - DT_INT32 - DT_INT64 - DT_BOOL - DT_QUINT8 - DT_QINT8 - DT_QINT32 - DT_QUINT4_2 default: DT_INVALID ExtendedParameter: type: object properties: name: type: string float: type: number format: float int: type: string format: uint64 str: type: string ExtendedParameters: type: object properties: parameters: type: array items: $ref: '#/components/schemas/ExtendedParameter' FinishReason: type: string enum: - 'NULL' - LENGTH - STOP - ERROR - FILTER default: 'NULL' GaussianDirection: type: string enum: - DIRECTION_NONE - DIRECTION_UP - DIRECTION_DOWN default: DIRECTION_NONE GuidanceInstanceParameters: type: object properties: models: type: array items: $ref: '#/components/schemas/Model' title: models to use for this set guidanceStrength: type: number format: float title: 0.0 to 1.0, usually 0.05 to 0.225 schedule: type: array items: $ref: '#/components/schemas/GuidanceScheduleParameters' title: when to apply guidance cutouts: $ref: '#/components/schemas/CutoutParameters' prompt: $ref: '#/components/schemas/Prompt' description: >- Parameters that affect the behavior of the guidance, typically used for CLIP. We can specify more than one model, and the guidance will be a weighted sum of the models. GuidanceParameters: type: object properties: guidancePreset: $ref: '#/components/schemas/GuidancePreset' instances: type: array items: $ref: '#/components/schemas/GuidanceInstanceParameters' title: guidance instances description: >- Parameters that affect the behavior of the guidance, typically used for CLIP. The omission of this field implies the default guidance of CFG. GuidancePreset: type: string enum: - GUIDANCE_PRESET_NONE - GUIDANCE_PRESET_SIMPLE - GUIDANCE_PRESET_FAST_BLUE - GUIDANCE_PRESET_FAST_GREEN - GUIDANCE_PRESET_SLOW - GUIDANCE_PRESET_SLOWER - GUIDANCE_PRESET_SLOWEST default: GUIDANCE_PRESET_NONE description: Presets for CLIP guidance. GuidanceScheduleParameters: type: object properties: duration: type: number format: float value: type: number format: float description: >- GuidanceScheduleParameters are used to define a schedule for CLIP guidance, and are used to define the behavior of the guidance over time. They are relative to the total number of steps, and are scaled to the number of steps in the current run. HiresFixParameters: type: object properties: enable: type: boolean title: Should it be enabled at all oosFraction: type: number format: float title: How out-of-square will we allow the fixed area to be, 0...1 description: Parameters that control the hires fix feature. ImageAdjustment: type: object properties: blur: $ref: '#/components/schemas/ImageAdjustment_Gaussian' invert: $ref: '#/components/schemas/ImageAdjustment_Invert' levels: $ref: '#/components/schemas/ImageAdjustment_Levels' channels: $ref: '#/components/schemas/ImageAdjustment_Channels' rescale: $ref: '#/components/schemas/ImageAdjustment_Rescale' crop: $ref: '#/components/schemas/ImageAdjustment_Crop' ImageAdjustment_Channels: type: object properties: r: $ref: '#/components/schemas/ChannelSource' g: $ref: '#/components/schemas/ChannelSource' b: $ref: '#/components/schemas/ChannelSource' a: $ref: '#/components/schemas/ChannelSource' ImageAdjustment_Crop: type: object properties: top: type: string format: uint64 left: type: string format: uint64 width: type: string format: uint64 height: type: string format: uint64 ImageAdjustment_Gaussian: type: object properties: sigma: type: number format: float direction: $ref: '#/components/schemas/GaussianDirection' ImageAdjustment_Invert: type: object ImageAdjustment_Levels: type: object properties: inputLow: type: number format: float inputHigh: type: number format: float outputLow: type: number format: float outputHigh: type: number format: float ImageAdjustment_Rescale: type: object properties: height: type: string format: uint64 width: type: string format: uint64 mode: $ref: '#/components/schemas/RescaleMode' algorithmHint: type: array items: type: string ImageParameters: type: object properties: height: type: string format: uint64 width: type: string format: uint64 seed: type: array items: type: integer format: int64 samples: type: string format: uint64 steps: type: string format: uint64 transform: $ref: '#/components/schemas/TransformType' parameters: type: array items: $ref: '#/components/schemas/StepParameter' extension: $ref: '#/components/schemas/ExtendedParameters' hires: $ref: '#/components/schemas/HiresFixParameters' tiling: type: boolean Lora: type: object properties: target: $ref: '#/components/schemas/LoraTarget' tensors: type: array items: $ref: '#/components/schemas/Tensor' LoraTarget: type: string enum: - LORA_UNET - LORA_TEXT_ENCODER default: LORA_UNET Model: type: object properties: architecture: $ref: '#/components/schemas/ModelArchitecture' publisher: type: string dataset: type: string version: type: number format: float semanticVersion: type: string alias: type: string ModelArchitecture: type: string enum: - MODEL_ARCHITECTURE_NONE - MODEL_ARCHITECTURE_CLIP_VIT - MODEL_ARCHITECTURE_CLIP_RESNET - MODEL_ARCHITECTURE_LDM default: MODEL_ARCHITECTURE_NONE OnStatus: type: object properties: reason: type: array items: $ref: '#/components/schemas/FinishReason' target: type: string action: type: array items: $ref: '#/components/schemas/StageAction' Prompt: type: object properties: parameters: $ref: '#/components/schemas/PromptParameters' text: type: string tokens: $ref: '#/components/schemas/Tokens' artifact: $ref: '#/components/schemas/Artifact' description: >- A Prompt is a special type of Artifact that is used to generate an output. There can be multiple Prompts that affect the same output. Currently, the only Prompts supported are: - Text (singular) - Init Image (singular, optional, type ARTIFACT_IMAGE, with init=true) - Mask (singular, optional, Artifact type ARTIFACT_MASK) . PromptParameters: type: object properties: init: type: boolean weight: type: number format: float description: A set of parameters for each individual Prompt. Request: type: object properties: engineId: type: string requestId: type: string requestedType: $ref: '#/components/schemas/ArtifactType' prompt: type: array items: $ref: '#/components/schemas/Prompt' image: $ref: '#/components/schemas/ImageParameters' description: >- A Request is a set of Artifacts, which can be of any type with model or transform parameters. It is sent to the server, which will respond with an Answer. RescaleMode: type: string enum: - RESCALE_STRICT - RESCALE_CROP - RESCALE_FIT default: RESCALE_STRICT SamplerNoiseType: type: string enum: - SAMPLER_NOISE_NORMAL - SAMPLER_NOISE_BROWNIAN default: SAMPLER_NOISE_NORMAL SamplerParameters: type: object properties: eta: type: number format: float samplingSteps: type: string format: uint64 latentChannels: type: string format: uint64 downsamplingFactor: type: string format: uint64 cfgScale: type: number format: float churn: $ref: '#/components/schemas/ChurnSettings' sigma: $ref: '#/components/schemas/SigmaParameters' noiseType: $ref: '#/components/schemas/SamplerNoiseType' description: >- Parameters that affect the behavior of the sampler, typically used for CFG. ScheduleParameters: type: object properties: start: type: number format: float title: 0.0 to 1.0 end: type: number format: float title: 0.0 to 1.0 value: type: number format: float title: float value to apply on this schedule description: When does this schedule definition apply?. SigmaParameters: type: object properties: sigmaMin: type: number format: float sigmaMax: type: number format: float karrasRho: type: number format: float Stage: type: object properties: id: type: string request: $ref: '#/components/schemas/Request' onStatus: type: array items: $ref: '#/components/schemas/OnStatus' StageAction: type: string enum: - STAGE_ACTION_PASS - STAGE_ACTION_DISCARD - STAGE_ACTION_RETURN default: STAGE_ACTION_PASS Status: type: object properties: code: type: integer format: int32 message: type: string details: type: array items: $ref: '#/components/schemas/Any' StepParameter: type: object properties: scaledStep: type: number format: float sampler: $ref: '#/components/schemas/SamplerParameters' schedule: $ref: '#/components/schemas/ScheduleParameters' guidance: $ref: '#/components/schemas/GuidanceParameters' description: Parameters that apply to this block of the schedule. Tensor: type: object properties: dtype: $ref: '#/components/schemas/Dtype' shape: type: array items: type: string format: int64 data: type: string format: byte attrType: $ref: '#/components/schemas/AttributeType' Token: type: object properties: text: type: string id: type: integer format: int64 description: >- Generally, a GPT BPE 16-bit token, paired with an optional string representation. Tokens: type: object properties: tokens: type: array items: $ref: '#/components/schemas/Token' tokenizerId: type: string description: >- Sequence of tokens, paired with the id of the tokenizer used to generate them. TransformType: type: object properties: diffusion: $ref: '#/components/schemas/DiffusionSampler' upscaler: $ref: '#/components/schemas/Upscaler' Upscaler: type: string enum: - UPSCALER_RGB - UPSCALER_GFPGAN - UPSCALER_ESRGAN default: UPSCALER_RGB description: Future, unimplemented.