Nodes/GrsAI api in ComfyUI/🎨 GrsAI GPT Image
ComfyUI Node

🎨 GrsAI GPT Image

Rent GPT Image 2 from inside ComfyUI — no OpenAI key, no GPU

By 31702160136·Created about a year ago·Updated about a month ago· 126
🎨 GrsAI GPT Image
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image
  • status
promptA beautiful girl with long black hair, wearing a white dress, standing in a beautiful garden, looking at the camera.
apikey请输入您的APIKEY: sk-xxxxxxx
modelgpt-image-2
num_images1
aspect_ratioauto

This is a paid API call, not a local model

🎨 GrsAI GPT Image is the flagship node of the ComfyUI-GrsAI pack, and it's a wrapper, not a generator. Drop it on the canvas, type a prompt, and it pays a per-image call to GrsAI - a Chinese API reseller that fronts OpenAI's GPT Image 2 - then downloads the result and hands it back to you as a normal IMAGE tensor. You don't need an OpenAI account, you don't need a GPU with spare VRAM, and you don't touch a browser. You do need a paid GrsAI key from grsai.com, and you're billed roughly ¥0.03 (a couple of US cents) per image. Think of it as renting GPT Image from a vending machine that happens to sit inside your ComfyUI graph.

Why reach for this instead of local Flux or SDXL? Two reasons. First, GPT Image is a closed, genuinely multimodal model - the family that made AI text-on-image readable, and it takes images as input. Second, you get to mix a black-box API result into your normal workflow: reference images in, tensor out, straight into a SaveImage or an upscaler. For one-off "I need OpenAI-grade output and I don't want to leave ComfyUI" jobs, it's convenient as hell.

How it works

The mechanism is straightforward. The node reads your API key from its own apikey field, wraps your prompt in a JSON request, and POSTs to the pack's configured endpoint (https://grsai.dakka.com.cn). Any reference images you wire in get re-encoded as base64 PNG data URIs and sent along as image inputs - so the same node does text-to-image with no images attached, or image-to-image/editing when you feed it one. The response comes back as an image URL, which the node downloads and converts to a tensor.

Here's the quirk worth understanding: num_images doesn't ask for one batch - it spawns that many concurrent API calls. A thread pool runs max_workers equal to your count, so "4 images" means four parallel paid requests, not one request returning four. That's the "smart batching" the README brags about, and your bill scales linearly. There's no caching either: IS_CHANGED is hardcoded to always fire, so every Queue run re-generates and re-bills.

The inputs that matter

  • apikey - paste your GrsAI key here. This is the one that actually gets read by these nodes; see below.
  • prompt - your text. GPT Image is good at following long, detailed prompts and rendering text inside the image.
  • model - the current build only offers gpt-image-2 in the dropdown (early releases also listed gpt-image-1.5). Nothing to fiddle with.
  • num_images - 1–12, each a separate concurrent request.
  • aspect_ratio - a dropdown of OpenAI's fixed sizes like 1024x1024 (1:1) and 1672x941 (16:9), plus auto.
  • image_1image_8 - optional reference images for editing or multi-image fusion.

The outputs are exactly two: image (the IMAGE tensor - wire it to SaveImage/PreviewImage) and status (a STRING you can pipe into a text preview; on success it reports the model and how many images generated).

Installing it

The pack installs like any custom node - ComfyUI Manager's "Install via Git URL" with https://github.com/31702160136/ComfyUI-GrsAI.git, or the manual route:

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

Then fully restart ComfyUI. The requirements are light (requests, httpx, python-dotenv, Pillow, torch) - no model downloads, nothing multi-GB. On the Windows portable build, use .\python_embeded\python.exe -m pip install --force-reinstall -r .\ComfyUI\custom_nodes\ComfyUI-GrsAI\requirements.txt.

Where people get burned

  • The API key. The README walks you through a .env + double-restart dance, but for this node the code reads the apikey field on the node itself. Fastest path: paste your key straight into the widget. Leave the placeholder 请输入您的APIKEY: sk-xxxxxxx in there and you'll get a 401 and a red error.
  • Black image out = failure. When a call fails, the node returns a 1×1 black tensor plus a 失败: ... ("failed") status string instead of raising. Wire the status output somewhere readable, or you'll spend a while wondering why SaveImage is quiet.
  • It always re-runs. No caching, so a stray Queue press burns credits. The per-image price is trivial; the accidental batch isn't.
  • Balances and rate limits. If every image fails at once, check your GrsAI account balance first; 429s mean you're hammering it.

One more thing: this is a reseller API, so you're trusting a small middleman with your key. GrsAI has essentially no footprint in the English-speaking ComfyUI community - the model it fronts is famous, the relay is not. Fine for casual use; don't build anything critical on a relay that could vanish.

CategoryGrsAI/GPT Image

Inputs (13)

NameTypeDefaultDescription
promptSTRINGA beautiful girl with long black hair, wearing a white dress, standing in a beautiful garden, looking at the camera.
apikeySTRING请输入您的APIKEY: sk-xxxxxxx
modelCOMBOgpt-image-21 options: gpt-image-2
num_imagesCOMBO112 options: 1, 2, 3, 4, 5, 6, +6
aspect_ratiooptCOMBOauto14 options: auto, 1024x1024 (1:1), 1672x941 (16:9), 941x1672 (9:16), 1443x1090 (4:3), 1090x1443 (3:4), +8
image_1optIMAGE
image_2optIMAGE
image_3optIMAGE
image_4optIMAGE
image_5optIMAGE
image_6optIMAGE
image_7optIMAGE
image_8optIMAGE

Outputs (2)

NameTypeDescription
imageIMAGE
statusSTRING