RemBG v1.4
Cutouts without the model downloads
- image
- image
rembg is the old reliable of background removal - the MIT-licensed tool that's been cutting subjects out of images since 2020, when a single r/StableDiffusion PSA about the A1111 extension was enough to take the operation mainstream. This node is the classic rembg v1.4 engine running as a hosted Runware endpoint: feed it an image, get a cutout back, and never download a u2net weight or load a model into VRAM.
If you already run local background removal - BiRefNet in ComfyUI core, or the Inspyrenet nodes - you don't need this; it's strictly slower to pay per image for what your GPU does free. But if you're on a laptop with no VRAM, or you want a background cutout in a cloud workflow where everything else already runs on Runware, this is the drop-in. It's also a nice second opinion node: when the local model mangles hair, rembg's u2net path sometimes disagrees usefully.
How it works
Your image (IMAGE tensor) is encoded to a PNG and sent to runware:109@1 with taskType: removeBackground. The result comes back as a native image output - the cutout on a transparent background when outputFormat is PNG, or composited onto whatever the format supports.
The inputs that make it interesting are the matting controls:
settings.alphaMatting- toggle on to refine edges instead of a hard cut. On for hair, fur, and anything with soft edges; off for clean, flat subjects where it only adds time.settings.alphaMattingForegroundThreshold(default 240) andsettings.alphaMattingBackgroundThreshold(default 10) - where the matting decides foreground ends and background begins. Higher background threshold removes more background but takes longer.settings.alphaMattingErodeSize(default 10) - how much the edge is eroded to smooth the silhouette.settings.postProcessMask- extra mask cleanup pass when the first cut is noisy.settings.returnOnlyMask- output the mask instead of the composited cutout, which is handy when you want to feed a mask into an inpaint or a compositing step.
Output: image (IMAGE). The advanced_json field takes settings.rgba if you want to control alpha handling precisely.
Installing
Pack-wide, one install: ComfyUI Manager → search Runware → install → restart, or:
cd ComfyUI/custom_nodes
git clone https://github.com/Runware/ComfyUI-Runware
pip install -r ComfyUI-Runware/requirements.txt
No model downloads - that's the entire pitch. API key from the Runware dashboard.
Gotchas
Remember what the community learned back in 2023: rembg handles simple backgrounds well and complex ones still need manual cleanup. Hair is the classic failure - that's what settings.alphaMatting is for, so don't skip it on subjects with flyaway strands. And remember the format trap: JPG has no alpha channel, so a cutout saved as JPG composites onto black (or whatever the encoder does with alpha). Set outputFormat to PNG when you want the transparent result. Since it's a paid call per image, it's worth keeping for the occasional cutout, not for batch-processing ten thousand product photos.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| settings.alphaMattingopt | BOOLEAN | false | Enable alpha matting to refine edges of the foreground object. |
| settings.alphaMattingBackgroundThresholdopt | INT | 101–255 | Threshold used in alpha matting to refine background areas. Higher values remove more background but increase computation time. |
| settings.alphaMattingErodeSizeopt | INT | 101–255 | Size of the erosion operation used to smooth the edges of the foreground object. |
| settings.alphaMattingForegroundThresholdopt | INT | 2401–255 | Threshold used in alpha matting to distinguish foreground from background. Affects edge sharpness. |
| settings.postProcessMaskopt | BOOLEAN | false | Enable additional post-processing to improve mask accuracy. |
| settings.returnOnlyMaskopt | BOOLEAN | false | Return only the mask instead of the processed image. |
| ttlopt | BOOLEAN | false | Enable to set ttl. Off uses the model's default. |
| ttl_valueopt | INT | 60 | Time-to-live (TTL) in seconds for generated content. Only applies when `outputType` is `URL`. |
| outputFormatopt | COMBO | JPG | File format for the generated image. |
| outputQualityopt | INT | 9520–99 | Compression quality of the output. Higher values preserve quality but increase file size. |
| advanced_jsonopt | STRING | Optional JSON merged into the request. For: settings.rgba |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |