Skip to main content

GenerateImageTask

Asynchronously generates an image from text.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.
  • API: The API that you can call to perform the action.
  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.
    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.
  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

aimiaobi:GenerateImageTask

create

*All Resource

*

NoneNone

Request parameters

Parameter

Type

Required

Description

Example

AgentKey

string

Yes

The unique identifier of the workspace. For more information, see AgentKey.

e1be065b-adc3-435e-bd01-1c18c5ed75d3

ParagraphList

array<object>

Yes

The content of the paragraphs.

object

No

Content

string

Yes

The content of the paragraph.

A perpetually sad cat

Id

integer

Yes

The paragraph ID.

1

TaskId

string

No

The unique ID of the task.

By default, you do not need to specify this parameter. The system automatically generates a task ID. If you specify the same TaskId for subsequent tasks, these tasks are considered part of the same conversation group.

e1be065b-adc3-435e-bd01-1c18c5ed75d3

TaskStatus

string

No

The current status of the task.

  • PENDING: The task is in the queue.

  • RUNNING: The task is in progress.

  • SUSPENDED: The task is suspended.

  • SUCCEEDED: The task was successful.

  • FAILED: The task failed.

  • UNKNOWN: The task does not exist or its status is unknown.

SUCCESSED

Style

string

Yes

The style.

Valid values:

  • :

    Portrait photography

  • :

    Default style

  • <3d cartoon> :

    3D cartoon

  • watercolor :

    Watercolor

  • :

    Photography

  • :

    Flat illustration

  • :

    Sketch

  • :

    Oil painting

  • :

    Chinese painting

  • :

    Animation

'

'

Size

string

Yes

The size of the image to generate.

Valid values:

  • 1024*1024 :

    1024*1024

  • 720*1280 :

    720*1280

  • 1280*720 :

    1280*720

1024*1024

ArticleTaskId

string

Yes

The task ID of the article. If you do not have one, you can assign a universally unique identifier (UUID).

e1be065b-adc3-435e-bd01-1c18c5ed75d3

Response elements

Element

Type

Description

Example

object

PlainResult<GenerateImageTaskResponse>

Code

string

The status code.

successful

Data

object

The business data.

TaskList

array<object>

The information about the paragraph tasks. The tasks are associated based on the input paragraph IDs.

object

The paragraph object.

Content

string

The content of the paragraph.

A perpetually sad cat

Id

integer

The paragraph ID.

1

TaskId

string

The unique ID of the task.

e1be065b-adc3-435e-bd01-1c18c5ed75d3

TaskStatus

string

The current status of the task. Valid values: SUCCEEDED, FAILED, CANCELED, PENDING, SUSPENDED, and RUNNING.

SUCCESSED

HttpStatusCode

integer

The HTTP status code.

200

Message

string

The error description.

successful

RequestId

string

The unique ID of the request.

F2F366D6-E9FE-1006-BB70-2C650896AAB5

Success

boolean

Indicates whether the request was successful. true: The request was successful. false: The request failed.

true

Examples

Success response JSON format
{
  "Code": "successful",
  "Data": {
    "TaskList": [
      {
        "Content": "一直忧伤的猫",
        "Id": 1,
        "TaskId": "e1be065b-adc3-435e-bd01-1c18c5ed75d3",
        "TaskStatus": "SUCCESSED"
      }
    ]
  },
  "HttpStatusCode": 200,
  "Message": "successful",
  "RequestId": "F2F366D6-E9FE-1006-BB70-2C650896AAB5",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.
Token Plan
Model Playground
  • 3D model generation
  • Audio generation
Fine-tuning
Model Compression
Statistics and Monitoring
Support