Nodes/SpicyAPI/Background Remover · Remove Background
ComfyUI Node

Background Remover · Remove Background

You want the alpha mask, not the flat image

By spicyapi-ai·Created 21 days ago·Updated 2 days ago· 2
Background Remover · Remove Background
  • image_url
  • images
  • alpha
  • task id
◄seed0►

Why this one is a no-brainer

Background removal is the most commoditised operation in this whole space and still not settled - u2net was fine on product shots and visibly wrong on hair, and the argument has continued ever since between rembg, BiRefNet, InSPyReNet, SDMatte and the rest. Locally you're picking a model, downloading weights, and occasionally arguing with a CUDA extension.

This node sidesteps all of that. One image in, $0.0048 per image, and it's the cheapest node in the entire pack - cheaper than a single 4K upscale and about a third of a face swap. If you cut out images regularly, it's the one SpicyAPI node that pays for itself on convenience alone.

How it works

The node uploads your picture (PNG when it fits under the 10 MiB ceiling, high-quality JPEG if it doesn't) and calls spicyapi/background-remover-v1/edit. The result is a transparent PNG at the original width and height. Then the interesting part: the pack doesn't just hand you that PNG.

decode_images in the pack's media.py splits the returning RGBA into RGB plus alpha, and - this is the detail the docs don't spell out - multiplies the RGB by the alpha. Without that, a transparent cutout would look, in a preview, exactly like no background removal happened at all, because the old background is still sitting in the RGB channels. With it, you get two usable outputs instead of one confusing one.

Inputs and outputs

Inputs are as thin as it gets. image_url (IMAGE) is the only one - a photo whose background should go. No prompt, no threshold, no model choice, because the subject is picked automatically. If your photo has several plausible subjects, crop to the one you want first; that's the author's own advice and it's the right call.

Outputs:

  • images (IMAGE) - the subject, RGB premultiplied by alpha. Save it and you get a flat-looking image, because ComfyUI's save path drops alpha on IMAGE.
  • alpha (MASK) - the cutout, where 1 is opaque. This is the output you actually composite with: feed it to ImageCompositeMasked or Join Image with Alpha (a core ComfyUI node) to get a real transparent PNG, or multiply it into a mask chain for a detail pass.
  • task id (STRING) - for the console or support.

Install

Manager → search SpicyAPI, or clone and restart:

cd ComfyUI/custom_nodes
git clone https://github.com/spicyapi-ai/comfyui-spicyapi

There's nothing to pip install and no model folder to populate - the pack declares zero dependencies and only needs Python 3.10+ plus a ComfyUI recent enough for the V3 node API. Add your key under Settings > SpicyAPI (or SPICY_API_KEY on a headless box) and restart once so the node list comes from your account.

Where it falls over

  • Hair, fur, veils, glass. Same failure set as every background remover since 2020. A hard mask is wrong for a strand of hair that's genuinely half-transparent, and no amount of settings on this node will fix that - you're buying the model's judgement, not tuning it.
  • Saved output looks like nothing happened. You saved the images output, not the alpha. That's the premultiplication above; the alpha is where the cut lives.
  • No SpicyAPI key is set - Settings, not the node. Your key never lands in a workflow file or image metadata.
  • Multiple subjects. Crop first. There's no way to say "not that one".
  • Your photo leaves your machine. That's the trade for the price. Fine for stock and product work; think harder about client material.
CategorySpicyAPI/Image/Tools

Inputs (2)

NameTypeDefaultDescription
image_urlIMAGEPhoto whose background is removed. The main subject is kept and everything else becomes transparent.
seedINT00–2147483647This model takes no seed, so the number is never sent. Changing it makes ComfyUI run the node again: set 'control after generate' to randomize for a new result on every run; every run is billed.

Outputs (3)

NameTypeDescription
imagesIMAGE—
alphaMASKTransparency of each image: 1 is opaque.
task idSTRINGThe SpicyAPI task id, for the console logs or support.