Reference spec for the implemented Grok Imagine text-to-image node. See KIE_GrokImagine_T2I.md for the ComfyUI node surface.
- Method:
POST - Path:
/api/v1/jobs/createTask - Base URL:
https://api.kie.ai - Model:
grok-imagine/text-to-image
{
"model": "grok-imagine/text-to-image",
"callBackUrl": "https://your-domain.com/api/callback",
"input": {
"prompt": "Cinematic portrait of a woman sitting by a vinyl record player, retro living room background, soft ambient lighting, warm earthy tones, nostalgic 1970s wardrobe, reflective mood, gentle film grain texture, shallow depth of field, vintage editorial photography style.",
"aspect_ratio": "3:2"
}
}model(STRING, required): Must begrok-imagine/text-to-image.callBackUrl(STRING, optional): Receives task completion notifications when provided.input(OBJECT, required): Generation parameters for the model.
prompt(STRING, required): Prompt text. Max length:5000.aspect_ratio(STRING, optional): One of2:3,3:2,1:1,9:16,16:9.
{
"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
Implemented node shape in this repo:
prompt:STRINGmultiline, required.aspect_ratio:COMBO, optional.log:BOOLEAN, optional.- Outputs:
IMAGEtask_id(STRING)
Output behavior:
- Download all
resultUrlsand return them as a ComfyUIIMAGEbatch if the endpoint returns multiple images. - Also return the
task_idfrom task creation so Grok I2V can reference one of the generated images viatask_id + index.
callBackUrlshould stay transport-level and does not need to be exposed in the first ComfyUI node pass.- This node is a natural upstream source for Grok I2V chaining.
- The docs do not state how many images are returned per task, but Grok I2V expects
task_id + indexagainst a prior Grok image-generation task, so keepingtask_idvisible is important.