ComfyUI Node

ChatGPT Prompt Node

ChatGPT writes your ComfyUI prompts so you don't have to tab out

By vienteck·Created 3 years ago·Updated 2 years ago· 33
ChatGPT Prompt Node
    • STRING
    prompt
    modelgpt-3.5-turbo-1106
    roleAI Assistant
    append_string
    seed0

    Most people use ChatGPT to write Stable Diffusion prompts the hard way: vague idea, browser tab, a minute of arguing with the chatbot, copy, paste into a CLIP Text Encode node. This node automates that whole loop - the request leaves ComfyUI, and the finished prompt lands straight in the STRING socket of your text encoder. It won't change how you think about prompting. It just kills the tab-switching.

    The one thing to get straight up front: this is not the ChatGPT product, it's the OpenAI API. The node has no local model, uses zero VRAM, and needs a real API key with billing attached. A ChatGPT Plus subscription does not give you that key - you get one at platform.openai.com, and every queue run costs you actual money. The key lives in a config.json inside the pack folder, deliberately separate from your workflow so it never gets baked into saved images. That separate file is the entire setup.

    How it works

    Under the hood it's a single chat-completions call. Your prompt goes in as the user message, the system message is built from your chosen role ("You are a Hayao Miyazaki imitator"), and the reply text is passed through and emitted as a STRING. The model dropdown isn't hardcoded - it queries your key's account and lists whatever gpt models you can actually use, so it stays current on its own. It's a rewrite of Omar92's QualityOfLifeSuit node for the modern OpenAI SDK, with a retry loop that tries three times, waiting ten seconds between attempts, because the API just flakes out sometimes.

    The inputs that matter

    • prompt - the short idea you want expanded. This is the whole point of the node.
    • model - pick whatever the dropdown offers (a current one, not the gpt-3.5-turbo-1106 default, which OpenAI retired in 2025).
    • role - sets that system message. Since the response is passed through raw, it's mostly flavor now; the author himself called roles "useless."
    • append_string - the trap. Read the source and you'll see this gets appended to the prompt that's written to the log file, but the actual API call still sends your original prompt. It's dead weight in the shipped code.
    • seed - never touches the generated text. It exists purely as a re-run trigger: set control_after_generate to random and every execution fires a fresh API call.

    The output is one STRING. Wire it into a CLIP Text Encode node's text input and you're done. And yes, it still passes through fine even though the pack marks it as an output node.

    Installing it

    ComfyUI Manager will find it if you search "ComfyUI-Chat-GPT-Integration", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/vienteck/ComfyUI-Chat-GPT-Integration
    

    Restart ComfyUI - reloading the browser tab isn't enough. On first load it creates config.json with a placeholder key and prompt_log.txt, and it auto-installs the openai Python package if that's missing. No models to download, no weights, no heavy dependencies. It's a tiny pack.

    Where people get burned

    The key fails silently. Invalid key means an empty model dropdown and a console line about the key being invalid - the node doesn't throw a pretty error in the UI. Check your terminal.

    It's slow. Network round-trip plus possible 10-second retry sleeps means this node is the lag in your workflow. It's also a paid call on every single run, and random seeds make every run spend more.

    Privacy, seriously. Every prompt and every response is written in plain text to prompt_log.txt in the node folder, and every prompt leaves your machine for OpenAI. ComfyUI has a genuinely ugly history of sketchy custom nodes, so the habit is worth forming: skim the code before you feed it an API key. This one is short enough to read in a couple of minutes.

    It's unmaintained. Last commit was April 2024 and the README says no auto-update. It still works because the model list is pulled live, but don't expect fixes.

    Honest verdict: it's a fun toy and a clean way to test the "LLM writes my prompt" workflow. For anything you'll run repeatedly, most of r/comfyui ends up preferring a local LLM - no per-call cost, no key in a JSON file, no prompts leaving your box. If you specifically want OpenAI's models in the loop, this does that with zero fuss.

    CategoryOpenAI

    Inputs (5)

    NameTypeDefaultDescription
    promptSTRING
    modelCOMBOgpt-3.5-turbo-11060 options:
    roleCOMBOAI Assistant26 options: AI Assistant, Random, Hayao Miyazaki, Leonora Carrington, Philip K. Dick, Terry Gilliam, +20
    append_stringoptSTRING
    seedoptINT00–18446744073709550000

    Outputs (1)

    NameTypeDescription
    STRINGSTRING