ComfyUI Node

Stability Erase

Object removal with no prompt at all

By Stability-AI·Created 2 years ago·Updated about a year ago· 64
Stability Erase
  • image
  • mask
  • IMAGE
grow_mask5
seed0
output_format
api_key_override

Erase is the pack's remove-the-photobomber node: you mask something out, and it fills the hole with plausible background. No prompt, no negative prompt, no style settings. It's the most point-and-shoot edit in the whole Stability pack, and it hits the stable-image/edit/erase endpoint on Stability's servers.

Local inpainting can do this too - mask, prompt "remove object," run an inpaint pass - but that often needs a bit of prompt coaxing and a couple of attempts to get a clean fill. This route was purpose-built for the job: the model looks at what's around the masked area and extends it. It's a cloud node, so it costs credits and needs a Stability API key, but it uses zero VRAM and zero local model RAM. The community never warmed to this pack - "not local, not interested" has been the standard reply since launch - but for a quick content-aware removal on a machine without a GPU, this is hard to beat on effort.

How it works

You need two things: the image, and a mask covering what you want gone. The mask comes in as a standard ComfyUI MASK tensor, which the node converts to a PNG and uploads with the image. You can draw the mask directly on the node's preview, or generate one in a workflow (a segmentation model, a color-to-mask, whatever) and feed it in. Without a mask the request is incomplete and the server will bounce it.

The one real control:

  • grow_mask (0–20, default 5) - how many pixels the erased region expands before filling. This is your halo dial. Too low and you get a fringe of the object's edge left behind; too high and it starts eating what's around it. Five is a sane default for most subjects; bump it for hairy or fuzzy-edged objects.

There's also seed if you want to re-roll a fill you disliked, and output_format for png/webp/jpeg. No prompt, no style - if you find yourself wanting to instruct the fill ("make it a brick wall here"), that's the Inpainting node's job, not this one's.

Output is a single IMAGE tensor - Save Image, Preview, or straight into the next node.

Installing it

From the official "Stability API nodes for ComfyUI" pack - ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone https://github.com/Stability-AI/ComfyUI-SAI_API
# restart ComfyUI

No models download. Key via SAI_API_KEY, a sai_platform_key.txt file, or per-node api_key_override (don't share workflows that use the override - the key travels with them).

Common issues

  • "bad_request" - almost always a missing mask. Feed a MASK in, not an image.
  • Remnants of the object - raise grow_mask a notch and re-run.
  • Fill that looks like smudged background - that's the nature of content-aware fill on complex backgrounds. For anything where the background has structure (a brick wall, a crowd), you'll often get a cleaner result by masking generously and letting a bigger fill area blend.

It's narrow and it's honest about being narrow: one job, done well, no knobs to overthink. For "get this thing out of the picture," that's exactly what you want.

CategoryStability

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
maskoptMASK
grow_maskoptINT50–20
seedoptINT00–4294967294
output_formatoptCOMBO3 options: png, webp, jpeg
api_key_overrideoptSTRING

Outputs (1)

NameTypeDescription
IMAGEIMAGE