Creative poster generation API reference
This topic describes the input and output parameters for the creative poster generation model. The model automatically generates poster backgrounds and text layouts based on your requirements and supports multiple poster styles. You can create stunning designs without any design experience.
Related guide: Creative poster generation
Important
- This document applies only to the China (Beijing) region. You must use an API key from this region.
- The wanx-poster-generation-v1 model is currently available for a free trial only. After you use up the free quota, you can no longer call the model. Paid options are not supported. For an alternative, see Text-to-image.
Model overview
| Model name | Free quota(View) | Billing unit price | Throttling (for Alibaba Cloud accounts and RAM users) | |
| QPS limit for task submission API | Number of simultaneous processing tasks | |||
wanx-poster-generation-v1 | 500 items | Currently available for free trial only.
| 2 | 1 |
Prerequisites
You have obtained and configured an API key and configured the API key as an environment variable.
HTTP call
To reduce wait times and prevent request timeouts, the service is provided asynchronously. You need to make two requests:
- Create a task: Send a request to create a text-to-image task. This request returns a task ID.
- Query the result by task ID: Use the task ID from the previous step to retrieve the result generated by the model.
Step 1: Create a task and get the task ID
POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis
Request headersAuthorization string Required Use your Alibaba Cloud Model Studio API key. You can also use a DashScope API key. Example: Bearer d1xxx2a. X-DashScope-Async string Required Specifies whether to use DashScope asynchronous invocation. HTTP calls only support asynchronous invocation. Set this parameter to Content-Type string Required The content type of the request. The value is fixed to Request bodymodel string Required The model to call. The creative poster generation model is parameters object Required Other model call parameters. Enter a null object. Example: input object Required Enter the basic image information, such as the image URL. | Happy Spring Festival posterReplace |
Responseoutput object The task output information. code string The error code of the API. This parameter is not returned for successful requests. message string The error message of the API. This parameter is not returned for successful requests. request_id string The unique ID of the request. You can use it to trace request details and troubleshoot issues. | |
Step 2: Query the result by task ID
GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}
Request headersAuthorizationstringRequired Use your Alibaba Cloud Model Studio API key. You can also use a DashScope API key. Example: Bearer d1xxx2a. URL path parameterstask_idstringRequired The task ID. | Get task resultReplace |
Responseoutput object The task output information. usage object The usage statistics for the output. request_id string The unique ID of the request. You can use it to trace request details and troubleshoot issues. | |
Error codes
If the model call fails and returns an error message, see Error codes for resolution.
This model also has the following specific error codes:
HTTP status code | API error code (code) | API error message (message) | Description |
|---|---|---|---|
400 | InvalidParameter | check input data style | The input parameters do not meet the requirements. |
500 | InternalError | inference error | Internal algorithm error. |
FAQ
-
How do I query all submitted asynchronous tasks?
For more information, see Manage asynchronous tasks.
-
Does the creative poster generation API support secondary editing of generated posters?
No. You cannot perform secondary editing on the content of a generated poster, such as its title, body text, or style. To change the poster's content, you must generate a new one. You can, however, enhance the resolution of a generated poster by calling this API again.
To enhance the resolution of a generated poster, set the
"generate_mode"input parameter tosrorhrf. Add the"auxiliary_parameters"parameter to the input and set its value to theauxiliary_parametersstring returned from the initial generation request. Keep the other parameters the same.Replace
{WorkspaceId}with your actual workspace ID.
curl --location --request POST 'https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/text2image/image-synthesis' \
--header 'X-DashScope-Async: enable' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data-raw '{
"model":"wanx-poster-generation-v1",
"input": {
"title":"Happy Spring Festival",
"sub_title":"Family reunion, sharing joy",
"body_text":"The Spring Festival is one of the most important traditional festivals in China, symbolizing a new beginning and hope",
"prompt_text_zh":"Lantern, kitten, plum blossom",
"wh_ratios":"Vertical",
"lora_name":"Fairy Tale Oil Painting",
"lora_weight":0.8,
"ctrl_ratio":0.7,
"ctrl_step":0.7,
"generate_mode":"hrf",
"auxiliary_parameters": "WMq4SC4......",
"generate_num":1
},
"parameters":{}
}'

















