Nodes/ComfyUI-WBLESS/ToAPIs GPT Image 2 VIP
ComfyUI Node

ToAPIs GPT Image 2 VIP

GPT Image 2 in your graph, with the weird-aspect-ratio problem patched out

By LaoMaoBoss·Created about a year ago·Updated 27 days ago· 1
ToAPIs GPT Image 2 VIP
  • image_1
  • images
  • response
◄api_key►
◄api_basehttps://toapis.com►
◄prompt白色背景上的红色圆形,简洁测试图►
◄modelgpt-image-2-vip►
◄size1:1►
◄custom_size►
◄resolution1k►
◄qualitymedium►
◄backgroundauto►
◄n1►
◄timeout600►
◄poll_interval5►

GPT Image 2 dropped in April 2026 with two reputations: genuinely good at text rendering and multi-panel consistency, and stubborn about aspect ratios. That second complaint - "how much of a competitor is it, if it still will only do weird aspect ratios?" - is the hole this node plugs.

What it is

This is a cloud-call node. No model loads, no VRAM, no checkpoint. It packages your prompt (plus up to ten optional reference images), fires it at a ToAPIs endpoint running the gpt-image-2-vip mirror of GPT Image 2, and drops the results into your graph as ordinary IMAGE data - text-to-image, or up to ten-way reference image-to-image.

You reach for it for the reason anyone reaches for an API node: the model has no open weights, so local isn't an option at any VRAM. The community's take was "viable Nano Banana competitor" plus "not open source, no interest" - fair, but the text rendering is real, and this gets it into a graph that already has your local upscales.

One honest caveat. This is a reseller route, not OpenAI direct, and the pack - 27 Chinese-authored utility nodes - has essentially no Reddit footprint. The source is readable, but the warning stands: an API node holds your key and phones home by design - exactly the shape of the one custom node that got weaponized in this ecosystem.

How it works

Under the hood it's an HTTP client. It POSTs to /v1/images/generations, gets back a task id - the interface is asynchronous - then polls on poll_interval until the status flips to completed and downloads the result URLs into tensors. Rate limits back off via Retry-After, and transient 5xx responses during polling are tolerated rather than fatal.

Reference images are the interesting part. The endpoint only accepts public http(s) URLs - no base64 - so a local IMAGE gets encoded to PNG and uploaded first, via multipart/form-data to /v1/uploads/images, purely to buy a URL the generator can fetch. PNG goes first to keep alpha; past the API's 10MB cap it silently falls back to JPEG, which flattens transparency. Your references leave the machine twice over.

IS_CHANGED returns the current time, so caching is deliberately off: every queue is a real, billed API call even if you changed nothing.

The inputs that actually matter

  • api_key and api_base. Leave the key blank and the node reads TOAPIS_API_KEY from the environment instead. Keep api_base at https://toapis.com; mainland China users switch to https://toapis.cn. A wrong base is the classic 404 here.
  • prompt. Up to 32,000 characters. The default is a Chinese placeholder ("a red circle on a white background") - replace it before you queue and wonder why you got a test image.
  • size, custom_size, resolution. size covers every preset ratio plus auto; for anything else - 7:4, 1:3 - fill custom_size, which overrides the preset and is capped at a 3:1 ratio. (The 21:9 and 9:21 presets are exempt - vendor presets, not custom ratios.) resolution (1k/2k/4k) decides actual pixels; 4k tops out at 3840 on the long side.
  • quality, background, n, and the polling pair timeout / poll_interval. low drafts cheap, medium is the sane default, high is for finals. auto sends no background parameter at all; transparent only pays off if the result stays lossless on the way back. And don't set poll_interval above timeout, or you'll time out before the first poll.
  • image_1 (and friends). Connect it and a second port appears, up to ten.

Outputs are images (a list of IMAGE - downstream nodes just run once per image) and response, a JSON string with the task id, resolved settings and result URLs. It's not a terminal node, so wire images into a SaveImage or PreviewImage.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/LaoMaoBoss/ComfyUI-WBLESS.git

Restart ComfyUI, or search ComfyUI-WBLESS in ComfyUI Manager. There's no requirements.txt - the pack vendors its own cozy_comfyui and volcengine libs and falls back to stdlib logging if loguru is missing, so portable builds won't choke. Keep the key in the environment rather than the field:

export TOAPIS_API_KEY=sk-...

That matters when you share workflows - a node field travels with the .json.

When it breaks

The node translates HTTP failures into readable messages. 401 is a bad or missing key, 402 an empty balance, 403 an account that can't touch the model, 404 almost always a wrong api_base for your region, 413 a reference image past 10MB - and if that image had alpha, the JPEG fallback already ate it.

If a reference image seems ignored, check the console: the node warns explicitly when an input was wired but dropped before reaching the backend. If a transparent job comes back opaque, it's the same 10MB JPEG downgrade - shrink the reference first.

And for 4k + high jobs, raise timeout rather than debugging: the error is a timeout, not a bug.

Category🌈WBLESS

Inputs (13)

NameTypeDefaultDescription
api_keySTRINGToAPIs Bearer Token。留空时自动读取环境变量 TOAPIS_API_KEY。
api_baseSTRINGhttps://toapis.comToAPIs Base URL。中国大陆用户请使用 https://toapis.cn。
promptSTRING白色背景上的红色圆形,简洁测试图图像生成的文本描述,最长 32000 字符。
modelCOMBOgpt-image-2-vip图像生成模型名称,本节点固定为 gpt-image-2-vip。
sizeCOMBO1:1输出图像比例。preset 覆盖全部常用宽高比;需要 7:4 这类任意比例时改用 custom_size。
custom_sizeSTRING任意 宽:高 比例,非空时覆盖上方预设。宽高比最大 3:1,实际像素由 resolution 推导。
resolutionCOMBO1k输出分辨率档位:1k / 2k / 4k(4K 长边最长 3840 像素)。
qualityCOMBOmedium图片质量:low 快速省钱、medium 平衡、high 最高精度。
backgroundCOMBOauto背景样式。transparent 建议搭配 PNG 使用;auto 时不向上游发送该参数。
nINT11–10生成图像数量。
timeoutINT60030–3600轮询任务结果的总超时时间(秒)。
poll_intervalINT51–60轮询任务结果的间隔(秒)。
image_1optIMAGE参考图 1。连上后会自动追加下一个端口,最多 10 张。

Outputs (2)

NameTypeDescription
imagesIMAGE—
responseSTRING—