跳转到内容

Sam 3 · 3D Objects

集成

模型 id sam-3/3d-objects
# 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/sam-3/3d-objects?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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此请求: ≈$0.02 20 API 积分 在此页面运行

获取 API 密钥
Meta · 3D

你的第一个结果会显示在这里

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

构建请求

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

默认 car

掩码不存在时用于自动分割的文本,例如 'chair' 或 'lamp'。

•必填 image_url
拖放文件,或

用于 3D 重建的图像 URL。

高级 mask_urls · pointmap_url · detection_threshold · seed · export_textured_glb · point_prompts · box_prompts
拖放文件,或

可选的按对象排列的掩码 URL 列表。没有掩码时,如果提供了 提示词、point_prompts 或 box_prompts,自动分割会使用这些参数;如果既未提供掩码也未提供分割提示词,则使用整个图像。

可选 URL,用于通过提供 NPY 或 NPZ 格式的外部 pointmap 或深度数据来改进 3D 重建中的深度估计。

检测置信度阈值,省略时使用模型默认值。范围为 0.1 到 1.0,较小的值会牺牲精确度以增加检测数量。

用于可复现随机生成的种子。

默认 []

掩码不存在时用于自动分割的基于点的提示词。

默认 []

通过自动分割为 3D 重建生成独立对象掩码的框提示词,仅在未提供掩码时使用。可以提交多个框。

POST /run/sam-3/3d-objects?wait=20 报价 → $0.02
# 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/sam-3/3d-objects?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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

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

关于 Sam 3 · 3D Objects

将照片中的物体转换为 3D 资产。使用 `mask_urls`、文本 `prompt`、`point_prompts` 或 `box_prompts` 选择物体;多个框会生成独立物体。`detection_threshold` 接受 0.1 到 1,`export_textured_glb` 会烘焙纹理和 UV。输出包括 GLB、Gaussian splat 文件、多物体场景的逐物体文件、元数据和 zip 包。

参数

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

名称类型 默认值允许值 描述
image_url必填 image
类型url · image
用于 3D 重建的图像 URL。
mask_urls可选
类型url[] · image
可选的按对象排列的掩码 URL 列表。没有掩码时,如果提供了 提示词、point_prompts 或 box_prompts,自动分割会使用这些参数;如果既未提供掩码也未提供分割提示词,则使用整个图像。
prompt可选
类型string | null
默认值car
掩码不存在时用于自动分割的文本,例如 'chair' 或 'lamp'。
point_prompts可选
类型object[]
默认值[]
掩码不存在时用于自动分割的基于点的提示词。
point_prompts[].x可选
类型integer | null
提示词在 X 轴上的位置。
point_prompts[].y可选
类型integer | null
提示词在 Y 轴上的位置。
point_prompts[].label可选
类型enum
01
前景/背景标签:1 表示前景;0 表示背景。
point_prompts[].object_id可选
类型integer | null
用于将细化同一对象的提示词分组的可选标识符。如果同时提供文本作为提示词,此标识符将决定这些点细化哪个检测到的对象。
box_prompts可选
类型object[]
默认值[]
通过自动分割为 3D 重建生成独立对象掩码的框提示词,仅在未提供掩码时使用。可以提交多个框。
box_prompts[].x_min可选
类型integer | null
边界框的最小 x 坐标。
box_prompts[].y_min可选
类型integer | null
边界框的最小 y 坐标。
box_prompts[].x_max可选
类型integer | null
框的最大 X 坐标。
box_prompts[].y_max可选
类型integer | null
框的最大 Y 坐标。
box_prompts[].object_id可选
类型integer | null
用于将细化同一对象的框分组的可选标识符。
seed可选
类型integer | null
用于可复现随机生成的种子。
pointmap_url可选
类型string | null
可选 URL,用于通过提供 NPY 或 NPZ 格式的外部 pointmap 或深度数据来改进 3D 重建中的深度估计。
detection_threshold可选
类型number | null
0.1 – 1
检测置信度阈值,省略时使用模型默认值。范围为 0.1 到 1.0,较小的值会牺牲精确度以增加检测数量。
export_textured_glb可选
类型boolean
默认值false
GLB 导出选项:启用后会使用烘焙纹理和 UV 替换顶点颜色。
必填 规范名称,也可接受

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

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "sam-3/3d-objects",
  "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": 20,
    "usd": "0.02",
    "charged": 20,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "gaussian_splat": {
      "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
    },
    "model_glb": {
      "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
    },
    "metadata": [
      {
        "object_index": 1,
        "scale": [
          []
        ],
        "rotation": [
          []
        ],
        "translation": [
          []
        ],
        "camera_pose": [
          []
        ]
      }
    ],
    "individual_splats": [
      {
        "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
      }
    ],
    "individual_glbs": [
      {
        "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
      }
    ],
    "artifacts_zip": {
      "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": "file",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "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 是模型自身的结果对象。
输出字段
gaussian_splat
object {url, content_type, file_name, file_size}包含多个对象时的组合场景 splat,否则为单个 splat;以 .ply 格式的 Gaussian splat 文件提供。
model_glb
object {url, content_type, file_name, file_size}保存为 GLB 的 3D 输出:多个对象会组装成一个场景,其他结果包含一个网格。
metadata
array of object {object_index, scale, rotation, translation, camera_pose}每个对象的元数据,包括旋转、位移和缩放。
individual_splats
array of object {url, content_type, file_name, file_size} | null每个对象对应的独立 Gaussian splat 文件,仅在包含多个对象的场景中提供。
individual_glbs
array of object {url, content_type, file_name, file_size} | null每个对象对应的独立 GLB 网格文件,仅在包含多个对象的场景中提供。
artifacts_zip
object {url, content_type, file_name, file_size} | null包含所有产物及元数据的 ZIP 压缩包。

更多模型:图像生成 3D

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