ComfyUI Node

GPT-Image

Brilliant text rendering, heavy censorship

By Aryan185·Created about a year ago·Updated about a month ago· 14
GPT-Image
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • mask
  • image
model
prompt
api_key
backgroundauto
qualityauto
size1024x1024
output_formatpng
output_compression100
n_images1

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 newer gpt-image-1.5 / gpt-image-2 generations. Start with gpt-image-1 unless you specifically need the cheaper tier.
  • prompt - the whole game, same as anywhere else.
  • background - auto, transparent, or opaque. This is a genuinely useful option: transparent gives 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, or auto. Keep auto only 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.

Categoryimage/generation

Inputs (15)

NameTypeDefaultDescription
modelCOMBO4 options: gpt-image-1, gpt-image-1-mini, gpt-image-1.5, gpt-image-2
promptSTRING
api_keySTRINGDirectly put OpenAI API key or .env variable name (OPENAI_API_KEY)
backgroundCOMBOauto3 options: auto, transparent, opaque
qualityCOMBOauto4 options: auto, high, medium, low
sizeCOMBO1024x10244 options: 1024x1024, 1536x1024, 1024x1536, auto
output_formatCOMBOpng3 options: png, jpeg, webp
output_compressionINT1000–100
n_imagesINT11–10
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
maskoptMASK

Outputs (1)

NameTypeDescription
imageIMAGE