Replicate smoretalk/rembg-enhance
One-click background removal via API
- image
- IMAGE
This is the simplest node in the whole Replicate pack: one image in, one cutout image out. No prompt, no settings, nothing to configure. smoretalk put a background-removal model on Replicate that pairs the standard cutout with an edge-refinement pass - the "enhance" in the name - and this node calls it as a hosted API instead of you running any segmentation model locally.
Background removal is genuinely commoditized at this point: models are free, fast, and everywhere. The real question isn't "does something remove the background" - that's solved - it's whether the edges survive contact with hair, fur, or anything semi-transparent. That's still an open problem no single model has definitively won, and it's the thing to keep in mind here: this node gives you convenience (zero local setup, zero VRAM), not a specific choice of which segmentation approach handles your hardest case best.
How it works
You send an image, Replicate runs it through the hosted model, and you get a processed image back - presumably a cutout with cleaned-up edges, going by the name. Because it's a single opaque API call rather than a local node pack, you don't get to pick which underlying technique or resolution tier handles your image; that trade-off is baked into the model on Replicate's end, not exposed as a parameter here.
The inputs and outputs that matter
image(required) - the picture to process. That's the entire required surface.
force_rerun (default off) is the only other input, letting you force a fresh call instead of getting a cached result on identical input. Output is a single IMAGE - wire it straight into whatever composites, saves, or further edits your cutout.
How to install it
One install covers every node in this pack.
cd ComfyUI/custom_nodes
git clone https://github.com/replicate/comfyui-replicate
cd comfyui-replicate
pip install -r requirements.txt
Restart, or via ComfyUI Manager: search ComfyUI-Replicate, install, restart. Before running it, set your token in the same environment you launch ComfyUI from:
export REPLICATE_API_TOKEN="r8_************"; python main.py
Token from replicate.com/account/api-tokens. No model download, no VRAM used - this runs entirely on Replicate's side.
Common issues & troubleshooting
Node errors immediately. REPLICATE_API_TOKEN isn't set where ComfyUI is actually running - far and away the most common first-run failure across this pack. On the portable Windows build, a token set as a global Windows environment variable specifically has been reported not to get picked up automatically; set it directly in the launch .bat instead.
Edges look rough on hair, fur, or anything semi-transparent. That's the hard case for every background-remover, not a defect unique to this one - no model in this space has fully solved fine boundaries. If this node's output isn't clean enough on a specific image, it's worth trying a local node like BiRefNet or InSPyReNet, where you can pick weights matched to your resolution and compare results directly rather than trusting one opaque API call.
Same result on identical input. Replicate's cache - flip force_rerun for a fresh run.
It bills per call. Fine for occasional use; if you're batch-processing a large folder, budget for it or consider a local node instead, since a locally-run background remover has effectively zero marginal cost per image once installed.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| force_rerunopt | BOOLEAN | false | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |