Nodes/ComfyUI-Kie-API/KIE GPT Image 2 (Text-to-Image)
ComfyUI Node

KIE GPT Image 2 (Text-to-Image)

KIE GPT Image 2 (Text-to-Image)

By gateway·Created 9 months ago·Updated 4 months ago· 39
KIE GPT Image 2 (Text-to-Image)
    • image
    prompt
    aspect_ratioauto
    resolution1K
    logtrue

    GPT Image 2 is one of those closed models you mostly experience through a chat app and a queue. This node puts it in a ComfyUI graph: give it a text prompt, and the OpenAI image model (served through the Kie.ai API marketplace) does its thing on someone else's GPUs and hands you a normal IMAGE tensor back. If you already live in ComfyUI and want that model's text rendering and prompt obedience without juggling a second web app, this is the node.

    It's part of the ComfyUI-Kie-API pack, a set of API-backed nodes that share one install and one API key. Worth knowing the trade before you start: this is cloud generation, pay-per-use credits, no local weights. You're renting the model, not owning it.

    How it works

    Same lifecycle as the pack's other image nodes. Your prompt gets wrapped in a task payload (model gpt-image-2 equivalent on KIE's side), sent to the createTask endpoint, and the node polls recordInfo every 10 seconds until the job lands. Images default to a 300-second timeout with automatic retries on transient failures. On success the result is downloaded and converted to a ComfyUI image tensor.

    The inputs that matter

    • prompt - the only required field. Long prompts are fine (up to 20,000 chars), and this model genuinely rewards describing composition, style, and text-in-image in prose.
    • aspect_ratio - auto, 1:1, 9:16, 16:9, 4:3, or 3:4. The default auto is the one to keep for a first pass: the model picks a fitting canvas. There's a catch though - KIE requires 1K resolution when aspect_ratio is auto, so if you want 2K/4K you have to pick an explicit ratio.
    • resolution - 1K, 2K, or 4K. And another KIE-side constraint: no 4K output at 1:1. The API enforces these, and the node passes them through, so if a combo silently fails, that's why. Stick with 1K while iterating - it's faster and cheaper, and upscaling in ComfyUI is a solved problem.

    One output, image, which feeds straight into a preview, a saver, or downstream processing.

    Installing

    The pack installs once for every KIE node. ComfyUI Manager: search "ComfyUI Kie API". Or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/gateway/ComfyUI-Kie-API
    # restart ComfyUI
    

    No model files, no exotic Python deps. The real setup step is the API key: create ComfyUI/custom_nodes/ComfyUI-Kie-API/config/kie_key.txt from the .example file and paste in your Kie.ai key. Every node in the pack reads that same file, so you do it once.

    Where people get burned

    Beyond the resolution/ratio rules above, the usual suspects: missing key ("KIE API key not found"), and jobs that submit but stall. The pack logs every task state change to the console, and kie.ai/logs shows the server-side record with the actual failure message. Also keep an eye on credits - GPT Image 2 at 4K is not the cheap seat on this platform, and it's easy to iterate a dozen drafts before realizing the balance is gone. Check with the pack's Get Remaining Credits node before a long batch.

    Categorykie/api

    Inputs (4)

    NameTypeDefaultDescription
    promptSTRING
    aspect_ratiooptCOMBOauto6 options: auto, 1:1, 9:16, 16:9, 4:3, 3:4
    resolutionoptCOMBO1K3 options: 1K, 2K, 4K
    logoptBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    imageIMAGE