Foundation Models Image Generation API, gRPC: ImageGenerationAsyncService
Статья создана
Обновлена 4 июня 2024 г.
Service for obtaining images from input data.
Call | Description |
---|---|
Generate | A method for generating an image based on a textual description. |
Calls ImageGenerationAsyncService
Generate
A method for generating an image based on a textual description.
rpc Generate (ImageGenerationRequest) returns (operation.Operation)
Response of Operation:
Operation.response:ImageGenerationResponse
ImageGenerationRequest
Field | Description |
---|---|
model_uri | string The ID of the model to be used for image generation. |
messages[] | Message A list of messages representing the context for the image generation model. |
generation_options | ImageGenerationOptions Image generation options. |
Message
Field | Description |
---|---|
text | string Text describing the image. |
weight | double Message weight. Negative values indicate negative messages. |
ImageGenerationOptions
Field | Description |
---|---|
mime_type | string MIME type of generated image format. |
seed | int64 Seed for image generation. |
aspect_ratio | AspectRatio Aspect ratio of generated image. |
AspectRatio
Field | Description |
---|---|
width_ratio | int64 Weight of width in image. |
height_ratio | int64 Weight of height in image. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
ImageGenerationResponse
Field | Description |
---|---|
image | bytes The image is serialized as an array of bytes encoded in base64. |
model_version | string The model version changes with each new releases. |