抠抠图-抠图功能
Background removal, but nothing actually runs on your GPU
- image
- image
KoukoutuBackgroundRemoval is the flagship of the comfyui-koukoutu pack, and the display name says it all: 抠抠图-抠图功能, the "cutout function". But here's the thing nobody tells you until you're mid-install - the name is a lie in the best way. This node doesn't run a segmentation model on your machine. It uploads your image to the Koukoutu cloud (a Chinese image-processing API, koukoutu.com), waits a couple of seconds, and hands back the cutout. Zero VRAM, zero model downloads, and the only thing your GPU does during it is hold your other workflow.
So when do you actually want this? If you already run BiRefNet (now built into ComfyUI core) or rembg, this is strictly a paid, network-round-trip version of something you can do free and local - and the KB is pretty clear that local is the community's default. Where it earns its keep: you don't want to manage segmentation models at all, you're on a machine too weak to run them, or you're doing e-commerce batch work where the hosted edge handling on product photos is worth a few cents per image. It's the "no-GPU crowd" play from the API-wrapper playbook, and it's the one node in this pack that behaves like a plain instant filter.
How it works
This is the only synchronous node in the pack. Everything else creates an async task and polls; this one POSTs to sync.koukoutu.com/v1/create with a Bearer token, uploads your image as a temp PNG via multipart, and gets image bytes straight back. Server errors (5xx) auto-retry up to five times, so transient hiccups usually just work.
Inputs that matter
- image - any IMAGE tensor. Batch handling is basic: it takes the first frame.
- api_key - required. Grab one at https://www.koukoutu.com/user/dev and top up credits; this is a paid service.
- model_key_name - 通用抠图模型 (general cutout, sends
background-removal) or 印花专抠模型 (the print-specific model,stamp-background-removal) for cutting out patterns on fabric. - output_format -
pngorwebp. Default iswebpin the shipped code, even though the README still says png. webp is smaller; pick png if you're compositing. - crop - trims the result down to the subject bounds instead of leaving the full-canvas transparent box.
- stamp_crop - auto-detect and cut out the print/pattern region, then remove its background in one step. This is the trick the pack is really built around.
- border - 不增强 / 标准增强 / 高度增强 (none / standard / strong) edge enhancement for rough cutouts.
Outputs
A single image output. Note what's missing: no message string, and no skip_error toggle like the rest of the pack. Errors raise and kill the queue, so if this node fails you'll see the exception in the console rather than a graceful fallback. That's the trade for it being synchronous.
Install
Install the whole pack once and all nine nodes arrive together. Via ComfyUI Manager, search "koukoutu" (zhenzi0322/comfyui-koukoutu). Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/zhenzi0322/comfyui-koukoutu
pip install -r requirements.txt # requests, Pillow, numpy, torch
Restart ComfyUI; the nodes land under the image/koukoutu category. No model files, no heavy deps - the requirements are embarrassingly light. Just remember this is an API wrapper: it ships an API key field and phones home by design, so install it from the official repo and don't paste a key into a stranger's fork.
Troubleshooting
The API returns numbered error codes, and it's worth knowing the common ones: 401 invalid key, 403/409 key invalid or not enough credits (points), 406/413 file over 15MB, 407 image resolution under 70px, 415 unsupported format, 422 bad parameters, 429 rate-limited. 401/403/409 are the ones you'll actually hit - they mean your key or balance, not the node. Since this node has no skip_error, a failure shows up as an exception; read the message in the console and check your key first.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| api_key | STRING | — | |
| model_key_nameopt | COMBO | 通用抠图模型 | 2 options: 通用抠图模型, 印花专抠模型 |
| output_formatopt | COMBO | webp | 2 options: png, webp |
| cropopt | BOOLEAN | false | — |
| stamp_cropopt | BOOLEAN | false | — |
| borderopt | COMBO | 不增强 | 3 options: 不增强, 标准增强, 高度增强 |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |