BYOKey GPT Image (OpenAI)
GPT Image and DALL·E 3 in ComfyUI without Comfy's credit meter
- image
- mask
- image
OpenAI's image models - GPT Image 2, and DALL·E 3 for the retro route - are closed, so the only way they get into a ComfyUI graph is through a node that calls the API. BYOKey_ImageGen is that node, minus the middleman: it's the drop-in equivalent of the official OpenAI image node, but it hits api.openai.com with your own key (no Comfy proxy, no prepaid credits). You pay OpenAI's rates directly, and the node returns a real ComfyUI IMAGE tensor that flows into the rest of your graph like any local generation.
This is the classic "closed model inside an open workflow" move the KB covers: you can't run GPT Image on your GPU, so if you want its text rendering and scene coherence alongside your local upscaler and masking, this is the door. GPT Image is genuinely good at text-in-image and following complex prompts - its fidelity jumped a lot from the earlier 4o/DALL·E generation.
How it works
Text-to-image uses images/generations; if you wire in a reference image (or a mask), it switches to images/edits multipart and does an edit/inpaint instead - the mask's white areas get replaced, and the tooltip requires exactly one reference image for that mode. Responses are decoded back into an IMAGE tensor. Nothing runs locally; the generation happens on OpenAI's servers.
The inputs that matter
model-gpt-image-2(default),gpt-image-1.5,gpt-image-1, ordall-e-3. Everything fancy below is gpt-image-2 territory.size- presets from1024x1024up to3840x2160, plusautoandCustom. Choosing Custom unlockscustom_width/custom_height(1024–3840, must be a multiple of 16) - gpt-image-2 only.quality-low/medium/highfor the GPT models,standard/hdfor DALL·E 3. Cheap drafts at low, finals at high.background-auto/opaque/transparent; note transparent is not supported by gpt-image-2.n(1–8) - how many images per call.style(natural/vivid) is DALL·E 3 only.image+mask- the edit/inpaint path described above.
One honest footnote: seed is in the schema but the tooltip says it's "not implemented yet in backend." Set it if you like, just don't expect reproducibility from OpenAI.
Output is image (IMAGE) - wire it straight into a preview, an upscaler, an image-to-video node, whatever.
Installing it
It's one of 37 nodes in comfyui-byokey, and the pack has no extra dependencies - just what ComfyUI bundles (torch, aiohttp, PIL, numpy, av). Install via ComfyUI Manager (search "byokey") or:
cd ComfyUI/custom_nodes
git clone https://github.com/MeteorAndy/comfyui-byokey.git
Restart, and it's under api/byokey/image. No model files, no GPU needed.
Gotchas
The per-call cost is the thing people forget. A high-quality 2K+ generation adds up fast when you're iterating, and unlike a local model there's no "free after the electricity" - the KB's notes on API nodes are blunt that video jobs and high-res images are where a session gets expensive. Also, this is OpenAI: content filtering follows the model, not the node, so anything OpenAI refuses locally will refuse here - there's no bypass because there are no weights to edit. And the pack-standard security note: your key lives in the widget and gets saved into the workflow JSON, so scrub it before sharing workflows. This category of "one node, paste your key" pack has a documented malware history, and the only sane habit is reading the source - this one's open and short. If you need GPT's image quality in your ComfyUI pipeline and already pay OpenAI, this is the cleanest way in.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| api_key | STRING | Your OpenAI API key (sk-...). | |
| base_url | STRING | https://api.openai.com/v1 | OpenAI-compatible API base URL. Override for relays/proxies. |
| prompt | STRING | Text prompt for GPT Image. | |
| model | COMBO | gpt-image-2 | The OpenAI image model to use. |
| size | COMBO | auto | Image size. Select 'Custom' to use custom width/height (gpt-image-2 only). |
| quality | COMBO | low | Image quality. GPT Image: low/medium/high. DALL-E 3: standard/hd. |
| background | COMBO | auto | Return image with or without background. 'transparent' is not supported by gpt-image-2. |
| n | INT | 11–8 | How many images to generate. |
| seed | INT | 00–2147483647 | not implemented yet in backend |
| custom_widthopt | INT | 10241024–3840 | Used only when size is 'Custom'. Multiple of 16 (gpt-image-2 only). |
| custom_heightopt | INT | 10241024–3840 | Used only when size is 'Custom'. Multiple of 16 (gpt-image-2 only). |
| styleopt | COMBO | natural | DALL-E 3 only. Vivid leans hyper-real/dramatic; natural is more natural. |
| imageopt | IMAGE | Optional reference image(s) for editing (gpt-image-* only). | |
| maskopt | MASK | Optional inpaint mask (white areas replaced). Requires exactly one reference image. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |