Pixelcut Credits
The wallet-readout node that stops you discovering a 403 too late
- credits_remaining
Pixelcut Credits is the boring one in the pack, and that's fine. It doesn't cut anything out, doesn't take an image, doesn't touch your GPU. Give it an optional api_key and it returns a single credits_remaining integer: how many Pixelcut API credits are left on the account. It's the odometer, not the engine.
You want it because its sibling node, Pixelcut Remove Background, spends credits on every single call - and shadow mode costs an extra +3 per image. If you're about to queue a 100-frame batch, "check the balance first" is the difference between a clean run and an HTTP 403 halfway through. Running this node once before a big job is the 20-second sanity check that costs you nothing.
How it works
It's a straight GET /v1/credits against the Pixelcut API with your key in the X-API-KEY header. Nothing clever, but there is one implementation detail worth knowing: the node returns float("nan") from IS_CHANGED, which tells ComfyUI to always re-run it rather than cache the result. That means the number you see is live, never stale - every execution of the graph re-queries the server. The flip side is that if you leave it wired into a workflow that runs a hundred times, that's a hundred tiny network calls. In practice each one is milliseconds and it's not worth optimizing; just know it's not cached.
The inputs and output
One input, one output, and you'll rarely touch the input:
api_key(optional STRING, default empty) - the same key story as the rest of the pack. SetPIXELCUT_API_KEYas an env var before launching ComfyUI and leave this empty; or type a key in here, which overrides the env var but gets saved into the workflow JSON and any saved-image metadata. Don't share those files with a widget-key in them.credits_remaining(INT output) - the live balance. It's a plain integer, so wire it into any INT-consuming node if you want it shown or logged; most people just run this node by itself and read the value.
Installation
There's no separate install - this node ships in the same pack as Pixelcut Remove Background, so if you have one you have the other. ComfyUI Manager: search "Pixelcut" and install. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/pixelcutai/comfyui-pixelcut
cd comfyui-pixelcut
pip install -r requirements.txt
Restart and look under the Pixelcut category. Dependencies are just requests, pillow and numpy - nothing heavy, no model downloads.
Gotchas
Two, both boring and both easy to sidestep. If you run it with no key configured, you'll get the same "set the PIXELCUT_API_KEY environment variable or fill the api_key input" error the remove-background node raises - which makes this node a decent first test that your key is even valid before you spend a single credit on a cutout. And remember it's a live query, not a cached number: it reflects what the server thinks at that moment, so if you've queued a big batch in parallel, your balance can move between when you check and when the calls actually land. Check, then don't run the greedy jobs concurrently.
It's not a node you'll build a workflow around. It's the utility you drop in when your wallet needs checking - and for a paid API pack, that's exactly the kind of node you want shipped.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| api_keyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| credits_remaining | INT | — |