Nodes/KIE.ai Nodes Next/Grok Imagine Image 2.0 Text To Image
ComfyUI Node

Grok Imagine Image 2.0 Text To Image

The still that starts the segment-edit chain

By felipederosilva·Created about a month ago·Updated about 22 hours ago· 3
Grok Imagine Image 2.0 Text To Image
    • image
    • url
    • all_urls_json
    • task_id
    • raw_json
    • credits_consumed
    • credits_left
    ◄prompt►
    ◄aspect_ratio1:1►
    ◄timeout_seconds1200►
    ◄callback_url►

    What it is

    The 2.0 generation of Grok Imagine's image model, text-only. KIE Next / Image / xAI / Grok Imagine, and it's the sibling of the original Grok Imagine - Text to Image node sitting in the same folder - a reminder of how this pack works: KIE published both models, so you get both nodes, with the version baked into the node rather than hidden behind a dropdown.

    Where it earns its place is the edit workflows. This is the model that produces the source task that Image 2.0's Image Edit and Segment Edit nodes consume, and it's the model whose output feeds Segment Map so you can select a region by index instead of painting a mask. If that sentence meant nothing to you, this is the node to reach for anyway: generate the still here, then chain.

    How it works

    Straightforward pack plumbing: submit to KIE's create-task endpoint, poll until the task completes, download the result and turn it into an IMAGE tensor (a copy is archived under your ComfyUI output folder so a restart doesn't lose it). Nothing is uploaded inbound because there's no image input - this node is all prompt.

    The part that isn't obvious from the graph is what comes out on task_id. That string isn't just bookkeeping; it's the reference the other Grok Imagine 2.0 nodes take as an input. In this family, the task ID is the handle to the generated asset, and the pack surfaces it as a first-class output for exactly that reason.

    Inputs

    Only two things are required, and both are genuinely required:

    • prompt - text describing the image. English, and specific beats poetic: subject, framing, light, mood.
    • aspect_ratio - 1:1 default, with 2:3, 3:2, 16:9 and 9:16 available. Unlike the older Grok Imagine node, this model has no "auto" option and the field is mandatory. Set it deliberately - the default turns your portrait idea into a square.

    Optional: timeout_seconds (default 1200s - generous, because these jobs can be slow) and callback_url, which you leave empty for normal ComfyUI use.

    Outputs

    image is the tensor. url is the primary result URL, all_urls_json holds every URL the task returned, task_id is the handle for the follow-up edit nodes, raw_json is the provider's full response, and credits_consumed / credits_left are floats that also get drawn on the node after each successful run.

    A practical wiring habit for this family: keep task_id visible in your graph and name the node. When you come back a day later wondering which still the segment edit was operating on, that string is the only thing that tells you.

    Install

    ComfyUI Manager → search KIE.ai Nodes Next, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/felipederosilva/ComfyUI-KIE-Nodes-Next
    python -m pip install -r ComfyUI-KIE-Nodes-Next/requirements.txt
    

    The pack's dependencies are requests, Pillow, numpy and PyYAML. No checkpoints, no VRAM, no model files - every generation happens on KIE's side, and you pay per call. Restart ComfyUI, then set your key once via Settings → KIE.ai Nodes Next → Connection (it's validated before saving, and only a masked fingerprint stays visible). Servers can use KIE_API_KEY instead.

    On first launch the pack pulls KIE's API docs index and generates the node menu from it, re-checking roughly daily and reloading the frontend once while it does. A missing node usually means the catalog hasn't synced yet.

    Gotchas

    • Aspect ratio is not optional. There's no auto; the default square is a choice you should override on purpose.
    • Segment Edit expects this model's task IDs (or a Segment Map task). A task ID from a different model in a different pack won't do - KIE only honours its own.
    • Chained tasks cost separately. Text-to-image, then segment map, then segment edit is three paid calls for one edited image. That's fine, but it's not a free undo history.
    • No API key produces No KIE API key configured... - Settings, not the graph.
    • Provider moderation applies, as with every hosted model here. There are no weights to patch when it refuses.
    CategoryKIE Next/Image/xAI/Grok Imagine

    Inputs (4)

    NameTypeDefaultDescription
    promptSTRINGText prompt describing the desired image. This field is required.
    aspect_ratioCOMBO1:1Specifies the width-to-height ratio of the generated image. Controls the aspect ratio of the output. This field is required.
    timeout_secondsoptINT120030–7200—
    callback_urloptSTRINGOptional KIE callback URL. Leave empty for normal ComfyUI use.

    Outputs (7)

    NameTypeDescription
    imageIMAGE—
    urlSTRING—
    all_urls_jsonSTRING—
    task_idSTRING—
    raw_jsonSTRING—
    credits_consumedFLOAT—
    credits_leftFLOAT—