跳转到内容

try-on

集成

模型 id cat-vton
# 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/cat-vton?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "human_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "garment_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "cloth_type": "upper"
  }'

# 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.018 18 API 积分 在此页面运行

获取 API 密钥
Open model 图像编辑 #try-on#fashion#clothing

虚拟试衣:将服装图像穿到人物照片上,并可选择服装类型

Open model · 图像

你的第一个结果将在此显示

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存或免费保存 7 天。

构建请求

控件根据模型架构生成。更改控件时,代码和价格会同步更新。

•必填
拖放文件,或

指向人物图像的 URL。

•必填
拖放文件,或

指向服装图像的 URL。

cloth_type •必填

试穿服装类别:upper 表示上装;lower 表示下装;overall 表示全身服装;inner 表示内层服装,如夹克内的 T 恤;outer 表示外层服装,如覆盖 T 恤的夹克。

image_size 默认 portrait_4_3

生成图像的尺寸。

高级 num_inference_steps · guidance_scale · seed · enable_safety_checker
默认 30

要执行的推理步数。

默认 2.5

图像选择对提示词的遵循强度,以 CFG(Classifier Free Guidance)表示。

用于图像复现的种子。要复现图像,必须保持种子、输入和模型版本不变;在这些条件下,每次运行的结果都相同。

POST /run/cat-vton?wait=20 报价 → $0.018
# 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/cat-vton?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "human_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "garment_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "cloth_type": "upper"
  }'

# 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 密钥

关于 try-on

渲染穿着指定服装的人物。需要 `human_image_url`、`garment_image_url` 和 `cloth_type`,后者可为 upper、lower、overall、inner 或 outer。输出尺寸使用 portrait_4_3 或 square_hd 等预设。可调整 `num_inference_steps`(1 到 50)、`guidance_scale` 和种子。

参数

名称类型 默认值允许值 描述
human_image_url必填
类型url · image
指向人物图像的 URL。
garment_image_url必填
类型url · image
指向服装图像的 URL。
cloth_type必填
类型enum
upperloweroverallinnerouter
试穿服装类别:upper 表示上装;lower 表示下装;overall 表示全身服装;inner 表示内层服装,如夹克内的 T 恤;outer 表示外层服装,如覆盖 T 恤的夹克。
image_size可选
类型object
默认值portrait_4_3
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
生成图像的尺寸。
num_inference_steps可选
类型integer
默认值30
1 – 50
要执行的推理步数。
guidance_scale可选
类型number
默认值2.5
0 – 20
图像选择对提示词的遵循强度,以 CFG(Classifier Free Guidance)表示。
seed可选
类型integer | null
用于图像复现的种子。要复现图像,必须保持种子、输入和模型版本不变;在这些条件下,每次运行的结果都相同。
enable_safety_checker可选
类型boolean
默认值true
调用方获得授权后,可将其设置为 false 以放宽审核。
必填

文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "cat-vton",
  "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": 18,
    "usd": "0.018",
    "charged": 18,
    "refunded": 0
  },
  "input": {
    "human_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "garment_image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg",
    "cloth_type": "upper"
  },
  "output": {
    "image": {
      "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,
      "width": 1024,
      "height": 768
    }
  },
  "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 是模型自身的结果对象。
输出字段
image
object {url, content_type, file_name, file_size, width, height}作为输出生成的图像。

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/cat-vton.md. 所有模型和指南: https://doitong.com/developers/llms.txt