Nodes/OmiXdev Custom Nodes/πŸ‘Ύ OpenAI Chat API πŸ”‘
ComfyUI Node

πŸ‘Ύ OpenAI Chat API πŸ”‘

OmixChatPro and the history trap nobody mentions

By omixmaxdimoΒ·Created 12 months agoΒ·Updated 3 days agoΒ· 0
πŸ‘Ύ OpenAI Chat API πŸ”‘
    • last_reply
    • chat_history
    β—„api_keyβ–Ί
    β—„user_messageHello!β–Ί
    β—„modelgpt-4.1-miniβ–Ί
    β—„resetfalseβ–Ί
    β—„send_historytrueβ–Ί

    You've got an LLM-encoded model like Z-Image or Flux 2 Klein where your prompt is read like an instruction, and you keep hand-polishing the same paragraph between generations. OmixChatPro ("πŸ‘Ύ OpenAI Chat API πŸ”‘") is the node that lets GPT answer back inside the graph: type a request, it calls OpenAI, and hands you the reply as a string you can wire anywhere a text value goes. It's part of OmiXDev, a small pack by Omid Ameri (Omix.IR) that mostly exists for its three chat nodes. Nothing here will change your life, but if you want cheap GPT in a workflow, it's a working option.

    How it works

    Under the hood it's a single openai client call. You feed a user_message, it hits chat.completions.create with the model you picked, and returns the reply text. No system prompt, no tooling, nothing fancy.

    Here's the part that bites: despite the send_history toggle and the README's "supports chat history" claim, this node never actually sends your conversation to the model. I read the source - the send_history parameter is accepted and then never used. Every call is a fresh, stateless single message. The chat_history output is just a growing text log of the conversation (lines prefixed πŸ‘€ and πŸ€–) for display or saving, not for context. If you want a node that genuinely carries a conversation, the pack's Ollama and Gemini siblings do that. This one doesn't.

    The inputs and outputs that matter

    The three you'll actually touch:

    • api_key - paste your OpenAI key. It lands in the workflow JSON, so don't share workflows with your key in them.
    • user_message - the thing you want GPT to do, e.g. "rewrite this as a detailed prompt for a full-body portrait: ..."
    • model - a hardcoded dropdown: gpt-4.1-mini (default), gpt-4.1, gpt-4o-mini. You can't type your own.

    reset clears the in-memory history; send_history exists but does nothing here, as covered.

    Both outputs are plain STRINGs: last_reply and chat_history. Wire last_reply into a Show Text / preview node, or straight into a CLIP text encode if you want to generate off what GPT wrote - that's the real use case. The author's own example workflow routes chat_history into Easy-Use's "showAnything" to watch the log.

    Installing OmiXDev

    ComfyUI Manager: search OmiXdev Custom Nodes (or install from GitHub URL) and paste https://github.com/omixmaxdimo/OmiXDev. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/omixmaxdimo/OmiXDev.git
    cd OmiXDev
    pip install -r requirements.txt
    

    Then restart ComfyUI. The requirements file pulls openai>=1.0.0 plus the SDKs the other two chat nodes need. No model downloads, nothing heavy.

    Gotchas

    • Shared history. chat_history is a class-level list, so every OmixChatPro in your whole session shares one log - two workflows running at once pollute each other. It also dies on restart.
    • Errors come back as text. A bad key or a timeout doesn't throw; it returns "❌ Error: ..." as last_reply. Feed that into a prompt encoder and you'll silently generate off the error message. Keep a preview node on the output.
    • Cost is real but small. gpt-4.1-mini is cheap per token; gpt-4.1 is the bigger ticket. For prompt-writing you almost never need the big one.

    The ecosystem lesson from the KB is worth repeating: custom nodes run arbitrary Python with no sandbox, so install small packs like this from GitHub rather than sketchy mirrors. Beyond that - it's a fine, honest little node. Just don't expect it to remember anything.

    CategoryπŸ‘Ύ OmiXDev/Chat

    Inputs (5)

    NameTypeDefaultDescription
    api_keySTRINGβ€”
    user_messageSTRINGHello!β€”
    modelCOMBOgpt-4.1-mini3 options: gpt-4.1-mini, gpt-4.1, gpt-4o-mini
    resetoptBOOLEANfalseβ€”
    send_historyoptBOOLEANtrueβ€”

    Outputs (2)

    NameTypeDescription
    last_replySTRINGβ€”
    chat_historySTRINGβ€”