图像生成
Imagen 4.0
Google DeepMind 旗舰文生图 — 原生 2K 输出,写实质感,中英文字渲染准确
POST
/
v1
/
tasks
Imagen 4.0
curl --request POST \
--url https://www.qingbo.dev/v1/tasks \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"n": 123,
"seed": 123,
"aspect_ratio": "<string>",
"resolution": "<string>",
"callback_url": "<string>",
"callback_events": [
"<string>"
]
}
'import requests
url = "https://www.qingbo.dev/v1/tasks"
payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"n": 123,
"seed": 123,
"aspect_ratio": "<string>",
"resolution": "<string>",
"callback_url": "<string>",
"callback_events": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
n: 123,
seed: 123,
aspect_ratio: '<string>',
resolution: '<string>',
callback_url: '<string>',
callback_events: ['<string>']
})
};
fetch('https://www.qingbo.dev/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.qingbo.dev/v1/tasks"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"seed\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"seed\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")
.asString();{
"task_id": "task-wave1775285160b950328499",
"model": "imagen-4.0",
"action": "generate",
"status": "queued",
"created_at": 1775285160040,
"progress": 0
}
该模型暂未开放(维护中) — 因模型服务不稳定,
imagen-4.0 当前未对外提供,提交请求会被拒绝。以下文档保留作能力参考,恢复开放时间另行通知。定价
| 模型 | 单价(每张) |
|---|---|
imagen-4.0 | $0.0425 |
调用示例
curl -X POST https://www.qingbo.dev/v1/tasks \
-H "Authorization: Bearer $WAVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "imagen-4.0",
"prompt": "山顶日出,云海翻涌,远处雪峰泛起金光,写实摄影风格"
}'
curl -X POST https://www.qingbo.dev/v1/tasks \
-H "Authorization: Bearer $WAVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "imagen-4.0",
"prompt": "电影海报,主标题大字 \"STARFALL\",副标题 \"Coming 2026\",星空背景,极简留白",
"aspect_ratio": "9:16",
"n": 2
}'
curl -X POST https://www.qingbo.dev/v1/tasks \
-H "Authorization: Bearer $WAVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "imagen-4.0",
"prompt": "现代极简办公空间,落地窗洒入晨光,绿植点缀,杂志摄影风格",
"aspect_ratio": "16:9",
"seed": 42
}'
{
"task_id": "task-wave1775285160b950328499",
"model": "imagen-4.0",
"action": "generate",
"status": "queued",
"created_at": 1775285160040,
"progress": 0
}
GET /v1/tasks/{task_id} 轮询状态,详见 任务系统。
可用模型
| 模型 ID | 说明 |
|---|---|
imagen-4.0 | Google DeepMind 旗舰文生图,原生 2K,写实质感,中英文字准确 |
通用参数
string
默认值:"generate"
操作类型,Imagen 4.0 仅支持:
generate— 文生图(默认)
string
必填
图像描述文本,支持中英文。Imagen 4.0 对场景细节、光影与文字渲染表现尤佳
integer
默认值:"1"
生成数量(单次返回多张)
integer
默认值:"-1"
随机种子,
-1 为随机;固定值可复现相似结果string
默认值:"1:1"
画面宽高比,可选值:
1:1— 正方形4:3/3:4— 横/竖版标准16:9/9:16— 横/竖版宽屏
string
输出分辨率,Imagen 4.0 默认原生 2K,无独立分辨率档位,留空即可
string[]
需要回调的事件类型,默认全部终态事件
资源限制
| 项目 | 限制 |
|---|---|
| 支持 action | 仅 generate(纯文生图) |
| 输出分辨率 | 原生 2K(固定,无档位选择) |
| 宽高比 | 1:1 / 4:3 / 3:4 / 16:9 / 9:16 共 5 种 |
| 输出文件 | JPG,链接 24 小时有效 |
相关文档
⌘I
Imagen 4.0
curl --request POST \
--url https://www.qingbo.dev/v1/tasks \
--header 'Content-Type: application/json' \
--data '
{
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"n": 123,
"seed": 123,
"aspect_ratio": "<string>",
"resolution": "<string>",
"callback_url": "<string>",
"callback_events": [
"<string>"
]
}
'import requests
url = "https://www.qingbo.dev/v1/tasks"
payload = {
"model": "<string>",
"action": "<string>",
"prompt": "<string>",
"n": 123,
"seed": 123,
"aspect_ratio": "<string>",
"resolution": "<string>",
"callback_url": "<string>",
"callback_events": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
model: '<string>',
action: '<string>',
prompt: '<string>',
n: 123,
seed: 123,
aspect_ratio: '<string>',
resolution: '<string>',
callback_url: '<string>',
callback_events: ['<string>']
})
};
fetch('https://www.qingbo.dev/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.qingbo.dev/v1/tasks"
payload := strings.NewReader("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"seed\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.qingbo.dev/v1/tasks")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"<string>\",\n \"action\": \"<string>\",\n \"prompt\": \"<string>\",\n \"n\": 123,\n \"seed\": 123,\n \"aspect_ratio\": \"<string>\",\n \"resolution\": \"<string>\",\n \"callback_url\": \"<string>\",\n \"callback_events\": [\n \"<string>\"\n ]\n}")
.asString();{
"task_id": "task-wave1775285160b950328499",
"model": "imagen-4.0",
"action": "generate",
"status": "queued",
"created_at": 1775285160040,
"progress": 0
}