Nodes/GPT img/GPT img API ChatGPT LLM
ComfyUI Node

GPT img API ChatGPT LLM

A ChatGPT text node that fits right into your workflow — you'll use it more than you think

By hub2vu·Created 4 months ago·Updated 4 months ago· 3
GPT img API ChatGPT LLM
    • text
    • raw_response_json
    system_promptYou are a helpful assistant.
    promptWrite a short answer.
    api_key
    modelgpt-5.5
    reasoning_effortmedium
    max_output_tokens2048
    timeout_sec300
    system_prompt_input
    user_prompt_input

    You probably found this pack for the image generation, but the LLM node is quietly the more useful one. GPT img API ChatGPT LLM sends a prompt to a ChatGPT model and returns the text reply as a plain STRING - which means you can use it the way ComfyUI users use any text node: chain it into a prompt encoder, have it rewrite a negative prompt, generate a caption, or summarize what the previous node decided. Anywhere you'd stick a hand-typed string, this can feed a live model instead.

    The trade-off is the API key again: every call is billed to your OpenAI account. There's no local model, no GGUF to download, no VRAM - the whole exchange happens at api.openai.com. If you'd rather use your ChatGPT subscription, the OAuth twin (GPT img OAuth ChatGPT LLM) is the same node with login-based auth.

    How it works

    It POSTs to the Responses API (/v1/responses) with your system_prompt as a developer message and your prompt as the user message. The payload sets reasoning to your chosen reasoning_effort and caps the reply with max_output_tokens. The response comes back as JSON, and the node extracts the text while also keeping the whole raw payload for you.

    The inputs that matter

    • prompt - the actual request. This is the one you'll edit constantly.
    • system_prompt - role instructions; "You are a helpful assistant" is the default, and it's fine to leave it for casual use.
    • model - defaults to gpt-5.5, and this node also exposes gpt-5.5-pro for heavier reasoning.
    • reasoning_effort - minimal through xhigh. Medium is default; crank it for hard questions, drop it when you just want speed.
    • max_output_tokens - output budget, default 2048, up to 128000.
    • api_key - empty means it falls back to OPENAI_API_KEY in your environment.

    Two optional sockets, system_prompt_input and user_prompt_input, override the widgets when connected - handy when you're feeding this node from another node's output instead of typing.

    Outputs

    • text - the model's answer, a STRING you can wire into anything.
    • raw_response_json - the full response object as a string, for when you need to inspect tokens or metadata.

    Install

    Manager may not show this pack yet (its registry version is still Pending), so clone manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/hub2vu/Comfyui-GPT-img-node.git GPT-img
    

    Restart ComfyUI, find the "GPT img" category. Zero Python dependencies to install.

    Common issues

    The usual suspects: a missing or invalid api_key, and long generations hitting the timeout_sec default of 300 seconds. The model list here is broader than the image nodes because pro models can have different streaming support, so if a call fails oddly, check you're not picking a model the image nodes wouldn't offer. And as always with API-key nodes - don't commit the key into a workflow file that ends up in git.

    CategoryGPT img

    Inputs (9)

    NameTypeDefaultDescription
    system_promptSTRINGYou are a helpful assistant.
    promptSTRINGWrite a short answer.
    api_keySTRING
    modelCOMBOgpt-5.55 options: gpt-5.5-pro, gpt-5.5, gpt-5, gpt-5.4, gpt-5.4-mini
    reasoning_effortCOMBOmedium5 options: minimal, low, medium, high, xhigh
    max_output_tokensINT204816–128000
    timeout_secINT30030–3600
    system_prompt_inputoptSTRING
    user_prompt_inputoptSTRING

    Outputs (2)

    NameTypeDescription
    textSTRING
    raw_response_jsonSTRING