- 執行用於影像轉影像的 AI 文字生成圖片任務 V2。
AI 任務是非同步的。當功能支援 webhook 時,請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章,並在收到 success 或 error 通知後,使用收到的 task_id 查詢任務結果。設定與驗證細節請見 webhook 整合指南。
若您的整合不支援 webhook 或無法使用 webhook,請實作輪詢。送出 AI 任務後,以固定間隔(例如每 10 秒)輪詢狀態端點,直到任務狀態為 success 或 error。
描述您希望生成影像中具備的元素與視覺特徵的影像編輯指示(正面提示)。
此參數支援中文與英文,最大長度為 800 個字元。每個中文字或英文字母都計為一個字元。
負面提示,描述您不希望出現在生成影像中的內容。
此參數支援中文與英文,最大長度為 500 個字元。每個中文字或英文字母都計為一個字元。
以 width*height 格式指定輸出影像的解析度,例如 "1024*1536"。
- 寬與高都必須落在 [512, 2048] 像素的範圍內。
- 預設總像素數約為 1024*1024,長寬比與輸入圖片(或多張圖片請求中的最後一張)相近。
當您指定 size 參數時,系統會以 size 指定的寬與高為目標,並將實際輸出影像的寬與高調整為最接近的 16 的倍數。例如,若指定 1033*1032,輸出影像尺寸為 1040*1024。
常見長寬比的建議解析度:
- 1:1:1024*1024、1536*1536
- 2:3:768*1152、1024*1536
- 3:2:1152*768、1536*1024
- 3:4:960*1280、1080*1440
- 4:3:1280*960、1440*1080
- 9:16:720*1280、1080*1920
- 16:9:1280*720、1920*1080
- 21:9:1344*576、2048*872
啟用智慧提示改寫。模型會最佳化正面提示。不會影響負面提示。
| Enum Value | Description |
|---|---|
| true | Enables rewriting. Use this for more diverse image content; the model adds details. |
| false | Disables rewriting. Use this for tighter control over image details. |
- https://yce-api-01.makeupar.comhttps://yce-api-01.makeupar.com/s2s/v2.0/task/image-to-image/youcam
curl -i -X POST \
https://yce-api-01.makeupar.com/s2s/v2.0/task/image-to-image/youcam \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"src_file_urls": [
"https://example.com/selfie.jpg",
"https://example.com/selfie.jpg",
"https://example.com/selfie.jpg"
],
"model": "youcam-image-v2",
"prompt": "Make the girl from Image 1 wear the black dress from Image 2 and sit in the pose from Image 3. Keep her clothing, hairstyle, and expression unchanged, and ensure the action is natural and smooth.",
"negative_prompt": "low resolution, error, worst quality, low quality, disfigured, extra fingers, bad proportions.",
"size": "1024*1024",
"prompt_extend": true
}'{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }