zhenzhen-gpt-image-2-official
Aspect Ratios, 4K, and Async Polling
- image1
- image2
- image3
- image4
- image5
- image6
- image7
- image8
- image9
- image10
- image11
- image12
- image13
- image14
- image15
- image16
- mask
- image
- image_url
- response
This is the flagship OpenAI image node in the Comfly pack, and the name says the important part: official. The earlier GPT Image nodes ride the proxy's reverse-engineered "default" group, which is cheap but wobbly. This one hits the real GPT Image 2 API - which is why it's the node with the grown-up parameter list: a real aspect-ratio menu, 1K/2K/4K resolution control, up to five reference images, a mask input for inpainting, and an async submit-and-poll mode so long generations don't just sit there with a spinner.
If you want GPT Image 2 and you want it to behave, this is the node. It's the one I'd wire into a product-shot or design workflow, because the resolution and aspect controls are the difference between "whatever comes back" and "the thing that fits my canvas."
How it works
Prompt (and any of image1–image5 plus an optional mask) goes to the GPT Image 2 API through the Comfly proxy. Two flavors of wait: with async_mode on (the default) the node submits the task, then polls at poll_interval seconds up to max_poll_attempts times - you can also give it a webhook and let the proxy call you instead. With async off, it's the blocking request/response style. Either way you get an IMAGE tensor, a hosted image_url, and the raw response.
The inputs that matter
- model -
gpt-image-2(default),gpt-image-2-vip, plus the newergpt-image-2-2Kandgpt-image-2-4Kvariants. The 2K/4K model names bake the resolution into the model, so pair them with the rightresolutionsetting (the README notes these are pay-per-tier). - aspect_ratio - thirteen ratios from
21:9to9:16, default1:1. This is the control the earlier GPT Image nodes don't give you - pick your canvas instead of cropping afterward. - resolution -
1k/2k/4k, default1k. Bigger costs more; 2K is the sweet spot for anything you'll actually use. - image1–image5 - reference images. GPT Image 2 edits and composites from these; wire in your subject or style reference.
- mask - a MASK input for proper inpainting: mask the region you want regenerated.
- quality / background / output_format / output_compression - the usual quality triad.
output_compression(0–100, default100) trades file size for fidelity;backgroundhere is justauto/opaque(the transparent trick is the plaingpt_imagenode's game). - moderation -
auto/low. - async_mode, webhook, max_poll_attempts, poll_interval, max_retries, initial_timeout - the reliability toolkit. If generations keep timing out, raise
initial_timeout(default900) ormax_poll_attemptsrather than crossing your fingers. - seed - reproducible takes; n - 1–10 images (billed per image).
Outputs: image (IMAGE), image_url (STRING), response (STRING).
Install
Manager → Comfyui_Comfly, or:
cd ComfyUI/custom_nodes
git clone https://github.com/ainewsto/Comfyui_Comfly
Restart. Usual requirements.txt (aiohttp, requests, Pillow, numpy, plus the torch/transformers you already run) - no weights to fetch. Key from ai.comfly.chat in Comflyapi.json or the node's api_key.
Where people get burned
The trap is forgetting you configured a 4K, high-quality, n=4 run and then wondering why the credit meter moved a lot. Also, async_mode means the node can sit polling for a while - if you're running a big batch, bump poll_interval a bit so you're not hammering the status endpoint. And the VIP/4K model tiers are real price steps, so read the proxy's price list before you make "gpt-image-2-4K" your default.
Inputs (35)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| image5opt | IMAGE | — | |
| image6opt | IMAGE | — | |
| image7opt | IMAGE | — | |
| image8opt | IMAGE | — | |
| image9opt | IMAGE | — | |
| image10opt | IMAGE | — | |
| image11opt | IMAGE | — | |
| image12opt | IMAGE | — | |
| image13opt | IMAGE | — | |
| image14opt | IMAGE | — | |
| image15opt | IMAGE | — | |
| image16opt | IMAGE | — | |
| maskopt | MASK | — | |
| api_keyopt | STRING | — | |
| modelopt | COMBO | gpt-image-2 | 4 options: gpt-image-2, gpt-image-2-all, gpt-image-2-2K, gpt-image-2-4K |
| nopt | INT | 11–10 | — |
| qualityopt | COMBO | auto | 4 options: auto, high, medium, low |
| sizeopt | COMBO | auto | 8 options: auto, 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, +2 |
| backgroundopt | COMBO | auto | 2 options: auto, opaque |
| output_formatopt | COMBO | png | 3 options: png, jpeg, webp |
| output_compressionopt | INT | 1000–100 | — |
| moderationopt | COMBO | auto | 2 options: auto, low |
| async_modeopt | BOOLEAN | true | — |
| webhookopt | STRING | — | |
| max_poll_attemptsopt | INT | 30010–1000 | — |
| poll_intervalopt | INT | 52–60 | — |
| max_retriesopt | INT | 51–10 | — |
| initial_timeoutopt | INT | 90060–1200 | — |
| seedopt | INT | 00–18446744073709550000 | — |
| skip_erroropt | BOOLEAN | false | 开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。 |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_url | STRING | — |
| response | STRING | — |