Reference spec for the implemented Grok Imagine image-to-video node. See KIE_GrokImagine_I2V.md for the ComfyUI node surface.
- Method:
POST - Path:
/api/v1/jobs/createTask - Base URL:
https://api.kie.ai - Model:
grok-imagine/image-to-video
{
"model": "grok-imagine/image-to-video",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: thanks! Back to work.",
"mode": "normal",
"duration": "6",
"resolution": "480p"
}
}{
"model": "grok-imagine/image-to-video",
"input": {
"image_urls": [
"https://file.aiquickdraw.com/custom-page/akr/section-images/1762247692373tw5di116.png"
],
"prompt": "POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: thanks! Back to work.",
"mode": "normal",
"duration": "6",
"resolution": "480p"
}
}{
"model": "grok-imagine/image-to-video",
"input": {
"task_id": "previous_grok_task_id",
"index": 0,
"prompt": "POV hand comes into frame handing the girl a cup of take away coffee, the girl steps out of the screen looking tired, then takes it and she says happily: thanks! Back to work.",
"mode": "spicy",
"duration": "6",
"resolution": "480p"
}
}model(STRING, required): Must begrok-imagine/image-to-video.callBackUrl(STRING, optional): Receives task completion notifications when provided.input(OBJECT, required): Generation parameters for the model.
image_urls(ARRAY[URL], optional): One external image URL only. Accepted types:image/jpeg,image/png,image/webp. Max size:10MB.task_id(STRING, optional): Task id of a previous Grok image generation to reuse as the source image. Max length:100.index(NUMBER, optional): Which generated image to use from thetask_idsource. Min:0, Max:5. Grok generates 6 images per task.prompt(STRING, optional): Motion prompt for the generated video. Max length:5000.mode(STRING, optional): One offun,normal,spicy.duration(STRING, optional): One of6,10,15seconds.resolution(STRING, optional): One of480p,720p.
- Provide exactly one source method:
image_urlsfor an uploaded external imagetask_idplusindexfor a Grok-generated source image
- Do not provide both
image_urlsandtask_idin the same request. - External image mode supports one image only.
- When using external images,
spicymode is not supported and will automatically switch tonormalaccording to the docs. indexonly applies whentask_idis used, and is ignored whenimage_urlsis used.
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678"
}
}If callBackUrl is present, KIE posts task completion payloads to that URL for both success and failure states.
codedata.completeTimedata.costTimedata.createTimedata.modeldata.paramdata.resultJsondata.statedata.taskIddata.failCodedata.failMsgmsg
codedata.completeTimedata.costTimedata.createTimedata.failCodedata.failMsgdata.modeldata.paramdata.statedata.taskIddata.resultJsonmsg
Recommended node shape for this repo:
images:IMAGE, optional. If connected, upload the first image only.task_id:STRING, optional.index:INT, optional, default0, range0..5.prompt:STRINGmultiline, default empty string.mode:COMBO, optional.duration:COMBO, optional.resolution:COMBO, optional.log:BOOLEAN, optional.- Output:
VIDEOfor the first implementation pass.
Recommended validation behavior:
- Require exactly one source method:
imagestask_idplusindex
- Reject
imagestogether withtask_id. - If multiple ComfyUI images are connected, upload the first image only.
- If
task_idis not provided, ignoreindexrather than erroring, because the widget will still exist in the ComfyUI node UI. - If external images are used with
mode=spicy, log a warning and sendnormal.
callBackUrlshould stay transport-level and does not need to be exposed in the first ComfyUI node pass.- The cleanest future chain is likely from a Grok image-generation node that outputs a
task_id, which can then feed this node with anindex. - The docs do not describe a video-extension or last-frame chaining behavior for reusing this node with the output task id of a prior I2V run.
- For that reason, the first implementation should not expose
task_idas a chained output from the I2V node itself. - The provided request example includes
image_urlsandindextogether. That conflicts with the written rule thatindexonly applies totask_id, so the written rule should be treated as the safer contract. - The provided callback success example uses a
.jpgURL inresultUrls, which conflicts with the endpoint type. Treat that as a documentation inconsistency unless live API behavior proves otherwise.