Nodes/Comfyui-zhenzhen/zhenzhen-gpt-image-2-official_ratio
ComfyUI Node

zhenzhen-gpt-image-2-official_ratio

Gpt-image-2, every aspect ratio, up to sixteen reference images

By T8mars·Created about a year ago·Updated 3 days ago· 749
zhenzhen-gpt-image-2-official_ratio
  • image1
  • image2
  • image3
  • image4
  • image5
  • image6
  • image7
  • image8
  • image9
  • image10
  • image11
  • image12
  • image13
  • image14
  • image15
  • image16
  • mask
  • image
  • image_url
  • response
◄prompt—►
◄aspect_ratioauto►
◄resolution1k►
◄api_key►
◄modelgpt-image-2►
◄n1►
◄qualityauto►
◄backgroundauto►
◄output_formatpng►
◄output_compression100►
◄moderationauto►
◄response_formaturl►
◄async_modetrue►
◄webhook►
◄max_poll_attempts300►
◄poll_interval5►
◄max_retries5►
◄initial_timeout900►
◄seed0►
◄skip_errorfalse►

The official_ratio node is the one you want when gpt-image-2 needs to come out at a specific aspect ratio - including the weird ones. Thirteen ratio choices from auto through the cinematic 21:9 and portrait 9:16, three resolutions (1k/2k/4k), and up to sixteen reference images plus an optional MASK for editing. If you're building a consistent visual asset set - a product line, a storyboard, a social-media batch where every image has to fit a specific crop - this is the node.

That "sixteen inputs" number is the standout. Most gpt-image-2 wrappers stop at four or five; this one takes a whole folder's worth and lets the model reason across them. The changelog shows the pack author bumping it from 5 to 16 and adding skip_error, so it's been shaped by real usage.

The inputs that matter

  • prompt - the instruction, plus aspect_ratio and resolution - the required core.
  • image1–image16 and mask - the reference/edit material. With a mask (MASK tensor) it's a localized edit; without, whole-image.
  • model - gpt-image-2, gpt-image-2-all, gpt-image-2-2K, or gpt-image-2-4K. The -2K/-4K variants are the pack's dedicated high-res lanes, added as stable fallbacks.
  • n - 1 to 10 images per call. Meter runs per image.
  • quality, background (auto/opaque), output_format, output_compression (0–100), moderation.
  • response_format - url or b64_json; the README suggests url if you're sending many reference images (lighter payload).
  • async_mode (default true) - goes through the relay's async task queue, with poll_interval, max_poll_attempts, max_retries, and initial_timeout controlling the wait. webhook if you want a callback instead.

Outputs: image (IMAGE tensor), image_url, 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.

The part the README yells about

This is an official-route node, and the official route cares about your token group. The README is explicit: for 2K/4K stability you want the openai优质 premium group on your token; the default group silently walks the cheaper reverse-engineered lane and will give you slow or failed high-res jobs. Get the group right on the website before you blame the node. And since async is on by default, remember the timeout rule the pack documents everywhere: if ComfyUI gives up, the job is often still cooking on the server - check the site's async task list and pull the result from there rather than paying twice. Sixteen reference images is a lot of context leaving your machine; treat the node accordingly.

Categoryzhenzhen/Openai

Inputs (37)

NameTypeDefaultDescription
promptSTRING—
aspect_ratioCOMBOauto14 options: auto, 1:1, 3:2, 2:3, 4:3, 3:4, +8
resolutionCOMBO1k3 options: 1k, 2k, 4k
image1optIMAGE—
image2optIMAGE—
image3optIMAGE—
image4optIMAGE—
image5optIMAGE—
image6optIMAGE—
image7optIMAGE—
image8optIMAGE—
image9optIMAGE—
image10optIMAGE—
image11optIMAGE—
image12optIMAGE—
image13optIMAGE—
image14optIMAGE—
image15optIMAGE—
image16optIMAGE—
maskoptMASK—
api_keyoptSTRING—
modeloptCOMBOgpt-image-24 options: gpt-image-2, gpt-image-2-all, gpt-image-2-2K, gpt-image-2-4K
noptINT11–10—
qualityoptCOMBOauto4 options: auto, high, medium, low
backgroundoptCOMBOauto2 options: auto, opaque
output_formatoptCOMBOpng3 options: png, jpeg, webp
output_compressionoptINT1000–100—
moderationoptCOMBOauto2 options: auto, low
response_formatoptCOMBOurl2 options: url, b64_json
async_modeoptBOOLEANtrue—
webhookoptSTRING—
max_poll_attemptsoptINT30010–1000—
poll_intervaloptINT52–60—
max_retriesoptINT51–10—
initial_timeoutoptINT90060–1200—
seedoptINT00–18446744073709550000—
skip_erroroptBOOLEANfalse开启后,节点失败时不报错、按旧行为返回默认空结果;关闭时(默认)失败直接抛出错误。

Outputs (3)

NameTypeDescription
imageIMAGE—
image_urlSTRING—
responseSTRING—