load_openAI _O
The honest guide to this pack's OpenAI client
- CLIENT
load_openAI _O is the entry point to the advanced OpenAI suite in the Quality of Life Suit pack. You run this node, it hands you a CLIENT, and you feed that client into Chat_Message _O / combine_chat_messages _O / Chat completion _O to build multi-turn ChatGPT conversations (or the DALL-E 2 image nodes) inside your workflow. Think of it as the "load model" node, except the model lives on a server you're paying for.
Let me be straight about this pack's OpenAI story before you sink time into it. The pack's own metadata warns that it doesn't track the newest OpenAI API cleanly, and the defaults tell a specific story: the base_url field is pre-filled with https://openai-cf.realnow.workers.dev/v1 - a community Cloudflare-worker proxy, not OpenAI's official https://api.openai.com/v1. The pack's simple ChatGPT nodes even default to a Cloudflare @cf/meta/llama-2-7b-chat-int8 model. In other words, this suite was built for a specific third-party proxy setup, and the README's "just add your OpenAI key" gloss hides real setup work. It can work with a real OpenAI key - but you have to change base_url to the official endpoint and pick an OpenAI model name yourself.
How it works
The node does three things when it runs:
- Lazy-installs the
openaiPython package if it's missing (pip install openaiunder the hood). - Builds an
OpenAI(api_key=..., base_url=...)client from your inputs. - Returns that client as the
CLIENToutput.
The two inputs are the whole config:
base_url(STRING) - the API endpoint. Default is the Cloudflare proxy mentioned above. Set it tohttps://api.openai.com/v1for official OpenAI, or any OpenAI-compatible endpoint (there are plenty of local and hosted options that speak the same API).api_key(STRING) - your key, typed into the widget. Gotcha: despite what the README implies aboutconfig.json, this node does not read the key from the config file - the code path that readsconfig.jsonis commented out, and the widget value is passed straight through. An empty key means the API call fails. (The pack's simple ChatGPT nodes do read the key fromconfig.json- just not this one.)
One output: CLIENT, which only wires into this pack's other advanced OpenAI nodes.
Where it fits
This is purely an infrastructure node - it's useless alone, it exists to feed the rest of the advanced suite. Before you build anything elaborate on top of it, verify the basics with a single Chat_Message _O + Chat completion _O round trip. If that fails, re-check base_url and api_key - and note the debug messages_O node exists exactly for seeing what you're sending.
Also weigh the alternatives. This is an old, lightly-maintained pack (the repo's last real activity predates today by months), and if all you want is "an LLM writes my prompts," modern packs exist that are simpler and better maintained. Use this one if you specifically want its message-building style or the DALL-E 2 nodes - just go in eyes open.
Installing it
Part of the Quality of Life Suit pack (omar92/ComfyUI-QualityOfLifeSuit_Omar92). Install via ComfyUI Manager (search "Quality of Life Suit") or clone:
cd <ComfyUI>/custom_nodes
git clone https://github.com/omar92/ComfyUI-QualityOfLifeSuit_Omar92.git
Restart ComfyUI properly. No model files. The openai package installs itself on first use. The pack's config.json defaults autoUpdate to true, so it can pull new commits on startup - and given how rough around the edges this pack is, you may want autoUpdate: false so a pull doesn't change behaviour under you.
Common issues
- "Authentication error with my real OpenAI key." You're probably still on the Cloudflare
base_urldefault. Switch it tohttps://api.openai.com/v1. - "I put my key in config.json and it still fails." This node doesn't read it. Type the key into the
api_keywidget. - "Unknown model." The default dropdowns lean on the proxy's model list. If you're on official OpenAI, choose a real model name like
gpt-4o-mini. - "The simple ChatGPT node works but this doesn't." Different code path - simple nodes read config.json and use their own client; this node is widget-driven.
Honestly the most useful thing you can do with this article is decide whether you need this suite at all. If you do, change the base_url, put a real key in the widget, and test small.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | https://openai-cf.realnow.workers.dev/v1 | — |
| api_key | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| CLIENT | CLIENT | — |