Zhenzhen GPT Image 2 S2A
Gpt-image-2, async, and refundable when it fails
- image1
- image2
- image3
- image4
- image
- image_url
- task_id
- response
The README has exactly one piece of blunt advice for gpt-image-2 on this pack: "注意一定要用这个新的" - make sure you use the new one. That new one is Comfly_gpt_image_2_S2A, and the reason it's the recommended path is the S2A (sync-to-async) design: every job runs through the relay's async task queue, which matters for two concrete reasons. First, a long generation doesn't pin your graph - ComfyUI can keep working while the server renders. Second, and this is the part people actually care about, async-task failures refund your credits. The old sync/chat path would bill you and leave you holding a dead job.
At 0.04 credits per run (the changelog's number), it's cheap enough to use as a default - and it covers text-to-image (text2img) and image editing (img2img) in one node.
The inputs that matter
- prompt and mode - required.
img2imgactivates the reference inputs. - image1–image4 - up to four reference images for editing.
- model -
gpt-image-2,gpt-image-2-all,gpt-image-2-2K,gpt-image-2-4K. - quality -
auto/high/medium/low. - size -
auto,1024x1024,1536x1024,1024x1536. (For full aspect-ratio control you want theofficial_rationodes instead.) - background (
auto/transparent/opaque), output_format, moderation, n (1–4). - task_id - the async handle. Leave empty to submit; paste a previous one to fetch a finished result without re-paying.
- response_format -
urlorb64_json; seed for reproducibility.
Outputs: image, image_url, task_id (your receipt and refetch key - save it), and response.
Install and key
cd ComfyUI/custom_nodes
git clone https://github.com/T8mars/Comfyui-zhenzhen
Restart, or ComfyUI Manager → "Comfyui-zhenzhen". Key from ai.t8star.org.
Using the async loop properly
The whole point of S2A is that "the node finished" and "the job finished" are different events. If ComfyUI throws a timeout, go to the site's async task list, find the task_id, and the result is usually there waiting - download it or re-run the node with the task_id pasted in. And if the job genuinely failed, you're refunded, which is the reliability advantage over the sync path. Same family rules: premium openai优质 token group for stable 2K/4K, transient 500s re-run clean, and your prompt and reference images leave the machine. For day-to-day gpt-image-2 work, this is the node the author actually wants you using.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| mode | COMBO | text2img | 2 options: text2img, img2img |
| 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 |
| image1opt | IMAGE | — | |
| image2opt | IMAGE | — | |
| image3opt | IMAGE | — | |
| image4opt | IMAGE | — | |
| qualityopt | COMBO | auto | 4 options: auto, high, medium, low |
| sizeopt | COMBO | auto | 4 options: auto, 1024x1024, 1536x1024, 1024x1536 |
| backgroundopt | COMBO | auto | 3 options: auto, transparent, opaque |
| output_formatopt | COMBO | png | 3 options: png, jpeg, webp |
| moderationopt | COMBO | auto | 2 options: auto, low |
| nopt | INT | 11–4 | — |
| task_idopt | STRING | — | |
| response_formatopt | COMBO | url | 2 options: url, b64_json |
| seedopt | INT | 00–2147483647 | — |
| skip_erroropt | BOOLEAN | false | 开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。 |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| image_url | STRING | — |
| task_id | STRING | — |
| response | STRING | — |