task_id upon success.task_id until the status is completed, and obtain the result image URL from output.file_url.Parameter Name | Required | Type | Description |
image_url | Yes | string | Enter the image URL. http(s) public network URLs or data:image/...;base64,... format are supported. Example: https://example.com/a.png |
aspect_ratio | No | string | Target aspect ratio: 1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. |
width | No | integer | Output width in pixels. Use either this parameter or height, or both. |
height | No | integer | Output height in pixels. |
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/image-outpainting' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"image_url": "https://example.com/a.png","aspect_ratio": "16:9"}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/image-outpainting' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"image_url": "https://example.com/a.png","aspect_ratio": "16:9","width": 1920}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/image-outpainting' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"image_url": "https://example.com/a.png","aspect_ratio": "16:9","height": 1080}'
curl -X POST 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/image-outpainting' \\-H 'Authorization: Bearer YOUR_API_KEY' \\-H 'Content-Type: application/json' \\-d '{"image_url": "https://example.com/a.png","image_width": 1920,"height": 1080}'
Parameter Name | Type | Description |
task_id | string | Unique task identifier, used to poll the query API. |
status | string | Task status. |
request_id | string | Unique request identifier. Include it when troubleshooting issues. |
{"task_id": "1400000001-ProcessImageAsync-xxxxxxxx","status": "queued","request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9"}
status is completed or failed.GET https://tokenhub.tencentmaas.com/v1/wand/tool/image-outpainting/tasks/{task_id}Parameter Name | Required | Type | Description |
task_id | Yes | string | Path parameter. Task ID returned by the submission API, which must be passed in as is. |
curl -X GET 'https://tokenhub-intl.tencentcloudmaas.com/v1/wand/tool/image-outpainting/tasks/1400000001-ProcessImageAsync-xxxxxxxx' \\-H 'Authorization: Bearer YOUR_API_KEY'
Parameter Name | Type | Description |
task_id | string | Unique task identifier. |
status | string | Task status: queued / in_progress / completed / failed. |
progress | integer | Processing progress, ranging from 0 to 100. |
output | object | Result product, returned only when completed. |
output.file_url | string | URL of the result image, which can be directly downloaded or accessed. |
error | object | Failure details, returned only when failed. |
error.code | string | Error code. See "Unified error codes". |
error.message | string | Error description, used for troubleshooting and not recommended for program logic judgment. |
request_id | string | Unique request identifier. Include it when troubleshooting issues. |
{"task_id": "1400000001-ProcessImageAsync-xxxxxxxx","status": "completed","progress": 100,"output": {"file_url": "https://XXXXXXX.png"},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
{"task_id": "1400000001-ProcessImageAsync-xxxxxxxx","status": "failed","progress": 100,"error": {"code": "InternalError","message": "internal error"},"request_id": "5c93e410-e024-426a-bb00-839553cb58c9"}
{"request_id": "9f1c0b7e-e024-426a-bb00-839553cb58c9", "error": {"message": "...", "type": "..."}}
HTTP | type | Meaning |
400 | invalid_request_error | Parameter error: image_url is missing or has an invalid format, aspect_ratio or width/height is invalid, JSON decoding failed, task_id has an invalid format, or the task does not exist. Correct the request based on message and retry. |
401 | invalid_api_key | The API Key is missing or invalid. Check the Authorization request header. |
404 | not_found | The request path does not exist. Check the path spelling. |
405 | method_not_allowed | The request method is not allowed. Use POST for submission and GET for query. |
429 | rate_limit_exceeded | QPS rate limiting has been triggered (20 QPS by default for submission and 100 QPS by default for query). Reduce the request frequency and retry. |
429 | quota_exceeded | The quota has been exhausted. Retry later or apply for a quota increase. |
500 | server_error | An internal server error has occurred. You can retry. If the issue persists, submit a ticket with the Request ID for troubleshooting. |
status: failed, and the values of error.code are as follows:Error Code | Meaning |
InvalidParameterValue | The parameter is invalid. Check the input parameters. |
InternalError | An internal server error has occurred. You can retry. If the issue persists, submit a ticket with the Request ID for troubleshooting. |
image_url is a required field. Make sure the field name is spelled image_url and the value is a non-empty string.1:1, 3:2, 2:3, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9. Passing any other value returns 400.aspect_ratio.Esta página foi útil?
Você também pode entrar em contato com a Equipe de vendas ou Enviar um tíquete em caso de ajuda.
comentários