Nodes/Comfyui-zhenzhen/Zhenzhen GPT Image 2 S2A
ComfyUI Node

Zhenzhen GPT Image 2 S2A

Gpt-image-2, async, and refundable when it fails

By T8mars·Created about a year ago·Updated 2 days ago· 740
Zhenzhen GPT Image 2 S2A
  • image1
  • image2
  • image3
  • image4
  • image
  • image_url
  • task_id
  • response
prompt
modetext2img
api_key
modelgpt-image-2
qualityauto
sizeauto
backgroundauto
output_formatpng
moderationauto
n1
task_id
response_formaturl
seed0
skip_errorfalse

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. img2img activates the reference inputs.
  • image1image4 - 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 the official_ratio nodes 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 - url or b64_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.

Categoryzhenzhen/Openai

Inputs (18)

NameTypeDefaultDescription
promptSTRING
modeCOMBOtext2img2 options: text2img, img2img
api_keyoptSTRING
modeloptCOMBOgpt-image-24 options: gpt-image-2, gpt-image-2-all, gpt-image-2-2K, gpt-image-2-4K
image1optIMAGE
image2optIMAGE
image3optIMAGE
image4optIMAGE
qualityoptCOMBOauto4 options: auto, high, medium, low
sizeoptCOMBOauto4 options: auto, 1024x1024, 1536x1024, 1024x1536
backgroundoptCOMBOauto3 options: auto, transparent, opaque
output_formatoptCOMBOpng3 options: png, jpeg, webp
moderationoptCOMBOauto2 options: auto, low
noptINT11–4
task_idoptSTRING
response_formatoptCOMBOurl2 options: url, b64_json
seedoptINT00–2147483647
skip_erroroptBOOLEANfalse开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。

Outputs (4)

NameTypeDescription
imageIMAGE
image_urlSTRING
task_idSTRING
responseSTRING