Nodes/ERPK Collection/OpenAI Text Generation
ComfyUI Node

OpenAI Text Generation

LLM calls where you actually need reproducibility

By eRepublik-Labs·Created 11 months ago·Updated 20 days ago· 1
OpenAI Text Generation
  • client
  • response
prompt
seed-1
modelgpt-5.6-sol
temperature0.70
max_tokens4096
top_p1.00
stop_sequences
response_formatdefault
reasoning_effortnone
verbositydefault

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 request
  • seed - fixed value for reproducible runs, -1 for random
  • model - defaults to gpt-5.6-sol; the combo spans the GPT-5.x family, GPT-4o, GPT-4.1, and o-series reasoning models
  • temperature - 0 to 2, default 0.7
  • max_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.

CategoryERPK/OpenAI

Inputs (11)

NameTypeDefaultDescription
promptSTRINGText prompt for OpenAI
seedINT-1-1–2147483647Seed for reproducible outputs (best-effort). Randomizes by default.
clientoptOPENAI_API_CLIENTOpenAI API client from OpenAI API Config node (optional if API key is configured in Settings)
modeloptCOMBOgpt-5.6-solOpenAI model to use for generation
temperatureoptFLOAT0.700–2Creativity level (0.0=focused, 2.0=very creative)
max_tokensoptINT4096256–16384Maximum length of response
top_poptFLOAT1.000–1Nucleus sampling - cumulative probability threshold (1.0=disabled)
stop_sequencesoptSTRINGStop generation at these sequences (one per line, leave empty to disable)
response_formatoptCOMBOdefaultOutput format (use json_object for JSON mode)
reasoning_effortoptCOMBOnoneReasoning depth for o-series and gpt-5.x reasoning models. Ignored by non-reasoning models.
verbosityoptCOMBOdefaultOutput 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)

NameTypeDescription
responseSTRING