Nodes/ComfyUI_AITECCAFE_Toolkit/💬 AITEC ChatGPT Chat
ComfyUI Node

💬 AITEC ChatGPT Chat

Put a real GPT-4.1 answer inside your ComfyUI workflow (API key required)

By AI-TEC·Created about a year ago·Updated about a month ago· 4
💬 AITEC ChatGPT Chat
    • output_text
    input_text
    role_setting
    api_key

    Let's be honest about what this is: AITEC ChatGPT Chat is a thin wrapper around the OpenAI Chat Completions API with the model name hardcoded to gpt-4.1. It's the simplest node in the AITECCAFE Toolkit, and if you've ever called the OpenAI API from Python you've basically already written it. What it buys you is that call happening inside a workflow, so the text can feed something downstream - a prompt you paste into a CLIP text encoder, a filename, a caption - without leaving ComfyUI.

    It works exactly like you'd guess. The node takes an input_text (your prompt), an optional role_setting (the system message), and an api_key, then calls client.chat.completions.create(). There's no model selector, no temperature slider, nothing: the code fixes model="gpt-4.1", max_tokens=2000, and temperature=0.7. You get one output, output_text (STRING), which is the model's reply.

    The inputs that matter, since it's only three:

    • api_key - your OpenAI key. This is the one that matters.
    • input_text - the actual prompt sent to the model.
    • role_setting - the system prompt. Empty string is fine.

    Two behaviors worth knowing before you wire it up. First, the node re-runs every single queue because it returns float("nan") from IS_CHANGED - there's no caching, so every run costs you tokens. Second, if the key or prompt is empty it silently returns an empty string and just prints a console message, so an empty output usually means you forgot the key, not that the API failed.

    Installation is the pack-wide path, and honestly this node is the reason to read it carefully:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AI-TEC/ComfyUI-AITECCAFE-Toolkit
    pip install -r ComfyUI-AITECCAFE-Toolkit/requirements.txt
    

    or search "AITECCAFE" in ComfyUI Manager. Fair warning: that requirements.txt drags in tensorflow and opennsfw2 for the other nodes in the pack, so installing for this one node alone is a heavy lift - you're getting the whole toolkit whether you wanted it or not.

    Now the part the README hammers on, and you should listen: the API key lives in the workflow as plain text. If you share a workflow that has it filled in, anyone who opens it can spend your money. Never share a saved workflow with a real key in it, use an environment variable approach if you can, and keep an eye on your OpenAI dashboard. The pack's README says "use at your own risk" in all caps, and it means it. Custom nodes run arbitrary code - the ComfyUI_LLMVISION malware scare in the community showed exactly why you think twice before pasting credentials into any node.

    Where this node shines: quick one-off text generation where you don't care about reproducibility, and you're already inside a workflow. Where it falls down: no model choice, no seed control, no way to retry a specific call. If you want that, the pack's own AITEC LLM Chat node runs a local model instead - no key, no per-token bill, just VRAM.

    CategoryAITECCAFE-Toolkit

    Inputs (3)

    NameTypeDefaultDescription
    input_textSTRING
    role_settingSTRING
    api_keySTRING

    Outputs (1)

    NameTypeDescription
    output_textSTRING