Nodes/ERPK Collection/OpenAI Image Generation
ComfyUI Node

OpenAI Image Generation

GPT-Image-2 with transparent backgrounds and a revised prompt

By eRepublik-Labs·Created 11 months ago·Updated 21 days ago· 1
OpenAI Image Generation
  • client
  • image
  • revised_prompt
prompt
seed-1
modelgpt-image-2
size1024x1024
qualityauto
backgroundauto
moderationauto
n1

OpenAI Image Generation is the image side of the ERPK OpenAI section: prompt in, IMAGE tensor out, no browser tab needed. Default model is gpt-image-2, OpenAI's current flagship with 4K output and strong multilingual text rendering - which is the whole reason to pick this over a local checkpoint when you need legible text in the frame, like posters, UI mockups, or logos.

Two things make this node genuinely more useful than a bare API call. First, it outputs two values: image (the IMAGE tensor) and revised_prompt (the STRING of what OpenAI actually generated, after its internal prompt rewriting). That second output is a gift for debugging - when the result isn't what you asked for, the revised prompt shows you exactly how the model reworded your request. Wire it to a text preview and watch what's happening.

Second, the background input supports transparent. That's a real workflow unlock: generate a logo or product render directly on a transparent background, no chroma-key or background-removal step. It requires an output format that supports transparency, so pair it with png/webp handling downstream.

The inputs that matter

  • prompt - what you want
  • size - default 1024x1024, but gpt-image-2 takes arbitrary sizes: both edges divisible by 16, aspect ratio between 1:3 and 3:1, max edge 3840px. 1536x1024 is the standard landscape option
  • quality - auto/low/medium/high for the GPT Image family
  • n - 1 to 10 images per call, stacked into a batch
  • background - auto or transparent (the sleeper feature)
  • moderation - auto (default safety filters) or low (more permissive content)

Plus the shared plumbing: seed for best-effort reproducibility, client for the optional OpenAI API Config node.

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

Requires openai>=2.32.0 and an OpenAI key in ERPK Settings. Or "ERPK Custom Nodes" via ComfyUI Manager, restart, done.

Troubleshooting

The one real trap here is DALL-E. The README is blunt: DALL-E 3 shuts down on 2026-05-12, and the hd/standard quality values are legacy DALL-E options kept only for compatibility. If you load an old workflow with a DALL-E model selected, expect it to break or behave oddly - switch to a GPT-Image model. transparent background on a model or format that doesn't support it will also fail or come back opaque; the tooltip calls that out explicitly. And as with any hosted image model, n > 1 returns a batch, so use an Image node's batch controls to flip through your four or ten candidates.

CategoryERPK/OpenAI

Inputs (9)

NameTypeDefaultDescription
promptSTRINGDescription of the image to generate
seedINT-1-1–2147483647Seed for reproducible outputs (best-effort). Randomizes by default.
clientoptOPENAI_API_CLIENTOpenAI API client from OpenAI API Config node (uses API key from config)
modeloptCOMBOgpt-image-2Image generation model. gpt-image-2: latest flagship, 4K output, multilingual text. gpt-image-1.5: previous flagship, supports transparent background.
sizeoptSTRING1024x1024Image size as WIDTHxHEIGHT (e.g. "1024x1024", "1536x864"). Standard GPT Image sizes: 1024x1024, 1536x1024, 1024x1536. gpt-image-2 accepts arbitrary sizes: both edges divisible by 16, aspect ratio between 1:3 and 3:1, total pixels 655,360 to 8,294,400, max edge 3840px. Use "auto" to let the model choose.
qualityoptCOMBOautoImage quality. auto/low/medium/high for GPT Image family; hd/standard are legacy DALL-E values, kept for compatibility.
backgroundoptCOMBOautoBackground type for the generated output (GPT Image models only). 'transparent' requires an output format that supports transparency (png or webp).
moderationoptCOMBOautoContent moderation level (GPT Image models only). 'auto' uses OpenAI's default safety filters; 'low' relaxes them for permissive content.
noptINT11–10Number of images to generate per call (OpenAI supports 1-10).

Outputs (2)

NameTypeDescription
imageIMAGE
revised_promptSTRING