第60章 Tripo H3.1:通过 Leonardo.AI API 生成 3D 资产
第60章:Tripo H3.1
本指南演示如何通过 Leonardo.AI REST API 使用 Tripo H3.1 模型生成 3D 资产。
示例请求
```bash
curl --request POST \
--url https://cloud.leonardo.ai/api/rest/v2/generations \
--header 'accept: application/json' \
--header 'authorization: Bearer
API 请求端点、请求头与参数
端点 https://cloud.leonardo.ai/api/rest/v2/generations
请求头
--header "accept: application/json" \
--header "authorization: Bearer
请求体参数
enable_pbr | 布尔值 | 为基于物理的渲染(PBR)添加金属度、粗糙度和法线贴图。仅在 should_texture 为 true 时生效。默认值为 true。 geometry_resolution | 字符串 | 几何细节等级。有效值为 standard(标准)和 detailed(精细,可捕捉更细微的表面细节)。默认值为 standard。 guidances.image_reference | 数组 | 待生成物体的参考图像。最多包含 4 个项目。每个项目包括一个图像对象和一个可选的 order(整数,最小值为 0)。image.type 接受 UPLOADED、GENERATED、VARIATION、URL 或 BASE64。对于 UPLOADED、GENERATED 和 VARIATION 类型,使用 image.id;对于 URL 类型,使用 image.url;对于 BASE64 类型,使用 image.data(base64 编码的图像字节)。 model | 字符串 | 指定用于生成的模型。设置为 tripo3d/tripo-h3.1。 output_format | 字符串 | 生成的 3D 资产的网格文件格式。设置为 glb。 prompt | 字符串 | 描述待生成的物体。在未提供图像参考时必填。在提供图像参考时不使用。最大长度 1024 字符。 public | 布尔值 | 控制生成的资产是公开(true)还是私有(false)。 quantity | 整数 | 每次请求生成的资产数量。设置为 1。 seed | 整数 | 生成的随机种子值。范围:0–2147483647。 should_texture | 布尔值 | 为生成的网格添加贴图。为 false 时,网格为无贴图几何体。默认值为 true。 texture_quality | 字符串 | 贴图分辨率。有效值为 standard(标准)和 hd(高清,贴图更锐利、细节更丰富)。仅在 should_texture 为 true 时生效。默认值为 standard。
约束条件
• 当未提供 guidances.image_reference 时,prompt 为必填项,且最大接受 1024 字符。 • 当提供 guidances.image_reference 时,不使用 prompt。 • guidances.image_reference 每次请求最多接受 4 张参考图像。 • quantity 固定为 1。每次请求仅生成单个资产。 • output_format 固定为 glb。 • seed 接受 0 到 2147483647 之间的值。 • texture_quality 和 enable_pbr 仅在 should_texture 为 true 时生效。
更新于 4 天前 | 此页面对您有帮助吗?