跳转到内容

V2.0

使用 AI 文字生成圖片 V2.0 API,您可以從文字提示或既有圖片,立即生成高品質影像,並提升視覺、細節與一致性。

執行用於文字轉影像的 AI 文字生成圖片任務 V2。

请求

AI 任務是非同步的。當功能支援 webhook 時,請優先使用以 webhook 為基礎的完成處理。設定您的 webhook 端點、驗證 webhook 簽章,並在收到 success 或 error 通知後,使用收到的 task_id 查詢任務結果。設定與驗證細節請見 webhook 整合指南。

若您的整合不支援 webhook 或無法使用 webhook,請實作輪詢。送出 AI 任務後,以固定間隔(例如每 10 秒)輪詢狀態端點,直到任務狀態為 success 或 error。

安全
BearerAuthenticationV2
正文application/json必需
modelstring必需

模型名稱。

Value:"youcam-image-v2"
promptstring, [ 1 .. 800 ] characters必需

描述您想要的影像內容、風格與構圖的正面提示。
支援中文與英文。最大長度為 800 個字元。每個中文字、字母、數字或符號都計為一個字元。

示例:"A sitting orange cat with a joyful expression, lively and adorable, highly realistic."
negative_promptstring, [ 1 .. 500 ] characters

描述您不想要出現在影像中的內容的負面提示。
支援中文與英文。最大長度為 500 個字元。

示例:"Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces
sizestring

輸出影像解析度,格式為 width*height。
支援的解析度及其長寬比:
- 1664*928(預設):16:9
- 1472*1104:4:3
- 1328*1328:1:1
- 1104*1472:3:4
- 928*1664:9:16

默认值:"1664*928"
Enum:"1664*928""1472*1104""1328*1328""1104*1472""928*1664"
示例:"1664*928"
prompt_extendboolean

啟用智慧提示改寫。模型會最佳化正面提示。不會影響負面提示。

默认值:true
Enum ValueDescription
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.

示例:true
curl -i -X POST \
  https://yce-api-01.makeupar.com/s2s/v2.0/task/text-to-image/youcam \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "youcam-image-v2",
    "prompt": "A sitting orange cat with a joyful expression, lively and adorable, highly realistic.",
    "negative_prompt": "Low resolution, low quality, distorted limbs, malformed fingers, oversaturated colors, wax-like appearance, no facial details, overly smooth surfaces, AI-generated look. Chaotic composition. Blurry or distorted text.",
    "size": "1664*928",
    "prompt_extend": true
  }'

响应

任務執行成功

正文application/json
statusinteger

回應狀態

示例:200
dataobject
响应
{ "status": 200, "data": { "task_id": "grH0CvsgXuAIHLUzD0V1Ol34hoet3R1tvdbtiVHrDb6_UqCLKIejAIajwxrhOAfe" } }