跳至內容

FASHN Virtual Try-On V1.6

整合

模型 id fashn/tryon/v1.6
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/fashn/tryon/v1.6?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_image": "example",
    "garment_image": "example"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此請求: $0.075 75 API 點數 在此頁面執行

取得 API 金鑰
FASHN 圖像編輯 #try-on#fashion#clothing

較新的 v1.6 虛擬試穿,將服裝以較高輸出解析度渲染到模特兒照片上

FASHN · 圖像

您的第一個結果會顯示在這裡

在下方建立請求,並使用您的 API 金鑰執行。輸出會複製到我們的儲存空間,可永久保留或免費保留 7 天。

建立請求

控制項是根據模型結構描述生成的。變更設定時,程式碼和價格會同步更新。

•必填

以 URL 或 base64 資料提供的模型圖像。

•必填

以 URL 或 base64 資料提供的服裝圖像。

預設 1

單次執行的圖像數量,可同時進行多次嘗試,以提高在生成隨機性下取得良好結果的機率。

進階 category · mode · garment_photo_type · moderation_level · output_format · seed · segmentation_free · enable_safety_checker
category 預設 auto

試穿服裝類別;'auto' 會要求嘗試自動偵測類別。

mode 預設 balanced

速度與品質取捨的操作模式:'balanced' 尋求折衷,'quality' 以較慢處理提供更佳結果,'performance' 執行速度較快但可能降低品質。

garment_photo_type 預設 auto

用於調校內部參數的服裝照片類別。平拍照與幽靈人台圖像使用 'flat-lay';展示模型穿著服裝的照片使用 'model'。使用 'auto' 時,系統會嘗試自行識別類別。

moderation_level 預設 permissive

服裝圖像審核政策。使用 'none' 停用篩選器需要帳戶授權;沒有授權時,該選項會以 'permissive' 執行。在 'permissive' 下僅封鎖露骨內容;'conservative' 還會排除內衣與泳裝。

output_format 預設 png

圖像格式選擇:'png' 可提供最高品質,'jpeg' 可加快生成速度。

用於可重現生成的種子:固定隨機性,使相同輸入可能產生相同結果;變更種子則會強制產生不同結果。

POST /run/fashn/tryon/v1.6?wait=20 報價 → $0.075
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/fashn/tryon/v1.6?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_image": "example",
    "garment_image": "example"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

執行此請求

您的金鑰會保留在此瀏覽器中:只會傳送至 Doitong API,且只有在勾選「記住」時才會儲存至 localStorage。 取得 API 金鑰

關於 FASHN Virtual Try-On V1.6

將 `garment_image` 中的服裝套到 `model_image` 中的人物身上,兩者皆可使用 URL 或 base64。`category` 接受 tops、bottoms、one-pieces 或 auto,`garment_photo_type` 接受模型、flat-lay 或 auto。`mode` 可為 performance、balanced 或 quality,`num_samples` 會產生 1 至 4 個 png 或 jpeg 結果。

參數

名稱類型 預設值允許值 說明
model_image必填
類型string
以 URL 或 base64 資料提供的模型圖像。
garment_image必填
類型string
以 URL 或 base64 資料提供的服裝圖像。
category選填
類型enum
預設值auto
topsbottomsone-piecesauto
試穿服裝類別;'auto' 會要求嘗試自動偵測類別。
mode選填
類型enum
預設值balanced
performancebalancedquality
速度與品質取捨的操作模式:'balanced' 尋求折衷,'quality' 以較慢處理提供更佳結果,'performance' 執行速度較快但可能降低品質。
garment_photo_type選填
類型enum
預設值auto
automodelflat-lay
用於調校內部參數的服裝照片類別。平拍照與幽靈人台圖像使用 'flat-lay';展示模型穿著服裝的照片使用 'model'。使用 'auto' 時,系統會嘗試自行識別類別。
moderation_level選填
類型enum
預設值permissive
nonepermissiveconservative
服裝圖像審核政策。使用 'none' 停用篩選器需要帳戶授權;沒有授權時,該選項會以 'permissive' 執行。在 'permissive' 下僅封鎖露骨內容;'conservative' 還會排除內衣與泳裝。
seed選填
類型integer | null
用於可重現生成的種子:固定隨機性,使相同輸入可能產生相同結果;變更種子則會強制產生不同結果。
num_samples選填
類型integer
預設值1
1 – 4
單次執行的圖像數量,可同時進行多次嘗試,以提高在生成隨機性下取得良好結果的機率。
segmentation_free選填
類型boolean
預設值true
停用模型圖像的人體解析。
output_format選填
類型enum
預設值png
pngjpeg
圖像格式選擇:'png' 可提供最高品質,'jpeg' 可加快生成速度。
enable_safety_checker選填
類型boolean
預設值true
在呼叫端獲得授權的情況下,將此值設為 false 可放寬審核。
必填

輸出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "fashn/tryon/v1.6",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 75,
    "usd": "0.075",
    "charged": 75,
    "refunded": 0
  },
  "input": {
    "model_image": "example",
    "garment_image": "example"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
您的檔案,由您選擇每個 outputs[].url 都是儲存空間中的副本:可永久保留(按 GB-月計費),或免費保留 7 天;可透過帳戶設定或 ?storage= 設定。
所有模型使用相同結構圖片、影片和音訊皆包含 type、url、content_type、width、height 和 duration。output 是模型自己的結果物件。
輸出欄位
images
array of object {url, content_type, file_name, file_size}

更多模型:圖像編輯

給 AI 代理程式:此頁面的 Markdown 位於 https://doitong.com/zh-TW/developers/models/fashn/tryon/v1.6.md. 所有模型與指南: https://doitong.com/developers/llms.txt