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/edit",
"input": {
"image_urls": [
"https://example.com/image.png"
],
"prompt": "A quiet forest under soft morning light, with natural detail."
}
}
'{
"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 图像编辑
Grok Imagine 图像编辑 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/edit",
"input": {
"image_urls": [
"https://example.com/image.png"
],
"prompt": "A quiet forest under soft morning light, with natural detail."
}
}
'{
"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/edit - 使用提示词和参考图编辑图像。
功能
- 使用提示词和参考图编辑图像。
image_urls只接受 1 张图像。
输出选项
图像尺寸
size:可选。可选值:1:1、2:3、3:2、9:16、16:9。
高级参数
model 和可选的 callback_url 放在请求根级。所有工作流参数(包括输出选项)都放在 input 内。
使用下面列出的 input 字段。参考图请提供公开可访问的 HTTP(S) URL。
提示词
prompt:必填。描述要做的修改。长度:1-5,000 个字符。
图像 URL
image_urls:必填。提供公开可访问的图像 URL。只提供 1 项。使用 JPEG、PNG 或 WebP,最大 10 MB。
授权
使用 VIDGO_API_KEY。
请求体
application/json