跳转到内容

Uso

集成

模型 id uso
# 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/uso?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }'

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

获取 API 密钥
ByteDance 图像编辑 #image-to-image

根据内容图像和一到两张风格图像生成由风格和主体驱动的图像

ByteDance · 图像

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

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

构建请求

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

默认

生成提示词文本;留空则仅执行风格迁移。

•必填
拖放文件,或

图像 URL 列表,顺序为:[content_image, style_image, extra_style_image]。

image_size 默认 square_hd

生成图像的尺寸。

num_images 默认 1

同时生成的图像数量。

高级 negative_prompt · output_format · num_inference_steps · guidance_scale · seed · keep_size · enable_safety_checker
默认

要排除的不需要的图像内容,包括元素、样式和伪影。

output_format 默认 png

输出图像格式:PNG 保留透明度,JPEG 生成更小的文件。

默认 28

去噪迭代次数;次数越高,生成时间越长,但质量可能更好。

默认 4

提示词遵循度控制:提高此值可使结果更贴近提示词。

控制生成随机性的种子。重复使用同一种子会产生一致且可复现的结果。

POST /run/uso?wait=20 报价 → $0.10
# 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/uso?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input_image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }'

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

关于 Uso

按内容图像、风格图像和可选的额外风格图像顺序接收 `input_image_urls`。纯风格迁移时提示词可以为空,`negative_prompt` 用于排除不需要的元素。`keep_size` 保留内容图像的布局和尺寸。每次运行生成 1 至 4 张图像,支持 1 至 50 步,输出格式为 PNG 或 JPEG。

参数

发送规范名称或原生名称之一,不要同时发送两者。 规范名称

名称类型 默认值允许值 描述
prompt可选
类型string
默认值
生成提示词文本;留空则仅执行风格迁移。
input_image_urls必填
类型url[] · image
图像 URL 列表,顺序为:[content_image, style_image, extra_style_image]。
image_size可选
类型object
默认值square_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
生成图像的尺寸。
negative_prompt可选
类型string
默认值
要排除的不需要的图像内容,包括元素、样式和伪影。
num_inference_steps可选
类型integer
默认值28
1 – 50
去噪迭代次数;次数越高,生成时间越长,但质量可能更好。
guidance_scale可选
类型number
默认值4
1 – 10
提示词遵循度控制:提高此值可使结果更贴近提示词。
keep_size可选
类型boolean
默认值false
处理内容图像时保持其尺寸和布局不变,适用于风格迁移。
num_images可选 num_outputs
类型integer
默认值1
1 – 4
同时生成的图像数量。
seed可选
类型integer | null
控制生成随机性的种子。重复使用同一种子会产生一致且可复现的结果。
enable_safety_checker可选
类型boolean
默认值true
启用 NSFW 内容检测和过滤。
output_format可选
类型enum
默认值png
jpegpng
输出图像格式:PNG 保留透明度,JPEG 生成更小的文件。
必填 规范名称,也可接受

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

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "uso",
  "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": 100,
    "usd": "0.10",
    "charged": 100,
    "refunded": 0
  },
  "input": {
    "input_image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  },
  "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,
        "width": 1024,
        "height": 768
      }
    ],
    "seed": 42,
    "has_nsfw_concepts": [
      false
    ],
    "prompt": "string",
    "timings": {}
  },
  "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, width, height}融合风格定制、主体定制或两者的生成图像。
seed
integer生成过程中使用的种子值。
has_nsfw_concepts
array of boolean对生成图像进行 NSFW 检测后得到的逐图像结果。
prompt
string生成期间使用的提示词。
timings
object按阶段细分的性能计时测量结果。

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