ReplaceBG ClipDrop v5.1.0
Replace a background by typing a sentence — ClipDrop's API, one node away
- image
- IMAGE
Most background swaps in ComfyUI are two steps: remove the background, then generate a new one and composite. tri3d-clipdrop-bgreplace-api collapses that into one API call - you hand it an image and a text prompt, and Stability's ClipDrop service cuts out the subject and generates a new background around it in a single response. The catch is the same as its sibling tri3d-clipdrop-bgremove-api: it's a paid cloud API, key required, no local model involved.
What it does
Two inputs: image, and text - the prompt describing the new background, defaulting to model standing on a beach and marked multiline. It JPEG-encodes the image, POSTs to https://clipdrop-api.co/replace-background/v1 with the prompt and the CLIPDROP_API_KEY from your .env, and returns the API's image as an IMAGE. Like the remove node, the output keeps the RGBA channels the API sends back - no separate mask output.
The prompt matters more than you'd think. ClipDrop's replacement keeps the subject and paints around it, so the quality of the result tracks the specificity of the scene description: model standing on a beach gets you a generic beach, while model standing on a rocky beach at golden hour, soft waves behind gets you something you might actually use. It handles lighting roughly - don't expect the new background's lighting to match the subject's, which is the classic tell that a swap was AI-done.
The usual caveats apply with extra weight:
- Paid and keyed. Without
CLIPDROP_API_KEYset, the call 401s and the node raises. Free tiers exist, and this endpoint is one of the pricier ones. - Privacy. The full image leaves your machine. Consider this before feeding it anything sensitive.
- It's a replacement, not a refine. If you want to keep the exact subject and just fix the background, the remove API plus local compositing gives you more control - this node commits to the API's idea of the new scene.
Where it fits
For rapid iteration it's unbeatable: type a scene, get a swapped image, tweak the prompt, re-run - no masking, no ControlNet, no inpainting pass. The pack sits in the VTON space, and this is its "put the model on a new runway" button.
Installing
Same as the rest of the pack - ComfyUI Manager (search "tri3d"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/TRI3D-LC/tri3d-comfyui-nodes
Install requirements (pip install -r custom_nodes/tri3d-comfyui-nodes/requirements.txt), then a .env in ComfyUI's working directory with CLIPDROP_API_KEY=.... Restart.
Troubleshooting
- 401/403 - key missing or wrong, or the key lacks permission for the replace-background endpoint specifically.
- 429 - you've hit the quota; these calls add up fast when you iterate on prompts.
- Subject looks warped - the API sometimes reshapes the subject to fit its composition; not a node bug, just the service being opinionated.
One prompt, one API call, a whole new scene. Just keep one eye on the bill and the other on what you're uploading.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| text | STRING | model standing on a beach | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |