OpenAI Image Generation
GPT-Image-2 with transparent backgrounds and a revised prompt
- client
- image
- revised_prompt
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 wantsize- default1024x1024, but gpt-image-2 takes arbitrary sizes: both edges divisible by 16, aspect ratio between 1:3 and 3:1, max edge 3840px.1536x1024is the standard landscape optionquality- auto/low/medium/high for the GPT Image familyn- 1 to 10 images per call, stacked into a batchbackground- 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.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | Description of the image to generate | |
| 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 (uses API key from config) | |
| modelopt | COMBO | gpt-image-2 | Image generation model. gpt-image-2: latest flagship, 4K output, multilingual text. gpt-image-1.5: previous flagship, supports transparent background. |
| sizeopt | STRING | 1024x1024 | Image 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. |
| qualityopt | COMBO | auto | Image quality. auto/low/medium/high for GPT Image family; hd/standard are legacy DALL-E values, kept for compatibility. |
| backgroundopt | COMBO | auto | Background type for the generated output (GPT Image models only). 'transparent' requires an output format that supports transparency (png or webp). |
| moderationopt | COMBO | auto | Content moderation level (GPT Image models only). 'auto' uses OpenAI's default safety filters; 'low' relaxes them for permissive content. |
| nopt | INT | 11–10 | Number of images to generate per call (OpenAI supports 1-10). |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| revised_prompt | STRING | — |