抠抠图-印花定位裁切功能
Find the print on the shirt and crop to it, automatically
- image
- image
- message
KoukoutuStampCrop (抠抠图-印花定位裁切功能) is the most specialised node in the comfyui-koukoutu pack, and also the most minimal: it looks at a garment photo, finds the print/pattern on it, and crops the image down to that region. That's the entire job - locate the 印花 (stamp/print), cut to it, hand you the boxed result.
It's part of the pack's e-commerce thesis. The same people who want cutouts and print extraction also want the raw print region as a starting point before doing anything heavier with it, and this node is that first step in one click. It pairs naturally with the pack's other nodes: crop to the print with this, then run the print through the extractor, or hand the crop to the upscaler for a clean print file. Worth noting the overlap: KoukoutuBackgroundRemoval has a stamp_crop toggle that does locate-and-cutout in one shot, so if you want the cropped print with its background already removed, that node does both in a single call. Use this one when you want to see and keep the crop boundary before deciding what happens next.
How it works
Async, like most of the pack: upload the image, submit a task (model key stamp-crop), poll once a second with a progress bar, download the result. Server 5xx retries up to five times, five-minute cap.
Inputs that matter
There are only three, which makes this the easiest node in the pack to reason about:
- image - the garment photo with the print.
- api_key - required; koukoutu.com/user/dev, with credits.
- skip_error - on by default.
No region box, no "which print" hint, no size options. The model decides what's a print and where its bounds are. On a shirt with one design that's exactly what you want; on a busy garment with multiple prints, it picks one - there's nothing to steer it.
Outputs
image (the cropped print region) plus message ("成功" on success). Standard pack fallback: with skip_error on, a failed job returns the original, uncropped image plus the error text on message.
Install
It ships with the whole pack - install once, get all nine:
cd ComfyUI/custom_nodes
git clone https://github.com/zhenzi0322/comfyui-koukoutu
pip install -r requirements.txt
Or search "koukoutu" in ComfyUI Manager and restart. Trivial dependencies, no models to download, no VRAM. As always with this pack: it's a paid API call and your images leave the machine; install from the official repo.
Troubleshooting
The standard 40x list applies (401 bad key, 403/409 no credits, 406/413 file over 15MB, 407 source too small, 422 bad params, 429 rate limit). The most common "issue" is actually expectations: if the crop comes back hugging the wrong region, that's the model's detection, and since there are no parameters to adjust, your options are a different source image or the removal node's stamp_crop path, which may behave differently on the same input. It's a one-trick node - when it's the right trick, it saves you a selection job; when it isn't, don't fight it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| api_key | STRING | — | |
| skip_erroropt | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| message | STRING | — |