Nodes/ComfyUI-Nerapi/GPT-Image-2
ComfyUI Node

GPT-Image-2

GPT-Image-2 in ComfyUI, Minus the GPU (and Minus the OpenAI Account)

By Guguniaoer·Created 2 months ago·Updated 2 months ago· 0
GPT-Image-2
  • 图片1
  • 图片2
  • 图片3
  • 图片4
  • 图片5
  • 图片6
  • 图片7
  • 图片8
  • 图像
密钥
提示词
比例1:1
接口地址https://nerapi.com/v1
轮询间隔3.0
超时秒数300

Let's get the thing that matters out first: this node does not run anything on your machine. No model file, no VRAM, no CUDA. NerapiGPTImage2 is an HTTP client with a ComfyUI face - it sends your prompt to nerapi.com, a third-party API gateway, waits for OpenAI's GPT-Image-2 to render, and drops the result back into your graph as a normal IMAGE tensor. The only "heavy dependency" you'll ever install is an API key.

GPT-Image-2 is OpenAI's closed image model - the one that leaked into public discussion in early 2026 as "finally a viable Nano Banana competitor," strong at text-in-image and following fiddly prompts. You cannot download it, full stop. So if you want it sitting inside a ComfyUI workflow, next to your upscaler and your masking, your options are the official ComfyUI Partner Nodes on prepaid credits, or a third-party gateway like this one. This pack takes the reseller route: it talks to nerapi.com, which fronts the model and charges you per call from an account balance.

How it works

The mechanism is simple, and it explains the odd optional inputs. The node:

  1. POST /v1/api/generate with your prompt - the API answers with a task id.
  2. Polls GET /v1/api/result?id=... every few seconds until the job reports succeeded.
  3. Downloads the image and converts it to a ComfyUI tensor.

That's why 轮询间隔 (poll interval, default 3s) and 超时秒数 (timeout, default 300s) exist - you're watching a server, not a sampler. Resolution is fixed at 1K; the GPT-Image-2 node has no clarity selector because the gateway only exposes 1K for this model.

Inputs and outputs that matter

Only three required inputs, and only one is a secret:

  • 密钥 - your nerapi API key (sk-...), pasted from the nerapi.com dashboard.
  • 提示词 - the prompt. Multiline; English, Chinese, whatever the model handles.
  • 比例 - aspect ratio, default 1:1. The list covers auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, and 21:9.

The optional 图片1 through 图片8 are where it gets interesting - they give you image-to-image and multi-reference editing. But the model API only accepts public image URLs, not base64, so the node silently uploads each reference to nerapi's image host first. Two consequences: reference uploads also burn your account balance, and your images leave your machine to a server you don't control. Fine for a quick edit; worth knowing before you feed it anything sensitive.

There's exactly one output: 图像 (IMAGE). Wire it straight into Preview or Save Image.

One usability gotcha to flag: every label is in Chinese (密钥 = key, 提示词 = prompt, 比例 = ratio, 图片N = image N). It's not a translation gap - the author built the pack that way, audience included.

Installation

Search "ComfyUI-Nerapi" in ComfyUI Manager, or clone it:

cd ComfyUI/custom_nodes
git clone https://github.com/Guguniaoer/ComfyUI-Nerapi.git
cd ComfyUI-Nerapi
pip install -r requirements.txt

Restart ComfyUI and the node appears under Nano-Banana / GPT-Image. There are no model downloads - requirements.txt is just requests, Pillow, numpy. On a Windows integrated pack, install with its bundled Python, e.g. python_embeded\python.exe -m pip install -r requirements.txt.

Common issues

  • Task fails instantly or balance message: your account balance is 0. Generation and reference-image uploads need balance; top up on nerapi.com.
  • 401 on everything: key typo or wrong key. 400: a model name or parameter combo the gateway rejects.
  • Timed out after 300s: the gateway can be slow under load - bump 超时秒数.
  • The README ships a test_api.py that runs outside ComfyUI (python test_api.py --key sk-... --model gpt-image-2 --prompt "..."), so you can verify the key and endpoint before debugging inside a graph.

The honest caveat

A tiny MIT pack that phones home with your key is exactly the shape of thing to read before running - and "nerapi" has essentially zero footprint in the English-speaking community, so you're trusting a small, Chinese-first project with your key and your images. If you'd rather have a vetted path to a closed model, ComfyUI's own Partner Nodes are the safer default. But for someone in the nerapi ecosystem who wants GPT-Image-2 in the graph without an OpenAI account, this is a clean, small wrapper that does exactly what it says - nothing more, nothing hidden.

CategoryNano-Banana / GPT-Image

Inputs (14)

NameTypeDefaultDescription
密钥STRING
提示词STRING
比例COMBO1:111 options: auto, 1:1, 16:9, 9:16, 4:3, 3:4, +5
图片1optIMAGE
图片2optIMAGE
图片3optIMAGE
图片4optIMAGE
图片5optIMAGE
图片6optIMAGE
图片7optIMAGE
图片8optIMAGE
接口地址optSTRINGhttps://nerapi.com/v1
轮询间隔optFLOAT3.01–30
超时秒数optINT30030–1800

Outputs (1)

NameTypeDescription
图像IMAGE