Simple LLM Config: OpenAI
The default dials, with gpt-4.1-mini already picked for you
- LLM_CONFIG
This is the config node most people hit first when they open this pack's LLM family, because OpenAI is the default answer to "which provider do I use?" Simple LLM Config: OpenAI builds the LLM_CONFIG object that points a workflow at OpenAI's chat API - provider, model, temperature, token cap. It's a plain settings node; the network call happens later, when you feed this into an agent and run a prompt.
The default model, gpt-4.1-mini, is a genuinely good pick and not just a default-for-default's-sake. It's cheap enough to experiment with and plenty smart for prompt-building, summarizing, and workflow logic. The dropdown also includes gpt-4.1 and gpt-4o for bigger jobs, gpt-4o-mini/gpt-4.1-nano for ultra-cheap work, and the reasoning models o3-mini and o4-mini if you want the model to think out loud before answering - at the cost of speed.
How it works
The node packs driver: "openai" with your model, temperature, and max_tokens into a dict and emits LLM_CONFIG. At run time the pack's OpenAI driver POSTs to OpenAI's /v1/chat/completions using plain requests - no OpenAI SDK required. For the key it checks the api_key input, then falls back to the OPENAI_API_KEY environment variable. One quirk: the reasoning models (o3-mini, o4-mini) get the same temperature/max_tokens treatment as the chat models, which isn't how OpenAI's own API ideally wants them handled - expect some quirks on those two.
The inputs that matter
- model - seven-option dropdown, default
gpt-4.1-mini. Start there; go up togpt-4.1when quality matters more than cost. - temperature - 0 to 2.0, default 0.7. Lower for deterministic, structured output.
- max_tokens - 1 to 16384, default 2000. The reply-length cap.
- api_key (optional) - leave blank and use the
OPENAI_API_KEYenv var instead. Keys typed into widgets get embedded in saved workflow files and shipped around with them - a real leak vector when you share workflow images.
Output: a single LLM_CONFIG that feeds Simple LLM Agent or Simple LLM: Agent with Rules.
Installing the pack
# ComfyUI Manager → Install via Git URL:
https://github.com/NakamuraShippo/ComfyUI-NS-Util
# or:
cd ComfyUI/custom_nodes
git clone https://github.com/NakamuraShippo/ComfyUI-NS-Util
pip install pyyaml watchdog
Restart ComfyUI. No model downloads - cloud provider. Pack requirements are just pyyaml/watchdog/opencv. ComfyUI 0.3+ recommended.
Common issues
"Error: OpenAI API key not set" at run time means the env var is missing or empty - set OPENAI_API_KEY or fill the widget. If o3-mini/o4-mini misbehave (rejected requests, odd output), that's the reasoning-model quirk above; fall back to gpt-4.1-mini unless you specifically need them. And if a long reply cuts off, raise max_tokens rather than re-running.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | gpt-4.1-mini | 7 options: gpt-4.1-nano, gpt-4.1-mini, gpt-4.1, gpt-4o-mini, gpt-4o, o4-mini, +1 |
| temperature | FLOAT | 0.70–2 | — |
| max_tokens | INT | 20001–16384 | — |
| api_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LLM_CONFIG | LLM_CONFIG | — |