GPT-Image
Brilliant text rendering, heavy censorship
- image_1
- image_2
- image_3
- image_4
- image_5
- mask
- image
GPT-Image is OpenAI's image model, and the reason you reach for it is one thing: it reads and writes text in images better than almost anything, and it follows a conversational prompt like a pro. Throw it into a ComfyUI workflow via this node and you get that capability without leaving the canvas - at the cost of OpenAI's notoriously unpredictable content filtering and a per-image bill.
The model is natively multimodal and prompt-driven, so "draw a poster with the headline 'TRASH PANDA RECORDS' in bold, and a raccoon in a cowboy hat on a motorcycle" works. Text rendering that would make a local SDXL/LoRA stack sweat comes out clean on the first try. That's the use case: typography, product shots, structured image edits.
How it works
The node talks to OpenAI's Images API (/v1/images/generations when there's no input image, /v1/images/edits when you attach one). Input images are converted from Comfy tensors to PNG bytes in memory - no temp files - and the model's response comes back as base64, decoded into a Comfy IMAGE. Simple request/response; no polling, no jobs.
The inputs that matter
- model -
gpt-image-1(the original API model),gpt-image-1-mini(cheaper, faster, a bit less faithful), and the newergpt-image-1.5/gpt-image-2generations. Start withgpt-image-1unless you specifically need the cheaper tier. - prompt - the whole game, same as anywhere else.
- background -
auto,transparent, oropaque. This is a genuinely useful option:transparentgives you a PNG with no background, which is gold for compositing and stickers. - quality -
auto/high/medium/low. High costs more. - size -
1024x1024,1536x1024,1024x1536, orauto. Keepautoonly when you're editing, because output size follows the input. - output_format (png/jpeg/webp) and output_compression (0–100, default 100) - the compression knob matters for jpeg/webp; leave png alone.
- n_images - 1–10 images per call. Batching is where you multiply the bill fast.
- Optional image_1..image_5 and mask - attach one image and it becomes an edit; attach a mask and it's inpainting (white area = edit region). This is the gpt-image-1 "mask and describe the change" flow.
The output
image - a single IMAGE output. Straight into a preview or save node.
Installing it
Part of the Aryan185/ComfyUI-ExternalAPI-Helpers pack:
cd ComfyUI/custom_nodes
git clone https://github.com/Aryan185/ComfyUI-ExternalAPI-Helpers.git
cd ComfyUI-ExternalAPI-Helpers
pip install -r requirements.txt
Restart ComfyUI; look under image/generation. The openai package is the dependency that matters. You need an OpenAI API key with billing - paste it in the field or set OPENAI_API_KEY in a .env file (copy .env.example) and reference the variable name.
Where people get burned
The big one is censorship. GPT-Image's filters are aggressive and, worse, unpredictable - perfectly innocent prompts get refused and reruns can flip between working and refusing. The KB's community history here is blunt: OpenAI's image gen "sucks and everything trips its baby mode content filters." If your workflow needs freedom, this isn't the node. Also note background only applies to generation, not all edit paths - keep expectations in line when you're editing an existing image.
Cost is the second thing. High quality + multiple images adds up per call, and the node doesn't warn you. Use gpt-image-1-mini and lower n_images while you're iterating, then do the final high-quality pass.
If you need typography or faithful prompt-following and can live with the filter roulette, this is a genuinely great node. If you need unfiltered, look at the open-weight side of your local install instead - the KB's whole argument is that local has caught up.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | 4 options: gpt-image-1, gpt-image-1-mini, gpt-image-1.5, gpt-image-2 | |
| prompt | STRING | — | |
| api_key | STRING | Directly put OpenAI API key or .env variable name (OPENAI_API_KEY) | |
| background | COMBO | auto | 3 options: auto, transparent, opaque |
| quality | COMBO | auto | 4 options: auto, high, medium, low |
| size | COMBO | 1024x1024 | 4 options: 1024x1024, 1536x1024, 1024x1536, auto |
| output_format | COMBO | png | 3 options: png, jpeg, webp |
| output_compression | INT | 1000–100 | — |
| n_images | INT | 11–10 | — |
| image_1opt | IMAGE | — | |
| image_2opt | IMAGE | — | |
| image_3opt | IMAGE | — | |
| image_4opt | IMAGE | — | |
| image_5opt | IMAGE | — | |
| maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |