Wan 2.7 Image
This page is generated from the upstream official OpenAPI documentation. Endpoints, parameters and examples match the official docs; brand and API domain are replaced with ModelFold.
Endpoint
POST /jobs/createTask
Full URL: https://ai.modelfold.online/v1/jobs/createTask
Authentication: every request must include the
Authorization: Bearer <API_KEY>header.
Based on wan/2-7-image, image generation and editing are achieved.
Query Task Status
After submitting the task, you can check the progress of the task and obtain the generated results through the unified query endpoint:
- Get Task Details — Learn how to check the task status and obtain the generated results
TIP
In the production environment, it is recommended to use the "callBackUrl" parameter to receive the automatic notification upon completion of the generation, rather than polling the status endpoint.
Related resources
- Market Overview — View all available models
- General API — View account credits and usage
Request Parameters
Body (application/json)
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name for generation tasks. This endpoint currently uses wan/2-7-image. Default:"wan/2-7-image"。 Allowed values:wan/2-7-image。 示例:wan/2-7-image。 |
callBackUrl | string | No | The URL to receive generation task completion updates. Optional but recommended for production use. - System will POST task status and results to this URL when generation completes - Callback includes generated content URLs and task information - Your callback endpoint should accept POST requests with JSON payload containing results - Alternatively, use the Get Task Details endpoint to poll task status - To ensure callback security, see Webhook Verification Guide for signature verification implementation 示例: https://your-domain.com/api/callback。 |
input | object | Yes | Input parameters for the generation task |
input.prompt | string | Yes | Prompt for image generation or editing. This field supports both Chinese and English, with a maximum length of 5000 characters. 示例:Transform the food photo by replacing the marked ingredients with sliced red chili pieces while preserving the bowl, lighting, steam, camera angle, and overall realism.。 |
input.input_urls | array<string> | No | (Optional) Array of input image URLs. |
input.aspect_ratio | string | No | (Optional) Output aspect ratio when no image input is provided. Allowed values:1:1 / 16:9 / 4:3 / 21:9 / 3:4 / 9:16 / 8:1 / 1:8。 示例:1:1。 |
input.enable_sequential | boolean | No | Whether to enable sequential/group image mode. Default is false. Default:false。 示例:false。 |
input.n | integer | No | Number of images to generate. Range is 1-4 when enable_sequential=false (default: 4); range is 1-12 when enable_sequential=true (default: 12). 示例:4。 |
input.resolution | string | No | Output resolution: 1K or 2K (default 2K). For 4K, use wan/2-7-image-pro. Default:"2K"。 Allowed values:1K / 2K。 示例:2K。 |
input.thinking_mode | boolean | No | Whether to enable thinking mode. Only available when enable_sequential=false and input_urls is empty; it is disabled in other cases. Default:false。 示例:false。 |
input.color_palette | array<object> | No | (Optional) Custom color theme. Only available when enable_sequential=false. Requires 3-10 colors, 8 recommended. |
input.color_palette[].hex | string | Yes | HEX color value. 示例:#C2D1E6。 |
input.color_palette[].ratio | string | Yes | Color proportion, format must be xx.xx%. 示例:23.51%。 |
input.bbox_list | array<array<array<integer>>> | No | (Optional) Interactive editing bounding box areas. The outer list length should match input_urls; maximum 2 boxes per image; single box format is [x1, y1, x2, y2]. |
input.watermark | boolean | No | Whether to add watermark. Default:false。 示例:false。 |
input.seed | integer | No | Optional. Omit for a random seed. 示例:0。 |
input.nsfw_checker | boolean | No | Defaults to false. When false, no additional content filtering is applied and results are returned directly by the model. |
Request Example
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
-H "Authorization: Bearer $MODELFOLD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan/2-7-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Transform the food photo by replacing the marked ingredients with sliced red chili pieces in the corresponding positions, while keeping the same bowl, composition, steam, lighting, camera angle, background, texture, and overall realism.",
"input_urls": [
"https://static.aiquickdraw.com/tools/example/1775122744247_eSHwJX1k.jpg"
],
"n": 4,
"enable_sequential": false,
"resolution": "2K",
"thinking_mode": false,
"watermark": false,
"seed": 0,
"bbox_list": [
[]
]
}
}'{
"model": "wan/2-7-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Transform the food photo by replacing the marked ingredients with sliced red chili pieces in the corresponding positions, while keeping the same bowl, composition, steam, lighting, camera angle, background, texture, and overall realism.",
"input_urls": [
"https://static.aiquickdraw.com/tools/example/1775122744247_eSHwJX1k.jpg"
],
"n": 4,
"enable_sequential": false,
"resolution": "2K",
"thinking_mode": false,
"watermark": false,
"seed": 0,
"bbox_list": [
[]
]
}
}Response
200 — Request successful.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying). 可选值:200 / 401 / 402 / 404 / 422 / 429 / 433 / 455 / 500 / 501 / 505。 示例:200。 |
msg | string | 否 | Response message, error description upon failure 示例:success。 |
data | object | 是 | — |
data.taskId | string | 是 | The task ID can be used with the "Get Task Details" endpoint to query the task status. 示例:dc1928bfcbc77cb6c85f3359a9c718b3。 |
{
"code": 200,
"msg": "success",
"data": {
"taskId": "dc1928bfcbc77cb6c85f3359a9c718b3"
}
}500 — Server error.
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 是 | Response status code - 200: Success - Request has been processed successfully - 401: Unauthorized - Authentication credentials are missing or invalid - 402: Insufficient Credits - Account does not have enough credits to perform the operation - 404: Not Found - The requested resource or endpoint does not exist - 408: Timeout - No result has been returned for over 10 minutes. - 422: Validation Error - The request parameters failed validation checks - 429: Rate Limited - Request limit has been exceeded for this resource - 455: Service Unavailable - System is currently undergoing maintenance - 500: Server Error - An unexpected error occurred while processing the request - 501: Generation Failed - Content generation task failed - 505: Feature Disabled - The requested feature is currently disabled |
msg | string | 是 | Response message, error description when failed |
data | object | 是 | — |
{
"code": 500,
"msg": "Server Error - An unexpected error occurred while processing the request",
"data": null
}Callback
onImageGenerated
Callback URL: {$request.body#/callBackUrl} (the callBackUrl in the request body).
Sent when the task succeeds or fails.
Callback body parameters
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | integer | 否 | 200: success. 501: failure; see data.failCode and data.failMsg. Allowed values:200 / 501。 示例:200。 |
msg | string | 否 | Status message 示例:Playground task completed successfully.。 |
data | object | 否 | — |
data.completeTime | integer | 否 | Task completion time, represented as a Unix timestamp in milliseconds 示例:1786436986000。 |
data.costTime | integer | 否 | Processing time in seconds. Present on both success and failure callbacks. 示例:19。 |
data.createTime | integer | 否 | Task creation time, represented as a Unix timestamp in milliseconds 示例:1786436966000。 |
data.creditsConsumed | number | 否 | Credits consumed by the task; 0 for failed tasks. 示例:19.2。 |
data.model | string | 否 | Image editing model used for the task 示例:wan/2-7-image。 |
data.param | string | 否 | Parameters submitted when creating the task, in JSON string format 示例:{"input":"{\"watermark\":false,\"seed\":0,\"thinking_mode\":false,\"bbox_list\":[[]],\"enable_sequential\":false,\"prompt\":\"Transform the food photo by replacing the marked ingredients with sliced red chili pieces in the corresponding positions, while keeping the same bowl, composition, steam, lighting, camera angle, background, texture, and overall realism.\",\"resolution\":\"2K\",\"input_urls\":[\"https://static.aiquickdraw.com/tools/example/1775122744247_eSHwJX1k.jpg\"],\"n\":4}","callBackUrl":"https://your-domain.com/api/callback","model":"wan/2-7-image"}。 |
data.resultJson | string | 否 | Image editing result in JSON string format. resultUrls contains the list of processed image URLs. Present only when state is success. 示例:{"resultUrls":["https://example.com/your-image.png","https://example.com/your-image.png","https://example.com/your-image.png","https://example.com/your-image.png"]}。 |
data.state | string | 否 | Task status Allowed values:success / fail。 示例:success。 |
data.taskId | string | 否 | Task ID 示例:ae9fbfbb1bc08526dde77aaa380d94c1。 |
data.updateTime | integer | 否 | Use completeTime as the completion time; updateTime may equal createTime. 示例:1786436986000。 |
data.failCode | string | 否 | Failure code, a numeric string such as "400" or "500". Present only when state is fail. |
data.failMsg | string | 否 | Failure reason. Present only when state is fail. |
Task completed successfully
{
"code": 200,
"msg": "Playground task completed successfully.",
"data": {
"taskId": "ae9fbfbb1bc08526dde77aaa380d94c1",
"model": "wan/2-7-image",
"state": "success",
"param": "{\"input\":\"{\\\"watermark\\\":false,\\\"seed\\\":0,\\\"thinking_mode\\\":false,\\\"bbox_list\\\":[[]],\\\"enable_sequential\\\":false,\\\"prompt\\\":\\\"Transform the food photo by replacing the marked ingredients with sliced red chili pieces in the corresponding positions, while keeping the same bowl, composition, steam, lighting, camera angle, background, texture, and overall realism.\\\",\\\"resolution\\\":\\\"2K\\\",\\\"input_urls\\\":[\\\"https://static.aiquickdraw.com/tools/example/1775122744247_eSHwJX1k.jpg\\\"],\\\"n\\\":4}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"wan/2-7-image\"}",
"resultJson": "{\"resultUrls\":[\"https://example.com/your-image.png\",\"https://example.com/your-image.png\",\"https://example.com/your-image.png\",\"https://example.com/your-image.png\"]}",
"costTime": 19,
"completeTime": 1786436986000,
"createTime": 1786436966000,
"updateTime": 1786436986000,
"creditsConsumed": 19.2
}
}Task failed
{
"code": 501,
"msg": "Playground task failed.",
"data": {
"taskId": "ae9fbfbb1bc08526dde77aaa380d94c1",
"model": "wan/2-7-image",
"state": "fail",
"param": "{\"input\":\"{\\\"watermark\\\":false,\\\"seed\\\":0,\\\"thinking_mode\\\":false,\\\"bbox_list\\\":[[]],\\\"enable_sequential\\\":false,\\\"prompt\\\":\\\"Transform the food photo by replacing the marked ingredients with sliced red chili pieces in the corresponding positions, while keeping the same bowl, composition, steam, lighting, camera angle, background, texture, and overall realism.\\\",\\\"resolution\\\":\\\"2K\\\",\\\"input_urls\\\":[\\\"https://static.aiquickdraw.com/tools/example/1775122744247_eSHwJX1k.jpg\\\"],\\\"n\\\":4}\",\"callBackUrl\":\"https://your-domain.com/api/callback\",\"model\":\"wan/2-7-image\"}",
"costTime": 19,
"completeTime": 1786436986000,
"createTime": 1786436966000,
"updateTime": 1786436986000,
"creditsConsumed": 0,
"failCode": "500",
"failMsg": "<error detail>"
}
}