Nodes/ERPK Collection/OpenAI Image Generation (Responses)
ComfyUI Node

OpenAI Image Generation (Responses)

Let a reasoning model do the prompt-drawing

By eRepublik-Labs·Created 11 months ago·Updated 21 days ago· 1
OpenAI Image Generation (Responses)
  • client
  • image
  • revised_prompt
  • reasoning_summary
prompt
seed-1
mainline_modelgpt-5.5
image_modelgpt-image-2
reasoning_effortnone
verbositydefault
size1024x1024
qualityauto
backgroundauto
output_formatpng
moderationauto
enable_web_searchfalse

This is the fancier cousin of plain image generation. Instead of sending your prompt straight to an image model, OpenAI Image Generation (Responses) routes it through a mainline reasoning model (gpt-5.5 by default) that interprets, revises, and optionally web-searches before the actual pixel-generation model draws. The pitch: your throwaway prompt in, a properly art-directed prompt out. The cost: you're paying for two models and sometimes a web-search tool call per image.

It's part of the ERPK Collection, the community pack wrapping the OpenAI API for ComfyUI. If you've seen the "Responses API" name and wondered how it slots into a ComfyUI workflow - this is the slot.

How it works

The node calls OpenAI's Responses API with the image_generation hosted tool. The mainline_model (gpt-5.5) receives your prompt, can reason about it, and then invokes image_model (gpt-image-2 by default) to produce pixels. Two outputs capture what happened along the way:

  • image - the result as a ComfyUI IMAGE tensor, ready to Save or Preview.
  • revised_prompt - what the mainline model actually sent to the image model. This is gold: it shows you the gap between what you typed and what was drawn.
  • reasoning_summary - the model's reasoning. The tooltip's warning is worth quoting: with reasoning enabled this contains raw chain-of-thought, which is often orchestration-level thinking rather than creative rationale. Read it with skepticism.

The inputs that matter

  • prompt - your image description. The mainline model may auto-revise it, so you can be sloppier than with a direct endpoint - that's the whole point.
  • mainline_model - gpt-5.5 default, or gpt-5.4 to save money. This picks prompt interpretation and reasoning quality, not pixels.
  • image_model - the actual drawing model, gpt-image-2 default.
  • reasoning_effort - none to xhigh. Default none skips reasoning entirely (cheapest, fastest). Turn it up only when prompt interpretation is the bottleneck.
  • enable_web_search - adds a web_search tool alongside image generation, so the model can look up references first. Costs an extra $10/1000 calls when it actually invokes it. Overkill for most work, great for "draw this historical thing accurately."
  • size / quality / background / output_format / moderation - the image knobs. Note background: transparent gets auto-coerced to opaque on gpt-image-2 with a warning log; that model rejects transparency.
  • seed - cache-busting only, randomizes by default.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/eRepublik-Labs/comfyui-nodes-erpk.git erpk
cd erpk
pip install -r requirements.txt

Or ComfyUI Manager → search erpkERPK Custom Nodes. OpenAI key via right-click canvas > ERPK Settings (Settings > ERPK > API Keys); the client input is optional if it's set there.

Common issues

  • Bills that surprise you - two models plus possible web search. Start with reasoning_effort: none and enable_web_search: false; add both only when the prompt quality actually demands it.
  • Image never appears - check the revised_prompt output first; if that's empty, the mainline call failed (often moderation). The dashboard error is your friend.
  • "transparent" background silently ignored - gpt-image-2 rejects it and the node coerces to opaque with a warning. Use gpt-image-1.5 if you genuinely need transparency.
  • Reasoning spam in reasoning_summary - expected. That output is for debugging the orchestration, not for reading as a creative brief.

For simple one-shot images, the direct generation node is cheaper and you don't need this. Reach for the Responses variant when your prompts are ambitious, vague, or reference knowledge the model should look up - that's the regime where a reasoning model earns its fee.

CategoryERPK/OpenAI

Inputs (13)

NameTypeDefaultDescription
promptSTRINGImage description. The mainline model may auto-revise it before passing to the image model.
seedINT-1-1–2147483647Cache-bust seed. Randomizes by default.
clientoptOPENAI_API_CLIENTOpenAI API client from OpenAI API Config node
mainline_modeloptCOMBOgpt-5.5Text/reasoning model that drives the Responses API call. Not the image model — this picks prompt interpretation, reasoning, and (optionally) web search. gpt-5.5 is the current premium flagship with the highest reasoning tier; gpt-5.4 is a cheaper alternative for cost-sensitive workflows.
image_modeloptCOMBOgpt-image-2Underlying GPT Image model used for pixel generation inside the tool.
reasoning_effortoptCOMBOnoneMainline-model reasoning depth. 'none' skips reasoning (cheapest, fastest). 'low' to 'xhigh' increase prompt-interpretation quality at token cost. Only supported by reasoning-capable mainline models (gpt-5.x, o3, o4-mini). Note: when enabled, reasoning_summary output contains the model's raw chain-of-thought, which often includes orchestration-level thinking (output channels, response format) rather than only creative rationale.
verbosityoptCOMBOdefaultMainline-model output verbosity (gpt-5.x family). Shapes how chatty the response is independent of max_tokens. 'default' lets the model pick. Silently dropped for older mainlines.
sizeoptCOMBO1024x1024Image size. Same constraints as direct endpoint (gpt-image-2: min 655,360 pixels).
qualityoptCOMBOautoImage quality tier.
backgroundoptCOMBOautoBackground type. gpt-image-2 rejects 'transparent' — auto-coerced to 'opaque' with a warning log.
output_formatoptCOMBOpngOutput image format.
moderationoptCOMBOautoContent moderation level. 'low' relaxes default safety filters.
enable_web_searchoptBOOLEANfalseAdd the web_search tool alongside image_generation. The mainline model can decide to look up reference material before generating. Adds $10/1000 calls when the model actually invokes it.

Outputs (3)

NameTypeDescription
imageIMAGE
revised_promptSTRING
reasoning_summarySTRING