跳转到内容

Pixelcut Product Photo

集成

模型 id pixelcut/product-photo
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/pixelcut/product-photo?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "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.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此请求: $0.024 24 API 积分 · ≈ ₽2.56 在此页面运行

获取 API 密钥
Pixelcut 图像编辑 #utility#editing

商品图合成器:抠出商品并将其放置在带背景、边距和阴影的新画布上

Pixelcut · 图像

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

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

构建请求

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

•必填 image_url
拖放文件,或

用于处理的产品图像 URL。

image_size 默认 square_hd

输出画布尺寸,可指定为自定义 {width, height} 或预设值:square_hd、square、portrait_4_3、portrait_16_9、landscape_4_3、landscape_16_9。默认值为 square_hd (1024x1024)。

高级 output_format · background · margin · shadow · watermark
output_format

输出图像编码,可从 PNG 或 JPEG 中选择;透明背景不支持 JPEG。省略选择时将保留输入的格式。

输出背景:图像、透明背景或默认为白色的纯色。

产品与画布边缘之间的间距。使用 `all` 设置所有边距,也可单独覆盖各边;默认每边为 20%。

阴影配置:选择 'Generative' 或 'Drop' 并配置其设置。不设置则不应用阴影。

通过提供图像启用徽标或水印叠加;省略时输出不会添加水印,这是默认行为。

POST /run/pixelcut/product-photo?wait=20 报价 → $0.024
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/pixelcut/product-photo?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "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.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 Pixelcut Product Photo

将商品照片处理为目录风格的图像。可使用 `image_size` 预设或自定义尺寸设置画布,选择纯色、透明或图像 `background`,并调整 `margin`。可添加生成式阴影或投影 `shadow`,以及可选的 `watermark` 叠加层。输出格式为 png 或 jpeg,且 jpeg 不能与透明背景一起使用。

参数

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

名称类型 默认值允许值 描述
image_url必填 image
类型url · image
用于处理的产品图像 URL。
image_size可选
类型object
默认值square_hd
square_hdsquareportrait_4_3portrait_16_9landscape_4_3landscape_16_9
输出画布尺寸,可指定为自定义 {width, height} 或预设值:square_hd、square、portrait_4_3、portrait_16_9、landscape_4_3、landscape_16_9。默认值为 square_hd (1024x1024)。
background可选
类型object
输出背景:图像、透明背景或默认为白色的纯色。
background.mode可选
类型enum
默认值Color
TransparentColorImage
背景模式:'Color' 使用 `color`,默认值为白色;'Transparent' 生成透明背景并始终使用 PNG;'Image' 将结果合成到 `image_url` 上。
background.color可选
类型object
默认值{"b":255,"g":255,"r":255}
'Color' 模式的纯色背景填充,默认为白色,通过范围为 0 到 255 的 R/G/B 分量指定。
background.color.r必填
类型integer
0 – 255
background.color.g必填
类型integer
0 – 255
background.color.b必填
类型integer
0 – 255
background.image_url可选
类型url · image
背景图像的 URL;在 'Image' 模式下必填。
background.image_fit可选
类型enum
默认值Cover
CoverContainStretch
选择背景图像适配画布的方式。'Contain' 保留适配后的图像,并在 `color` 上添加留白;'Stretch' 通过变形适配;'Cover' 通过裁剪填充画布。
margin可选
类型object
产品与画布边缘之间的间距。使用 `all` 设置所有边距,也可单独覆盖各边;默认每边为 20%。
margin.all可选
类型string
默认值20%
四边统一边距,以画布尺寸的 '%' 表示,范围为 0 到 49%,或以 'px' 表示,最小值为 0px。
margin.left可选
类型string | null
替代该侧 `all` 值的左边距。接受 0 到 49% 的 '%',或不低于 0px 的 'px'。
margin.right可选
类型string | null
替代该侧 `all` 值的右边距。接受 0 到 49% 的 '%',或不低于 0px 的 'px'。
margin.top可选
类型string | null
替代该侧 `all` 值的上边距。接受 0 到 49% 的 '%',或不低于 0px 的 'px'。
margin.bottom可选
类型string | null
替代该侧 `all` 值的下边距。接受 0 到 49% 的 '%',或不低于 0px 的 'px'。
shadow可选
类型object
阴影配置:选择 'Generative' 或 'Drop' 并配置其设置。不设置则不应用阴影。
shadow.type可选
类型enum
GenerativeDrop
可选阴影样式;未设置时不使用阴影。选择 'Generative' 进行 AI 合成,或选择 'Drop' 使用确定性投影阴影。
shadow.generative可选
类型object
AI 生成阴影的设置,在类型为 'Generative' 时应用。
shadow.generative.opacity可选
类型number
默认值0.2
0 – 1
完全合成后阴影的不透明度,范围为 0 到 1。
shadow.generative.light_source可选
类型object
用于合成阴影的明确虚拟光源;提供后会替代根据图像自动估计的光照方向。
shadow.drop可选
类型object
投影阴影的设置,在类型为 'Drop' 时应用。
shadow.drop.color可选
类型object
默认值{"b":0,"g":0,"r":0}
阴影的 RGB 颜色;默认为黑色。
shadow.drop.horizontal可选
类型number
默认值50
-100 – 100
水平阴影位移,最大设置值 100 表示画布宽度的 10%。取值范围为 -100 到 100;负值向左移动,正值向右移动。
shadow.drop.vertical可选
类型number
默认值8
-100 – 100
垂直阴影位移,最大设置值 100 表示画布高度的 10%。取值范围为 -100 到 100;负值向上移动,正值向下移动。
shadow.drop.blur可选
类型number
默认值24
0 – 100
阴影模糊设置;100 时的最大柔化程度对应画布较短边的 5% 半径。范围从 0 开始,0 会保留硬边。
shadow.drop.opacity可选
类型number
默认值0.25
0 – 1
阴影不透明度,范围为 0 到 1。
watermark可选
类型object
通过提供图像启用徽标或水印叠加;省略时输出不会添加水印,这是默认行为。
watermark.image_url可选
类型url · image
徽标或水印图像的 URL。空值会使输出不带水印。
watermark.remove_background可选
类型boolean
默认值false
是否使用背景移除功能去除水印背景,使叠加层不包含背景。
watermark.position可选
类型enum
默认值bottom_right
top_lefttop_rightbottom_leftbottom_rightcenter
水印的位置。
watermark.scale可选
类型number
默认值0.1
0.01 – 1
水印宽度,以画布宽度的比例表示。
watermark.opacity可选
类型number
默认值1
0 – 1
水印不透明度,范围为 0 到 1。
watermark.margin可选
类型string
默认值3%
距离画布边缘向内的距离,以画布的 '%' 表示(0–49%),或以 'px' 表示。
output_format可选
类型enum
pngjpeg
输出图像编码,可从 PNG 或 JPEG 中选择;透明背景不支持 JPEG。省略选择时将保留输入的格式。
必填 规范名称,也可接受

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

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "pixelcut/product-photo",
  "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": 24,
    "usd": "0.024",
    "charged": 24,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "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.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/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} | null为目录使用准备的产品照片。

更多模型:图像编辑

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