> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vibetoken.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Hyper3D Rodin Gen-2 — 图生 3D

> 使用 Hyper3D Rodin Gen-2 将一到五张参考图重建为带 PBR 材质、四边面网格的有贴图 3D 模型。

| | |
| - | - |
| **模型 ID** | `hyper3d/rodin-gen-2-image-to-3d` |
| **系列** | `rodin-gen-2` |
| **任务** | `image-to-3d` |
| **模态** | 3D |
| **上游** | Hyper3D Rodin Gen-2（Hyper3D 官方 API） |

> [!NOTE]
>
> Gen-2 默认返回带 PBR 材质、四边面网格的 GLB。`HighPack` 附加项（4K 贴图）需手动开启，会增加费用。

## 端点

```http theme={null}
POST https://vibetoken.cn/v1/3d/generations
```

异步 —— 返回 `{id, status: "pending"}`；每隔 5 秒左右轮询
`GET /v1/3d/generations/{id}`，直到 `success` 或 `failed`。
幂等性、回调与错误见 [3D 生成参考](https://docs.vibetoken.cn/zh/api-reference/3d.md)。

## 参数

**image\_urls** `string[]` *required*

一到五张同一物体的参考图，每项为公开的 HTTPS URL，或 base64 `data:` URI（提交任务前会先替你托管）。第一张图决定材质；补充侧面、背面等视角可以让形体更准确。无法访问的 URL 会在预留任何费用之前以 `400` 拒绝。

**prompt** `string`

可选的文本，用于引导重建，例如说明材质，或描述图片里看不清的部分。最多 1024 个字符。

**use\_original\_alpha** `boolean`

直接使用图片自带的透明通道作为物体蒙版，而不是自动抠除背景。

**geometry\_file\_format** `"glb" | "fbx" | "obj" | "usdz" | "stl"` (default: "glb")

`data[0]` 中模型文件的格式。GLB 把材质内嵌在同一个文件里；STL 只包含几何。

**material** `"PBR" | "Shaded" | "All" | "Hybrid" | "None"` (default: "PBR")

材质类型。`PBR` 为基于物理的材质，`Shaded` 为烘焙了光照的颜色贴图，`All` 两者都输出，`Hybrid` 为 Hyper3D 的混合材质，`None` 为无贴图白模。

**mesh\_mode** `"Raw" | "Quad"` (default: "Quad")

`Raw` 输出三角面网格，`Quad` 输出四边面网格，拓扑更干净、便于编辑。

**quality** `"high" | "medium" | "low" | "extra-low"` (default: "medium")

网格面数预设。档位越高，网格越密，文件越大。

**quality\_override** `integer`

精确的目标面数，500 到 1,000,000。会覆盖 `quality`。`mesh_mode: "Quad"`（默认）时上限为 200,000。

**hd\_texture** `boolean`

额外执行一轮高清贴图处理。

**addons** `"HighPack"[]`

付费附加项。`["HighPack"]` 提供 4K 贴图，不改变几何（网格不会更密）。会增加费用。

**TAPose** `boolean`

用于人形角色：以 T 字或 A 字姿势生成模型，便于绑定骨骼。

**is\_symmetric** `"unknown" | "symmetric" | "balanced" | "asymmetric"`

告诉模型该物体是否对称。

**soft** `boolean`

柔化边缘，适合有机、圆润的物体。

**detail\_level** `integer`

细节增强，`1` 到 `3`。数值越高，表面细节增强越多。

**quad\_normal** `boolean`

烘焙法线贴图，让四边面网格保留高密度几何的细微表面细节。

**preview\_render** `boolean`

为模型渲染一张高质量预览图。在 Hyper3D 的快速模式下会被忽略：`Raw` 网格、glb/fbx/usdz 格式、`quality_override` 不超过 20,000。

**seed** `integer`

随机种子，`0` 到 `65535`。相同输入配合相同种子可复现结果。

### 高级参数

以下参数 API 可以接收，但不会显示在 Playground 中。没有明确需要时请不要传入。

| 字段 | 类型 | 说明 |
| - | - | - |
| `bbox_condition` | integer\[3] | 模型的最大尺寸，以 `[width, height, length]` 三个整数表示，每个取值 1 到 2048。 |

传入本页未列出的选项，或超出上述范围的取值，都会返回 `422`。

## 输出

`success` 时，`data` 按固定顺序列出 Hyper3D 返回的全部文件：

* `data[0]` —— 3D 模型，格式为你在 `geometry_file_format` 中指定的格式（返回的文件中没有该格式时，取第一个 3D 文件）：默认 `.glb`（内嵌材质），也可以是 `.fbx`、`.obj`、`.usdz` 或 `.stl`。
* `data[1]` —— 模型的预览图（`.webp`、`.png` 或 `.jpg`，生成时提供）。
* 其后是 Hyper3D 列出的其他所有文件：`material: "All"` 时的第二套文件、额外的预览渲染图，以及贴图。OBJ 和 STL 不打包贴图，选这两种格式时贴图会作为单独的文件返回。

每一项都有 `url`、`kind`（`"model"`、`"preview"`、`"texture"` 或 `"file"`），Hyper3D 给出文件名时还有 `name`。`data[0]` 之后的文件请按 `kind` 挑选，不要依赖位置。

所有文件都托管在 VibeToken 媒体 CDN 上，每个 URL 都以文件的真实扩展名结尾，可据此选择
加载器。文件保留 7 天（见 `expires_at`），需要长期保留的请自行下载。

## 示例

```bash cURL theme={null}
curl https://vibetoken.cn/v1/3d/generations \
  -H "Authorization: Bearer $VIBETOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "hyper3d/rodin-gen-2-image-to-3d",
    "image_urls": [
      "https://example.com/knight.png"
    ],
    "TAPose": true
  }'
```

```python Python theme={null}
import os
import time

import requests

BASE_URL = "https://vibetoken.cn/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['VIBETOKEN_API_KEY']}"}

job = requests.post(
    f"{BASE_URL}/3d/generations",
    headers=HEADERS,
    json={
        "model": "hyper3d/rodin-gen-2-image-to-3d",
        "image_urls": ["https://example.com/knight.png"],
        "TAPose": True,
    },
    timeout=60,
).json()

for _ in range(120):  # 每 5 秒轮询一次，最多 10 分钟
    gen = requests.get(f"{BASE_URL}/3d/generations/{job['id']}", headers=HEADERS, timeout=30).json()
    if gen["status"] in ("success", "failed"):
        break
    time.sleep(5)

if gen["status"] != "success":
    raise RuntimeError(gen.get("error_message") or "3D generation did not finish")

model_url = gen["data"][0]["url"]  # 3D 模型，格式由 geometry_file_format 决定（默认 .glb）
preview_url = next((f["url"] for f in gen["data"] if f.get("kind") == "preview"), None)  # 预览图（生成时提供）
with open("model." + model_url.rsplit(".", 1)[-1], "wb") as out:
    out.write(requests.get(model_url, timeout=300).content)
```

```javascript JavaScript theme={null}
const BASE_URL = "https://vibetoken.cn/v1";
const headers = {
  Authorization: `Bearer ${process.env.VIBETOKEN_API_KEY}`,
  "Content-Type": "application/json",
};

const job = await fetch(`${BASE_URL}/3d/generations`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    model: "hyper3d/rodin-gen-2-image-to-3d",
    image_urls: ["https://example.com/knight.png"],
    TAPose: true,
  }),
}).then((r) => r.json());

let gen;
for (let i = 0; i < 120; i++) { // 每 5 秒轮询一次，最多 10 分钟
  gen = await fetch(`${BASE_URL}/3d/generations/${job.id}`, { headers }).then((r) => r.json());
  if (gen.status === "success" || gen.status === "failed") break;
  await new Promise((resolve) => setTimeout(resolve, 5000));
}
if (gen.status !== "success") throw new Error(gen.error_message ?? "3D generation did not finish");

console.log(gen.data[0].url);  // 3D 模型，格式由 geometry_file_format 决定（默认 .glb）
console.log(gen.data.find((f) => f.kind === "preview")?.url); // 预览图（生成时提供）
```

```json theme={null}
{
  "id": "8e2b6f4a-1c3d-4e5f-9a7b-0c1d2e3f4a5b",
  "object": "3d.generation",
  "status": "pending",
  "model": "hyper3d/rodin-gen-2-image-to-3d",
  "created": 1795132800
}
```

轮询直到终态：

```bash theme={null}
curl https://vibetoken.cn/v1/3d/generations/8e2b6f4a-1c3d-4e5f-9a7b-0c1d2e3f4a5b \
  -H "Authorization: Bearer $VIBETOKEN_API_KEY"
```

```json theme={null}
{
  "id": "8e2b6f4a-1c3d-4e5f-9a7b-0c1d2e3f4a5b",
  "object": "3d.generation",
  "status": "success",
  "model": "hyper3d/rodin-gen-2-image-to-3d",
  "data": [
    { "url": "https://media.vibetoken.cn/media/<user>/<gen>/0.glb", "kind": "model", "name": "base_basic_pbr.glb" },
    { "url": "https://media.vibetoken.cn/media/<user>/<gen>/1.webp", "kind": "preview", "name": "preview.webp" },
    { "url": "https://media.vibetoken.cn/media/<user>/<gen>/2.png", "kind": "texture", "name": "texture_diffuse.png" }
  ],
  "created": 1795132800,
  "expires_at": 1795737600
}
```

## 选择输入图片

* 图片中只放一个物体，完整入画，背景为纯色或透明，裁掉其他内容；使用透明 PNG 时，`use_original_alpha: true` 会保留你自己的抠图。
* 把光线最好、最具代表性的视角放在第一张：它决定材质。再补充同一物体的其他角度（侧面、背面），让形体更准确。
* 均匀、没有强烈阴影的光照能得到更干净的贴图。

## 定价

按次计费；所选档位和开启的选项会改变价格，失败的生成不收费。影响价格的因素见
[Rodin Gen-2 快速入门](https://docs.vibetoken.cn/zh/hyper3d-rodin-gen-2-api/quickstart.md)，当前费率见[定价页](https://vibetoken.cn/pricing)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.