Nodes/SpicyAPI/Object Eraser · Erase Objects
ComfyUI Node

Object Eraser · Erase Objects

Name the thing, and it's gone

By spicyapi-ai·Created 21 days ago·Updated 2 days ago· 2
Object Eraser · Erase Objects
  • image_url
  • mask_url
  • images
  • task id
◄prompt►
◄output_formatPNG►
◄seed0►

Deleting things is the boring half of inpainting

The exciting inpainting problem is "put something new here". The tedious one, and the one you actually spend time on, is "get that out of the shot" - the litter on the grass, the logo on the cup, the guy in the background. Locally that's a mask, an inpaint model, a denoise value, and a bad outcome the first three times.

Object Eraser does it in one call for $0.03 per image. A few plain words describing what to remove, optionally a mask, and the gap is filled with background that continues the scene. Original size, output as PNG, JPEG or WebP.

Worth noting what's really happening, because it explains everything about when this works: this is the instruction-editing generation of tools, not a diffusion inpaint with a denoise dial. Instruction editing took the "remove this" job cleanly, and the KB's take is fair - what it still can't do is leave the rest of the image bit-for-bit alone, which is why the mask field exists here.

Inputs and outputs

image_url (IMAGE) - the photo to clean up.

prompt (STRING) - what to remove, in a few plain words, with a position when there's more than one: "the wooden bench on the left". The tooltip explicitly says you can give this, the mask, or both - so the field being flagged as required in the node doesn't mean a mask-only run is invalid; leave it empty and supply a mask and it still works. Specific beats clever here. "the red car parked behind the fence" will work; "remove distractions and improve composition" won't.

mask_url (optional, IMAGE) - a black-and-white mask the same size as the photo: white marks what to remove, black what to keep. This is the network from the core Load Image node's mask editor, and it's the precision option. Reach for it when the prompt would be ambiguous - two similar objects in frame, or a thin structure the model keeps misreading.

output_format - png, jpeg or webp, default png.

Outputs: images (IMAGE) and task id (STRING).

Which to use: prompt, mask, or both

Prompt alone is the fast path and gets it right maybe most of the time. Mask alone is the deterministic path - but note the model still paints the fill, so a mask doesn't guarantee the untouched regions come back untouched the way a crop-and-stitch inpaint workflow does locally. Both together is the sweet spot for anything fiddly: the mask says exactly where, the prompt says exactly what, and the two don't have to agree on semantics.

Install

Manager → search SpicyAPI, or:

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

Restart. No dependencies and no model download - the pack's dependency list is empty and the work happens on SpicyAPI's servers, so this runs fine on a machine with no GPU. Python 3.10+ and a ComfyUI with the V3 node API. Key goes in Settings > SpicyAPI (or SPICY_API_KEY on a headless box), restart once so the model list loads from your account, and set Max cost per run.

Where it fails, predictably

  • Reflections, shadows and texture continuity. Removing an object that cast a shadow often leaves the shadow, or removes it and leaves a suspiciously clean patch.
  • Large removals are generative. Erase a third of the frame and the model invents a third of the frame, including whether that grass has detail. Small, boring removals are where this is flawless.
  • Mask size must match. A mask of different dimensions than the photo is a rejected request, and it's the most common error with this node.
  • Three cents a try. Cheap enough to iterate, cheap enough to leave a loop on by accident - the node shows its rate before the run and the Settings ceiling will stop anything above your limit.
  • Input leaves your machine. Fine for stock and product cleanup; think twice for client portraits.
CategorySpicyAPI/Image/Tools

Inputs (5)

NameTypeDefaultDescription
image_urlIMAGEPhoto to clean up. The selected objects are removed and the space is filled to match the scene.
promptSTRINGWhat to remove, in a few plain words with a position when there is more than one, e.g. "the wooden bench on the left". Give this, mask_url, or both.
output_formatCOMBOPNGFile format of the returned image.
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.
mask_urloptIMAGEOptional black-and-white mask the same size as the photo: white marks what to remove, black what to keep. Give this, prompt, or both.

Outputs (2)

NameTypeDescription
imagesIMAGE—
task idSTRINGThe SpicyAPI task id, for the console logs or support.