Imagen 4 Ultra API
POST Base URL:
https://api.hiapi.ai /v1/tasks 图片、视频和音频模型通过统一异步接口 POST /v1/tasks 调用,区别只在 input 字段(见下方 input 参数)。
模型概览
| 模型名称 | imagen4-ultra |
|---|---|
| 类型 | 图像生成(文生图) |
| 接口 | POST /v1/tasks |
| 价格 | 见 HiAPI 定价 |
Imagen 4 Ultra 文生图 API:从详细文字提示词生成高质量图片。
生产建议
生产环境建议
- 生产环境可在请求体顶层传 callback.url,减少轮询。
- 本地调试可轮询 GET /v1/tasks/:id。
适用场景
交付高细节成品
产品微距、人物肖像和材质特写,默认 1:1。
promptaspect_ratio固定 seed 微调定稿
固定字符串 seed(最长 500 字符),只微调材质、光线和景深描述。
seednegative_prompt请求参数
model string 必填 固定填 imagen4-ultra。
input object 必填 模型参数放在 input 对象中。
prompt string 必填 必填的图像描述,最长 5,000 个字符。
aspect_ratio enum 必填 输出画幅比例。
negative_prompt string 可选 可选的反向提示词,最长 5,000 个字符。
seed string 可选 可选字符串,最长 500 个字符。
callback object 可选 可选的任务终态回调。
url string 必填 接收任务终态通知的 HTTPS 地址。
when enum 可选 回调时机,当前固定为 final。
用例示例
拍出腕表材质微距
提示词分四段:任务、要画什么、保留什么、质感和限制。
请求体
{
"model": "imagen4-ultra",
"input": {
"prompt": "Create a macro product photo of a luxury watch. Show the brushed steel case and the dial markings resting on deep green silk. Keep the watch centered in a square frame with the silk folds visible. Controlled studio lighting with crisp reflections; the result should look like a premium catalog image. Do not add logos or text.",
"aspect_ratio": "1:1"
}
}生成高细节航拍风景
详情页案例提交时的原始提示词。
请求体
{
"model": "imagen4-ultra",
"input": {
"prompt": "Aerial view of a winding river through autumn forest; ultra high detail landscape",
"aspect_ratio": "16:9"
}
}获取结果
- 提交后立即返回 taskId。
- 等待 callback.url 或轮询 GET /v1/tasks/:id。
- status=success 后下载 output[].url。
常见问题
是否支持参考图片?
不支持。Imagen 4 Ultra 只根据文字生成图片。
seed 是什么类型?
可选字符串,最长 500 个字符。
什么时候用 Ultra?
需要交付成品时用。方向可以先用 imagen4-fast 筛,定下来后再换成 imagen4-ultra。
如何获取生成结果?
凭 taskId 取。提交后立即返回 taskId,任务成功后从 output[].url 下载图片。
如何确认费用?
以任务记录为准。提交前可以看价格页和 Playground 预估。 查看价格