Nodes/ComfyUI_ChatGptHelper/ChatGpt Helper to enhance prompt
ComfyUI Node

ChatGpt Helper to enhance prompt

ChatGPT rewrites your prompt mid-workflow — API key sold separately

By AIExplorer25·Created about a year ago·Updated 8 months ago· 0
ChatGpt Helper to enhance prompt
    • updated_prompt
    enable_chatgpttrue
    chatgpt_api_key
    input_prompt_text
    chatgpt_instruction_text

    The node that outsources your prompt to OpenAI

    ChatGptHelper is the whole pack, and it does exactly one thing: you type a prompt, it sends that prompt to OpenAI's ChatGPT API, and it hands you back an "enhanced" version. More lighting, more environment detail, more "professional image generation prompt" flavor - that's the enhancement, per the author's hardcoded instructions. It's a text-in, text-out utility node, the sort of thing that exists because prompt writing is the fiddly part and people will happily pay an LLM to do it for them.

    Why would you reach for it? Prompt paralysis is real. You have a half-formed idea and you keep rewriting the same sentence instead of generating. Drop a rough sketch into this node, let ChatGPT dress it up, and feed the result to your sampler. It's also a surprisingly good fit for the newer LLM-encoded checkpoints - Flux 2 Klein, Z-Image, Anima and friends read your prompt like an instruction message rather than a tag list, so a clean natural-language rewrite is closer to what the encoder actually wants than your comma soup is.

    How it works

    Under the hood it's a thin wrapper around the OpenAI Python client. The node assembles a message with a fixed system prompt ("You are an image prompt editor..."), appends your instruction text and original prompt, and calls chat.completions.create(model="gpt-4", temperature=0.7). Whatever comes back gets stripped and returned as the new prompt. That's the whole mechanism - no local model, no vector store, just a paid API call per generation.

    Two details worth knowing. First, the node md5-caches results keyed on the two text fields, and its IS_CHANGED returns None, so ComfyUI won't re-run it unless you actually edit an input. Run the same queue twice and you won't be billed twice. Second, enable_chatgpt set to off is a pure pass-through - the node just echoes your input prompt back, which is handy when you want to keep the node in the graph but work offline or free.

    The inputs that matter

    Only four inputs, and they're all required widgets:

    • chatgpt_api_key - your OpenAI key. There's no OPENAI_API_KEY env-var fallback wired up in the shipped code, so an empty field just crashes the call. This one is mandatory.
    • input_prompt_text - the prompt you want enhanced.
    • chatgpt_instruction_text - extra instructions appended to the built-in enhancement prompt ("make it moody and cinematic", "keep it under 30 words"). You can lean on the built-in behavior with this left empty, but this is where the node actually becomes useful.
    • enable_chatgpt - the on/off toggle described above.

    The single output, updated_prompt (a STRING), wires straight into a CLIP Text Encode node's text input - or whatever text encoder your checkpoint uses. Note the node is flagged as an output node, so it behaves like a graph endpoint, but the string output is very much meant to keep flowing into the graph.

    Install

    Standard stuff. Through ComfyUI Manager, search for ComfyUI_ChatGptHelper and install. Or the manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/AIExplorer25/ComfyUI_ChatGptHelper
    

    Then install the one real dependency and restart ComfyUI:

    cd ComfyUI/custom_nodes/ComfyUI_ChatGptHelper
    pip install -r requirements.txt   # requirements.txt is literally just: openai
    

    No model files to download, no GPU requirements. The node appears in the utils category.

    Where people get burned

    This is a small, barely-known pack - the author's own launch post on r/comfyui sits at one upvote and zero comments - so keep expectations modest and watch the sharp edges.

    The API key lives in the workflow. The key is an input widget, which means it's baked into your workflow JSON, and ComfyUI embeds the workflow into the PNG metadata of every image you save. Share that PNG on Discord or Civitai and you've handed someone a live OpenAI key with your billing attached. This is not hypothetical - it's the same class of mistake the community learned the hard way with LLM-adjacent custom nodes. Use a throwaway key with a hard spending cap, and strip it from the workflow JSON before sharing, or just re-paste your key from a fresh env per run.

    Every generation costs money. It's the gpt-4 API endpoint, which is paid and not the cheapest way to rewrite a sentence. The cache keeps identical runs free, but any edit to the prompt is a new billable call.

    The model is hardcoded to gpt-4. You can't switch to a cheaper modern model without editing the source. In 2026, gpt-4 is an old workhorse, and that's a real annoyance - one more reason to shop around.

    Your prompt leaves your machine. Anything you feed it goes to OpenAI's servers, so don't run client work through it. If the paid-and-cloudy angle bugs you, the community's usual answer is a local LLM instead - Ollama, LM Studio, or a node pack wrapping a local model - same idea, no API key, no per-call fee, nothing leaking. That's the direction most people end up in.

    Categoryutils

    Inputs (4)

    NameTypeDefaultDescription
    enable_chatgptBOOLEANtrue
    chatgpt_api_keySTRING
    input_prompt_textSTRING
    chatgpt_instruction_textSTRING

    Outputs (1)

    NameTypeDescription
    updated_promptSTRING