curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/grok-imagine-image-v2.0/edit",
"input": {
"image_urls": [
"https://example.com/image.png"
],
"prompt": "A quiet forest under soft morning light, with natural detail.",
"n": 1,
"aspect_ratio": "1:1",
"resolution": "1K",
"quality": "medium"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Request timeout{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Grok (xAI)
Grok Imagine Image 2.0 图像编辑
Grok Imagine Image 2.0 图像编辑 API 结合参考图和精确指令细化图像,在修改视觉细节的同时保留主体。
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "xai/grok-imagine-image-v2.0/edit",
"input": {
"image_urls": [
"https://example.com/image.png"
],
"prompt": "A quiet forest under soft morning light, with natural detail.",
"n": 1,
"aspect_ratio": "1:1",
"resolution": "1K",
"quality": "medium"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-example",
"status": "running",
"created_time": "2026-09-10T08:00:00"
}
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Request timeout{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
模型
- xai/grok-imagine-image-v2.0/edit - 使用提示词和参考图编辑图像。
功能
- 使用提示词和参考图编辑图像。
image_urls接受 1-3 张图像。- 可选
1K、2K输出分辨率。 - 通过
n控制输出图像数量。
输出选项
宽高比
aspect_ratio:可选。可选值:1:1、2:3、3:2、9:16、16:9。默认:1:1。
分辨率
resolution:可选。可选值:1K、2K。默认:1K。
质量
quality:可选。可选值:low、medium。默认:medium。
图像数量
n:可选。要生成的图像数量。1到4的整数。默认:1。
高级参数
model 和可选的 callback_url 放在请求根级。所有工作流参数(包括输出选项)都放在 input 内。
只发送本工作流支持的 input 字段。不支持的 input 字段会在扣除积分前被拒绝。输入 URL 必须使用 HTTP(S)、包含主机名,且不含内嵌凭证。
提示词
prompt:必填。描述要做的修改。长度:1-8,000 个字符。- 提供时不能为空。
图像 URL
image_urls:必填。提供公开可访问的图像 URL。1-3 项。每项都必须是 HTTP(S) URL。
计费因素
计费取决于输出质量(quality)、输出分辨率(resolution)和输出图像数量(n)。输入图像数量(image_urls)按请求单独计费一次,不乘以 n。
积分在提交时扣除,任务失败会退还。授权
使用 VIDGO_API_KEY。
请求体
application/json