Submit a Task for Other Image Models
1. Endpoint
/api/maas/gw/v1/images/generations
2. Method
POST
3. Request Parameters
Header
| Parameter | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer API key, for example sk-xxxxxxxx |
| Content-Type | string | Yes | application/json |
Body (by model)
model_idis required and must match the corresponding model.
Image-zksa5by1 hidream-tryon-v1
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | Fixed value: Image-zksa5by1 |
| person_image | string | Yes | Person image. Only publicly accessible URLs are supported |
| top_garment_image | string | No | Top garment image. At least one of this field and bottom_garment_image must be provided |
| bottom_garment_image | string | No | Bottom garment image. At least one of this field and top_garment_image must be provided |
| model | string | No | Try-on model version. Option: aitryon-plus. Default: aitryon-plus |
| resolution | int | No | Output resolution control. Options: -1/1024/1280. Default: -1 |
| restore_face | bool | No | Whether to preserve the face from the original image. Default: true |
| notify_url | string | No | Callback URL. Not yet available |
| request_id | string | No | Custom task ID |
Image-eccut7dd hidream-translate-v1
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | Fixed value: Image-eccut7dd |
| image | string | Yes | Image URL to be translated |
| source_lang | string | No | Source language. Supports auto. Default: auto |
| target_lang | string | No | Target language. Default: en, and it must be different from source_lang |
| ext | object | No | Advanced translation settings. See MtImageExt |
| notify_url | string | No | Callback URL. Not yet available |
| request_id | string | No | Custom task ID |
Image-q5580iqf hidream-image-erase-v1
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | Fixed value: Image-q5580iqf |
| prompt | string | Yes | Editing prompt. Length: 1 to 2000 |
| image | string | Yes | Reference image URL |
| mask_image | string | Yes | Reference mask image URL. White areas indicate the editable region, and black areas indicate the preserved region |
| n | int | No | Number of images to generate. Range: [1, 4]. Default: 1 |
| seed | int | No | Random seed. Range: [0, 2147483647]. Default: 123 |
| notify_url | string | No | Callback URL. Not yet available |
| request_id | string | No | Custom task ID |
Image-580g70sx hidream-outpainting-v1
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | Fixed value: Image-580g70sx |
| prompt | string | Yes | Outpainting prompt. Length: 1 to 2000 |
| image | string | Yes | Reference image URL |
| n | int | No | Number of images to generate. Range: [1, 4]. Default: 1 |
| seed | int | No | Random seed. Range: [0, 2147483647]. Default: 123 |
| top_scale | float | No | Top expansion ratio. Range: [1.0, 2.0]. Default: 1.2 |
| bottom_scale | float | No | Bottom expansion ratio. Range: [1.0, 2.0]. Default: 1.2 |
| left_scale | float | No | Left expansion ratio. Range: [1.0, 2.0]. Default: 1.2 |
| right_scale | float | No | Right expansion ratio. Range: [1.0, 2.0]. Default: 1.2 |
| notify_url | string | No | Callback URL. Not yet available |
| request_id | string | No | Custom task ID |
Image-11lqtks8 hidream-superresolution-v1
| Parameter | Type | Required | Description |
|---|---|---|---|
| model_id | string | Yes | Fixed value: Image-11lqtks8 |
| image | string | Yes | Original image to enhance |
| prompt | string | No | Super-resolution prompt. Maximum length: 800. Default: "Image super-resolution, improve clarity and details" |
| n | int | No | Number of images to generate. Range: [1, 4]. Default: 1 |
| seed | int | No | Random seed. Range: [0, 2147483647]. Default: 123 |
| upscale_factor | int | No | Upscaling factor. Options: 1/2/3/4. Default: 2 |
| notify_url | string | No | Callback URL. Not yet available |
| request_id | string | No | Custom task ID |
Object Structure
MtImageExt
| Parameter | Type | Required | Description |
|---|---|---|---|
| domainHint | string | No | Domain hint used to constrain translation style, scenario, and tone. Recommended length: no more than 200 English words |
| sensitives | array | No | Sensitive word list, used to filter exact text matches in the image before translation. Case-sensitive |
| terminologies | array | No | Terminology list. For the element structure, see MtTerminologyItem |
| config | object | No | Additional settings. See MtImageConfig |
MtTerminologyItem
| Parameter | Type | Required | Description |
|---|---|---|---|
| src | string | Yes | Source-language term |
| tgt | string | Yes | Target-language term |
MtImageConfig
| Parameter | Type | Required | Description |
|---|---|---|---|
| imageSegment | bool | No | When true, text on the main subject is not translated; when false, all text in the image is translated |
Response
| Parameter | Type | Required | Description |
|---|---|---|---|
| code | int | Yes | Response code. 0 means success; any non-zero value indicates an error. See message for details |
| message | string | Yes | Response message |
| result | dict | Yes | Returned result |
result
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | str | Yes | Task ID |