CatsAPI GPT Image 2.5
Rented GPT Image inside your graph, billed in cat coins
- reference_image
- images
- file_paths
- cost_coins
- task_id
- metadata
No OpenAI account involved. This node ships your prompt to catsapi.com - a Chinese reseller platform ("猫影工坊") - which calls GPT Image 2.5 and returns a PNG; you pay in 猫币 (cat coins) topped up there.
Where it fits
GPT Image has no weights, so there's no local option at any VRAM - the textbook case from our external API nodes piece: the only door is an HTTP call. ComfyUI's own Partner Nodes are the blessed route; this is the third-party one: a single author wrapping a single reseller, sharing auth, submit, poll and download code across all thirteen of its nodes.
How it works
It's a four-step HTTP client in catsapi_client.py, shared by the whole pack:
- Cost preview - POST
/api/tasks/cost-previewwith model,size,quality,variant,num_imagesand whether a reference image is attached. Bad preview, orsufficient: false, means no submission. - Submit - POST
/api/taskswith the prompt, params and any reference image as base64 PNG data URIs. - Poll - GET
/api/tasks/{id}every 3 seconds, up to 900 seconds. - Download and convert - results land in your output folder under
catsapi/, then become anIMAGEtensor.
Everything is force-converted to RGB, so a transparent background never reaches the tensor, and a returned image that doesn't match the first one's size gets LANCZOS-resized so the batch stacks. Downloads carry browser-like headers with a curl fallback, because CDN bot checks were eating plain urllib requests.
Inputs that matter
variant is the new field in 2.5. flare (default) is the fast path, sunburst the detailed one, billed at 1.25× flare rounded up. The node sends the variant to preview and submission alike but never applies the multiplier itself - the server quotes it and max_coins guards the quote.
quality runs low / auto / medium / high / xhigh / max; auto is the sane default, xhigh for when you've decided the image is worth it. size offers 20 options from 1024x1024 to 3840x2160 plus verticals - both feed the cost preview, so bigger isn't free.
background is auto / transparent / opaque - set transparent if you want it, but read the outputs first. reference_image takes up to 16 images, the pack's highest limit (Nano Banana Pro allows 4, GrokImage 1); over it, the node errors rather than truncating silently.
max_coins defaults to 0, meaning no cap. Set a positive number so a careless num_images=4 + max click can't drain the balance - the README is honest that this is a pre-submission check, not a price lock. api_key_override is for hosted platforms like RunningHub; leave it empty locally.
Outputs
images is the IMAGE tensor - wire it to Preview Image or Save Image, since this node isn't an output node. The rest are the ones nobody reads:
file_paths- JSON list of the downloaded PNGs, and where a transparent background lives, becauseimagesis RGB-only.cost_coins- INT cost of this call, handy for logging - plustask_idfor looking the job up on catsapi.com when polling times out, andmetadata(task id, model, cost, params, paths as JSON).
Install and the key
No requirements.txt; the client is pure stdlib on top of the numpy/PIL/torch ComfyUI already ships. So:
cd ComfyUI/custom_nodes
git clone https://github.com/maodeyu180/ComfyUI_Catsapi.git
Restart - no pip install, no model downloads.
The key is where people stall: an env var read before ComfyUI launches.
export CATSAPI_API_KEY=cats-your-key
python main.py
If ComfyUI didn't inherit your shell environment, as desktop launchers often don't, it also reads a plain assignment from a .env in the custom node folder, a .env in ComfyUI's working directory, ~/.catsapi.env, or your shell rc files. Drop this in ~/.catsapi.env and stop fighting the launcher:
CATSAPI_API_KEY=cats-your-key
Keys must start with cats-; anything containing ... or … is rejected before a request goes out.
Gotchas
"未找到有效 CATSAPI_API_KEY" while your shell clearly has it - the node reads the ComfyUI process's environment, not your terminal's. Use the .env files.
The 15-minute polling ceiling. Polling gives up at 900s even if the server is still working; the error carries the task_id, so the job may finish on the site while you get nothing in the graph. Four images at max is what brushes that wall.
"Download result looks like an HTML page." The CDN bot check beat both downloaders. Retry - and make sure curl exists, or you've lost one of them.
Don't share a workflow with api_key_override filled in - ComfyUI saves widget values, so it lands in the JSON. And read this pack's source before trusting it with a key; a node built to hold a credential and phone home is the shape that got weaponized once already here.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| size | COMBO | 1024x1024 | 20 options: 1024x1024, 1280x1024, 1024x1280, 1536x1024, 1024x1536, 2048x2048, +14 |
| quality | COMBO | auto | 6 options: low, auto, medium, high, xhigh, max |
| variant | COMBO | flare | 2 options: flare, sunburst |
| background | COMBO | auto | 3 options: auto, transparent, opaque |
| num_images | INT | 11–4 | — |
| max_coins | INT | 00–100000 | — |
| reference_imageopt | IMAGE | — | |
| api_key_overrideopt | STRING | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| images | IMAGE | — |
| file_paths | STRING | — |
| cost_coins | INT | — |
| task_id | STRING | — |
| metadata | STRING | — |