GPT Image 2 — Generate
The closed model that just works, for a price
- IMAGE
Let's be honest about what this node is: it's a phone, not a sampler. You type a prompt, it calls OpenAI's gpt-image-2 API, and the image comes back and lands in your graph as if a local checkpoint had made it. No VRAM, no model download, no ControlNet wiring. The price is that every image is a billed API call, and the one thing you absolutely need is an OPENAI_API_KEY.
That's the trade this whole pack makes, and it's worth being clear-eyed about it. GPT Image 2 has no open weights - there is no local door, so this isn't a convenience you're trading away, it's the only way in. People reach for it for exactly the things local models still fumble: sharp text rendering, coherent layout, and genuinely useful spritesheets and grids (the community was posting those within days of the model landing in ComfyUI). If you want that inside a larger workflow, next to your local upscaler and masking, this is how it gets there.
How it works
Mechanically it's boring in the best way. The node gathers your prompt, size, quality and the rest, then calls the OpenAI Python SDK's images.generate() - the same endpoint you'd hit from a script. The response comes back base64-encoded, and the node decodes it into a standard ComfyUI IMAGE tensor, padding frames to a common size and stacking them into a batch when you ask for more than one. Output is a normal IMAGE, so it wires straight into a preview, a save node, or anything else you already have downstream.
The model dropdown runs from gpt-image-2 (default) back through gpt-image-1.5, gpt-image-1, and the cost-optimized gpt-image-1-mini. There's also a pinned gpt-image-2-2026-04-21 snapshot so your results don't drift as OpenAI updates the floating alias - a small touch, but the right instinct for reproducible work.
The inputs you'll actually set:
- prompt - multiline, and the pack's frontend code makes the box taller so long prompts don't hide behind a one-line widget.
- size -
1024x1024by default. The dropdown goes up to3840x2160/2160x3840, but onlygpt-image-2accepts those big ones. Pick a 2K/4K size with a 1.x model and the API rejects the call, so you're not guessing. - quality -
auto,low,medium,high.highis the default and where most of the money goes. - n - 1 to 8 images per call. Each one bills separately.
- output_format - png, jpeg, or webp; the
output_compressionslider only kicks in for the latter two.
moderation (auto/low) is OpenAI's moderation toggle - low disables the automatic filter, which is not a jailbreak, just fewer refusals on things the model itself still won't do.
Installing it
Either route works. ComfyUI Manager → Install via Git URL with https://github.com/graedance/comfyui-gpt-image-2, or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/graedance/comfyui-gpt-image-2.git
cd comfyui-gpt-image-2
pip install -r requirements.txt
The dependency list is genuinely light - openai>=1.54.0 and Pillow, nothing that fights your environment. Portable Windows builds swap pip for ..\..\python_embeded\python.exe -m pip install -r requirements.txt. Restart ComfyUI and the nodes live under OpenAI/GPT-Image-2 in the Add Node menu.
Then set your key once, so it never lands in a workflow file:
echo 'export OPENAI_API_KEY="sk-..."' >> ~/.zshrc
source ~/.zshrc
You can paste a key into the node's api_key input instead, but the README is right to warn you: it gets saved into the workflow JSON. That's a credential sitting in a file you'll share and sync. Don't.
The part nobody warns you about
Every generation is a metered call, and the community reaction to cloud nodes is roughly "fine for a model I can't run, resented as a default." Costs add up faster than you expect - which is exactly why this pack also ships an Estimate Cost node. Your prompt leaves the machine, subject to OpenAI's content policy, and an API-wrapper node is by definition the category that's already been weaponized once in this ecosystem (the LLMVISION malware). This pack is tiny and MIT-licensed, so read its single nodes.py before the first run - it's a 30-second skim and it tells you exactly what's being sent where.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | gpt-image-2 | 5 options: gpt-image-2, gpt-image-2-2026-04-21, gpt-image-1.5, gpt-image-1, gpt-image-1-mini |
| prompt | STRING | — | |
| size | COMBO | 1024x1024 | 10 options: auto, 1024x1024, 1024x1536, 1536x1024, 1792x1024, 1024x1792, +4 |
| quality | COMBO | high | 4 options: auto, low, medium, high |
| output_format | COMBO | png | 3 options: png, jpeg, webp |
| n | INT | 11–8 | — |
| background | COMBO | auto | 2 options: auto, opaque |
| moderation | COMBO | auto | 2 options: auto, low |
| output_compression | INT | 1000–100 | — |
| api_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |