Skip to content

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

Request Parameters ​

Body (application/json) ​

ParameterTypeRequiredDescription
modelstringYesModel 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。
callBackUrlstringNoThe 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。
inputobjectYesInput parameters for the generation task
  input.promptstringYesPrompt 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_urlsarray&lt;string&gt;No(Optional) Array of input image URLs.
  input.aspect_ratiostringNo(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_sequentialbooleanNoWhether to enable sequential/group image mode. Default is false. Default:false。 示例:false。
  input.nintegerNoNumber 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.resolutionstringNoOutput resolution: 1K or 2K (default 2K). For 4K, use wan/2-7-image-pro. Default:"2K"。 Allowed values:1K / 2K。 示例:2K。
  input.thinking_modebooleanNoWhether 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_palettearray&lt;object&gt;No(Optional) Custom color theme. Only available when enable_sequential=false. Requires 3-10 colors, 8 recommended.
    input.color_palette[].hexstringYesHEX color value. 示例:#C2D1E6。
    input.color_palette[].ratiostringYesColor proportion, format must be xx.xx%. 示例:23.51%。
  input.bbox_listarray&lt;array&lt;array&lt;integer&gt;&gt;&gt;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.watermarkbooleanNoWhether to add watermark. Default:false。 示例:false。
  input.seedintegerNoOptional. Omit for a random seed. 示例:0。
  input.nsfw_checkerbooleanNoDefaults to false. When false, no additional content filtering is applied and results are returned directly by the model.

Request Example ​

bash
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": [
      []
    ]
  }
}'
json
{
  "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. ​

参数类型必填说明
codeinteger否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。
msgstring否Response message, error description upon failure 示例:success。
dataobject是—
  data.taskIdstring是The task ID can be used with the "Get Task Details" endpoint to query the task status. 示例:dc1928bfcbc77cb6c85f3359a9c718b3。
json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "dc1928bfcbc77cb6c85f3359a9c718b3"
  }
}

500 — Server error. ​

参数类型必填说明
codeinteger是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
msgstring是Response message, error description when failed
dataobject是—
json
{
  "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

参数类型必填说明
codeinteger否200: success. 501: failure; see data.failCode and data.failMsg. Allowed values:200 / 501。 示例:200。
msgstring否Status message 示例:Playground task completed successfully.。
dataobject否—
  data.completeTimeinteger否Task completion time, represented as a Unix timestamp in milliseconds 示例:1786436986000。
  data.costTimeinteger否Processing time in seconds. Present on both success and failure callbacks. 示例:19。
  data.createTimeinteger否Task creation time, represented as a Unix timestamp in milliseconds 示例:1786436966000。
  data.creditsConsumednumber否Credits consumed by the task; 0 for failed tasks. 示例:19.2。
  data.modelstring否Image editing model used for the task 示例:wan/2-7-image。
  data.paramstring否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.resultJsonstring否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.statestring否Task status Allowed values:success / fail。 示例:success。
  data.taskIdstring否Task ID 示例:ae9fbfbb1bc08526dde77aaa380d94c1。
  data.updateTimeinteger否Use completeTime as the completion time; updateTime may equal createTime. 示例:1786436986000。
  data.failCodestring否Failure code, a numeric string such as "400" or "500". Present only when state is fail.
  data.failMsgstring否Failure reason. Present only when state is fail.

Task completed successfully

json
{
  "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

json
{
  "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>"
  }
}

ModelFold — one API for all the best AI models.