Nodes/ComfyUI_Catsapi/CatsAPI GPT Image 2
ComfyUI Node

CatsAPI GPT Image 2

GPT Image 2 in ComfyUI, without the OpenAI SDK dance

By maodeyu180·Created 2 months ago·Updated 2 months ago· 1
CatsAPI GPT Image 2
  • reference_image
  • images
  • file_paths
  • cost_coins
  • task_id
  • metadata
prompt
size1024x1024
qualityauto
num_images1
max_coins0
api_key_override

OpenAI's image models have one party trick that still makes people stare: they render text that's actually legible, and GPT Image 2 is the current version of that. Posters, UI mockups, product shots with readable labels - the thing diffusion models have been mangling for years. It's also a closed model you can't download, so if you want it inside a ComfyUI graph, you go through an API. CatsAPIGPTImage2 is one of seven nodes in the ComfyUI_Catsapi pack that all do exactly that - wrap a closed frontier model behind a paid endpoint at catsapi.com and drop the result back into your workflow as a normal IMAGE tensor.

What you get to set

  • prompt - multiline text. The one you'll actually iterate on.
  • size - a dropdown of twelve fixed sizes, from 1024x1024 up to 4K-ish frames like 3840x2160 and the portrait/landscape variants. No free-form resolution; the API only accepts what it accepts.
  • quality - auto, low, medium, high. This is the classic per-call cost lever: high costs more coins and buys finer detail, auto lets the backend decide.
  • num_images - 1 to 4 per run.
  • max_coins - spending cap; 0 means uncapped. Set it on first runs so a runaway prompt doesn't surprise you.
  • reference_image (optional) - an IMAGE tensor, up to four of them, for image-in/editing work.
  • api_key_override (optional) - leave blank unless you're on a hosted platform.

That's the whole surface. The pack's design rule is one node per model with only the parameters that model truly accepts, so there's no invented sampler or steps field floating around.

What comes out

The standard five outputs: images (an IMAGE tensor - wire it straight into Preview Image), file_paths (JSON list of local PNGs), cost_coins, task_id, and metadata. Results download to ComfyUI/output/catsapi/ and get converted to a tensor locally, so you can follow it with a local upscaler, an inpainting pass, or a detailer exactly as if a local sampler had produced it.

The mechanism, briefly

Every node in this pack is a thin HTTP client: preview cost → check against max_coins → submit → poll every 3 seconds (15-minute timeout) → download with browser headers and a curl fallback. No weights, no VRAM, no Python dependency beyond urllib plus numpy/PIL/torch that ComfyUI already bundles. The heavy lifting happens on OpenAI's servers; the node just carries your prompt and key.

Install and the key

cd ComfyUI/custom_nodes
git clone https://github.com/maodeyu180/ComfyUI_Catsapi.git
# restart ComfyUI

You need a CatsAPI key from catsapi.com - a paid account, key starts with cats-:

export CATSAPI_API_KEY=cats-your-key
python main.py

No shell env? Put it in a .env file or ~/.catsapi.env and the node reads those. Truncated keys (containing ...) are rejected before any request.

Where people get burned

Three things, in order of how often they bite. First, remember your prompt and any reference images leave your machine and hit OpenAI's moderation - GPT Image's filtering has historically been strict, and an API node can't bypass it. Second, api_key_override widget values get serialized into saved workflows, so don't share one with the key filled in. Third, the pack is young and the provider (catsapi.com) has essentially zero English-community footprint - it's a Chinese reseller, README is Chinese-first, so verify pricing in cat-coins against your budget before you batch four high-quality 4K renders and watch the balance evaporate. GPT Image 2 is genuinely good at text; it's just not cheap about it.

CategoryCatsAPI/Image

Inputs (7)

NameTypeDefaultDescription
promptSTRING
sizeCOMBO1024x102412 options: 1024x1024, 1536x1024, 1024x1536, 2048x2048, 2048x1152, 1152x2048, +6
qualityCOMBOauto4 options: auto, low, medium, high
num_imagesINT11–4
max_coinsINT00–100000
reference_imageoptIMAGE
api_key_overrideoptSTRING

Outputs (5)

NameTypeDescription
imagesIMAGE
file_pathsSTRING
cost_coinsINT
task_idSTRING
metadataSTRING