⌘K

HI 3D 图生 3D 浮雕

hi3d_image_to_relief

根据单张输入图片生成浮雕模型或深度图。

接口提示

hi3d_image_to_relief 的 image、image_url 和 image_base64 必须三选一。

根据 format 不同,输出可以是 3D 浮雕模型或图片深度图。

认证

所有 API 均使用 Bearer Token 鉴权

获取 API Key:

访问 API Key 管理页面 获取 API Key

用法:

将以下 Header 添加到请求中:

Authorization: Bearer YOUR_API_KEY

model string 必填

值:hi3d_image_to_relief

image string

输入图片。image、image_url 和 image_base64 必须三选一。

image_url string

公开可访问的输入图片 URL,支持 PNG、JPEG 和 WebP。

image_base64 string

Base64 编码的输入图片,支持 PNG、JPEG 和 WebP。

model_type string

浮雕模型类型。

可选值:base、pro
默认值:pro

rmbg integer

是否移除背景。可选值:0、1,默认值为 1。

height_relief number

浮雕高度,范围为 0.1 到 50,默认值为 1.3。

width number

输出宽度,范围为 20 到 600,默认值为 40。

sculpmode integer

雕刻模式。可选值:0、1,默认值为 0。

degree_rmbg number

背景移除程度,范围为 0 到 1。在 rmbg=1 时使用。

shape_base integer

是否添加底座。在 rmbg=0 时使用。可选值:0、1。

thickness_base number

底座厚度,范围为 0.1 到 20。在 rmbg=0 时使用。

format string

输出格式。

可选值:exr、png、stl、glb、3mf、bmp
默认值:glb

exr、png 和 bmp 返回图片结果,其他格式返回 3D 模型结果。

轮询

由于结果生成需要时间,您需要在创建任务后轮询任务状态

初始响应只返回任务 ID 和初始状态等信息,最终生成结果需通过使用该任务 ID 轮询任务状态接口获取

轮询请求与响应示例见右侧

响应格式

error object

错误信息, 仅在状态为 failed 时存在

code string

错误码

message string

详细错误信息


output array

生成结果, 仅在状态为 completed 时存在

content array

生成的资源内容列表

type string

资源类型

值: image|video

url string

处理后的资源 URL

jobId string

远端任务 ID


usage object

使用统计, 仅在状态为 completed 时存在

cost string

总费用(美元)

discount number

折扣金额


metadata object

元数据信息