Create AI Task

Last updated:2026-10-14 17:30:13

Source: 创建AI任务 · Category: Interface — AI Image Generation (接口-AI生图) · Updated 2026-09-22 16:32:14


English Translation

Create AI Task

Submit synthesis and receive the image — save the task ID and receive the image result according to the callback description in this document.

What to prepare before starting?

Prepare your merchant ID, merchant secret key, and the image-generation callback URL. AI uses merchant credentials, not the printer-device key.

AI tasks are asynchronous: after the task ID is returned, wait for the callback to receive the synthesized image, then submit a print task separately. A successful image generation does not automatically complete printing.

Third-party platforms call the Create AI Task interface to submit AI image-generation requests to the Open Platform. The platform synchronously returns the AI task ID (prompt_id) and automatically dispatches it to the device terminal software. Task creation is supported even when the device is offline; once the device comes online it can view and execute the pending generation/print tasks.


Interface Information

Item Value
Endpoint http://www.colorpark.cn/api/ai/run
Method POST

Request Parameters

Parameter Example Value Required Description
partner_id 2025000001 Yes Merchant ID provided by the Open Platform (view in the Open Platform: Merchant Management → My Merchant → Number)
once 8305 Yes Random value used when generating the encrypted signature
time 1646790335 Yes Timestamp used when generating the encrypted signature
sign 9ce3ce7a3fccaf3d7715bd7e9bb1dc1c Yes Signature string obtained from the "Generate Merchant Signature" interface
image http://rfccrm.oss-cn-shenzhen.aliyuncs.com/temp/502707bf1b65e307c43bcb86aa10746a43107961.png Yes Original image URL (the oss_image from the template)
template_id 39 Yes 39 — dual-image (image = uploaded image, scene = scene image); 40 — single-image (image = uploaded image)
scene http://rfccrm.oss-cn-shenzhen.aliyuncs.com/render/2025/11/26/1124014/2d1852e24c659bbaeeca4e44e972426e7448755f.png Yes Scene image URL
callback http://www.abc.com/api/callback Yes Callback URL — the address used by the client's system to receive task-submission notifications
prompt Replace the person in image 1 completely onto the person's position in image 2, keeping image 2's original background, lighting, perspective, and tone unchanged; match the figure's size ratio to the original, blend naturally with no dissonance, realistic details, high-quality compositing, HD, 8K, rich detail, clean edges, unified lighting, natural fusion, professional-grade compositing, flawless. Yes Prompt (in Chinese)
comment 合照 (Group photo) No Third-party style name or remark
app_number 10908002 No Application number of the AI photo device
image_out {"angle":45,"x_scale":1.5,"y_scale":1.5} No Image expansion. Rotate image: {"angle":45,"x_scale":1.5,"y_scale":1.5}; proportional image: {"x_scale":2,"y_scale":2,"best_quality":false,"limit_image_size":true}; expand by specified direction: {"left_offset":200,"right_offset":100,"best_quality":false,"limit_image_size":true}; expand by specified aspect ratio: {"angle":0,"output_ratio":"4:3","best_quality":false,"limit_image_size":true}
width — No Image width, default 1440px
height — No Image height, default 2560px

Recommended Width/Height Pixel Values

Resolution Aspect Ratio Width × Height (px)
2K 1:1 2048 × 2048
2K 4:3 2304 × 1728
2K 3:4 1728 × 2304
2K 16:9 2848 × 1600
2K 9:16 1600 × 2848
2K 3:2 2496 × 1664
2K 2:3 1664 × 2496
2K 21:9 3136 × 1344
3K 1:1 3072 × 3072
3K 4:3 3456 × 2592
3K 3:4 2592 × 3456
3K 16:9 4096 × 2304
3K 9:16 2304 × 4096
3K 2:3 2496 × 3744
3K 3:2 3744 × 2496
3K 21:9 4704 × 2016

Callback Notification

Item Value
Method POST
Headers Content-Type: application/x-www-form-urlencoded

Failure example:

{"status":"fail","prompt_id":10449,"picture":"","message":"Image type error, please check the image type and content"}

Success example:

{"status":"success","prompt_id":11047,"picture":"https://rfccrm.colorpark.cn/colorcloud/ai/406d414e7167a4b09bae92626e3fed6585980d11.png","message":"generated successfully"}

Note: The source success example had a malformed/concatenated URL and trailing "generated/successfully fragments; normalized above to a valid JSON string.

Tips:

  1. template_id=17: AI image expansion — the text parameter may be empty.
  2. If the model is portrait style, the style_index attribute must be passed; otherwise it need not be passed.
  3. Creating an AI task is an asynchronous task; image generation is notified via an asynchronous callback through the callback attribute. Async callback result — headers Content-Type=application/x-www-form-urlencoded, form params: status="success", picture="http://abc.com/xxx.jpeg", prompt_id="xxxxxxxx", message="".

Callback field meanings:

Field Meaning
status Status: queueing — in queue; success — succeeded; fail — failed; cancel — pending cancellation; canceled — canceled
picture Image URL
prompt_id Task ID
message Information hint

Response Result

Note: The source table header repeats "参数名 参数名"; normalized below as Parameter / Example Value / Description.

Parameter Example Value Description
code 0 Result status code — 0 on success, 400 on failure
msg 请求成功 (Request successful) Result description, e.g. "Request successful"
data.prompt_id c20d543a-8c8f-4b55-81da-3c54a5ba93ca AI task ID

If you encounter unsolvable issues while debugging the device, contact the cloud-printing representative for troubleshooting. Contact details: Tel: 137-5177-4454 [WeChat same number] Email: info@ColorPark.cn

UV cloud-printing service provider with deep software-hardware integration ® Ruifengcai