OpenAI Text Generation
LLM calls where you actually need reproducibility
- client
- response
OpenAI Text Generation is the general-purpose LLM node in the ERPK OpenAI section: prompt in, text out, wired straight into your graph. It's the workhorse you'd use to generate a caption, summarize a scene, draft a product description for your image pipeline, or rewrite a prompt before it hits an image model. Where it beats typing into chat.openai.com is that the result is a STRING on the canvas - it can feed any text input anywhere, including another LLM call in a chain.
What separates this node from the pack's other text generators is the seed widget. It's right there in the required inputs, default -1 (random). Set a fixed value and OpenAI returns reproducible output on a best-effort basis - the tooltip says "best-effort," which is OpenAI's polite way of saying don't build production on it, but for workflow debugging and sharing exact runs it's genuinely handy. That's a feature the Grok, Claude, and Gemini text nodes in this pack don't offer, and it's a big deal if you're tuning a chain and want stable results between tweaks.
The inputs that matter
prompt- the actual requestseed- fixed value for reproducible runs, -1 for randommodel- defaults togpt-5.6-sol; the combo spans the GPT-5.x family, GPT-4o, GPT-4.1, and o-series reasoning modelstemperature- 0 to 2, default 0.7max_tokens- default 4096, up to 16384
The more advanced knobs are worth knowing about even if you don't touch them immediately. reasoning_effort (none through xhigh) deepens thinking on o-series and gpt-5.x reasoning models and is silently ignored by others. verbosity shapes how chatty the response is, independently of the length cap - low gives terse answers, high verbose ones, and older models silently drop it. response_format with json_object forces JSON output, and stop_sequences stops generation at lines you list (one per line). The outputs are a single response STRING and nothing else - keep it simple.
Install
Part of the ERPK Collection:
cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk && pip install -r requirements.txt
That pulls openai>=2.32.0, the actual dependency. Or install "ERPK Custom Nodes" from ComfyUI Manager, restart, and set your OpenAI key in ERPK Settings (right-click canvas > ERPK Settings). The optional client input connects to an OpenAI API Config node if you want per-workflow key overrides.
Troubleshooting
The usual suspects apply: no key set → key-resolution error; the pack's retry logic with exponential backoff swallows transient API hiccups, so if a call just sits there, the console is where the real error text shows up. And remember the compatibility rules baked into the tooltips - if you select reasoning_effort on a non-reasoning model it's ignored silently, which reads like "the setting did nothing" if you're not expecting it. For most workflows, prompt + seed + temperature is all you'll ever set.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Text prompt for OpenAI | |
| seed | INT | -1-1–2147483647 | Seed for reproducible outputs (best-effort). Randomizes by default. |
| clientopt | OPENAI_API_CLIENT | OpenAI API client from OpenAI API Config node (optional if API key is configured in Settings) | |
| modelopt | COMBO | gpt-5.6-sol | OpenAI model to use for generation |
| temperatureopt | FLOAT | 0.700–2 | Creativity level (0.0=focused, 2.0=very creative) |
| max_tokensopt | INT | 4096256–16384 | Maximum length of response |
| top_popt | FLOAT | 1.000–1 | Nucleus sampling - cumulative probability threshold (1.0=disabled) |
| stop_sequencesopt | STRING | Stop generation at these sequences (one per line, leave empty to disable) | |
| response_formatopt | COMBO | default | Output format (use json_object for JSON mode) |
| reasoning_effortopt | COMBO | none | Reasoning depth for o-series and gpt-5.x reasoning models. Ignored by non-reasoning models. |
| verbosityopt | COMBO | default | Output verbosity for gpt-5.x models. 'low' produces terse responses, 'high' produces more detailed ones. Distinct from max_tokens — shapes style, not the hard length cap. 'default' lets the model choose. Silently ignored by older models that do not accept verbosity. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| response | STRING | — |