curl --request POST \
--url https://api.aihubmax.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "patina-material",
"prompt": "Weathered red brick wall with moss",
"image_size": 1024,
"maps": [
"basecolor",
"normal",
"roughness",
"height"
]
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}Patina
Patina 材质生成
- PATINA Material 模型,生成可平铺纹理和 PBR maps
- 支持文生材质和图生材质模式
- 异步处理模式,使用返回的任务ID 进行查询
- 生成的图像链接,有效期为24小时,请尽快保存
POST
/
v1
/
images
/
generations
curl --request POST \
--url https://api.aihubmax.com/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "patina-material",
"prompt": "Weathered red brick wall with moss",
"image_size": 1024,
"maps": [
"basecolor",
"normal",
"roughness",
"height"
]
}
'{
"created": 1757165031,
"id": "task-unified-1757165031-uyujaw3d",
"model": "<string>",
"object": "image.generation.task",
"progress": 0,
"status": "pending",
"task_info": {
"can_cancel": true,
"estimated_time": 45
},
"type": "image"
}{
"error": {
"message": "请求格式错误",
"type": "invalid_request_error"
}
}{
"error": {
"message": "API密钥无效",
"type": "authentication_error"
}
}{
"error": {
"message": "账户余额不足",
"type": "insufficient_quota"
}
}{
"error": {
"message": "参数校验失败",
"type": "validation_error"
}
}{
"error": {
"message": "请求频率超限",
"type": "rate_limit_error"
}
}{
"error": {
"message": "服务器内部错误",
"type": "server_error"
}
}{
"error": {
"message": "服务暂不可用,请稍后重试",
"type": "service_unavailable"
}
}授权
所有接口均需要使用Bearer Token进行认证
使用时在请求头中添加:
Authorization: Bearer YOUR_API_KEY
请求体
application/json
patina-material:生成可平铺纹理和 PBR maps
示例:
"patina-material"
材质描述提示词
说明:
- 描述想要生成的材质外观
- 支持中英文
示例:
"Weathered red brick wall with moss"
要生成的 PBR map 类型列表
可选值:
basecolor— 基础色贴图normal— 法线贴图roughness— 粗糙度贴图metalness— 金属度贴图height— 高度贴图
示例:
[
"basecolor",
"normal",
"roughness",
"height"
]
参考图片的公开 URL
说明:
- 可选,作为材质生成的参考
- 不传时为纯文生材质模式
示例:
"https://example.com/brick-photo.jpg"
蒙版图片的公开 URL
说明:
- 与
image_url配合使用,指定局部区域生成材质
示例:
"https://example.com/mask.png"
输出图像边长(像素)
说明:
- 控制生成的纹理和 PBR maps 尺寸
示例:
512
平铺模式
可选值:
none— 不平铺x— 水平平铺y— 垂直平铺xy— 双向平铺
非必须不要传这个参数。
示例:
"xy"
放大倍率
说明:
- 对输出材质进行放大处理
- 启用会增加计费
非必须不要传这个参数。
示例:
2
响应
任务创建成功
任务创建时间戳
示例:
1757165031
任务ID
示例:
"task-unified-1757165031-uyujaw3d"
实际使用的模型名称
任务的具体类型
可用选项:
image.generation.task 任务进度百分比 (0-100)
必填范围:
0 <= x <= 100示例:
0
任务状态
可用选项:
pending, processing, completed, failed 示例:
"pending"
异步任务信息
Show child attributes
Show child attributes
任务的输出类型
可用选项:
image 示例:
"image"