Qwen Image
Overview
Qwen Image is an advanced text-to-image and image-to-image model that offers high-quality image generation with support for various aspect ratios.
Test API KEY: key_00000000000000000000000000000000Endpoints
1. Create Task
Request
POST https://api.pixwith.ai/api/task/createHeaders
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Api-Key | {API_KEY} | Yes |
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | The input prompt (e.g., “a beautiful landscape with mountains”) |
| image_urls | array | Conditional | [“https://cdn.pixwith.ai/xxx.jpg ”]. Required for image-to-image mode. Provide 1 image. |
| model_id | string | Yes | 0-24 |
| options | object | Yes | Configuration options for the task |
| options.prompt_optimization | boolean | Yes | If true, all prompt words will be automatically translated into English. |
| options.num_outputs | int | Yes | Number of images to generate. Valid values: 1, 2, 3, or 4 |
| options.aspect_ratio | string | Conditional | Aspect ratio of the output. Valid values: '3:4', '9:16', '4:3', or '16:9'. Note: This parameter is only allowed for text-to-image mode. Do not include this parameter when using image-to-image mode (when image_urls is provided). |
Example Request - Text-to-Image
{
"prompt": "a beautiful landscape with mountains",
"model_id": "0-24",
"options": {
"prompt_optimization": true,
"num_outputs": 1,
"aspect_ratio": "16:9"
}
}Example Request - Image-to-Image
{
"prompt": "turn this into a watercolor painting",
"image_urls": [
"https://cdn.pixwith.ai/images/cf0ddb5ad6a0f0c85ab4d1dceb9fd89c_0.jpeg"
],
"model_id": "0-24",
"options": {
"prompt_optimization": true,
"num_outputs": 1
}
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | int | 1=success, 0=error |
| message | string | Success and failure messages |
| data | object | |
| data.task_id | string | |
| data.estimated_time | int | Estimated time in seconds |
Response
{
"code": 1,
"message": "success",
"data": {
"task_id": "d425ab4dc256f0ebaa84862b9cea8a3d",
"estimated_time": 15
}
}Last updated on