抠抠图-AI 生成阴影图功能
Give your cutout a real drop shadow instead of faking it
- image
- image
- message
Every product shot pipeline hits the same wall: you cut the subject out, drop it on a scene, and it floats. A hard-edged cutout on a rendered background is the fastest way to tell everyone it's fake. KoukoutuAIShadow (抠抠图-AI 生成阴影图功能) is the fix - it takes a transparent PNG of your cutout and generates a believable AI drop shadow so the object actually looks grounded.
It's part of the comfyui-koukoutu pack, which is an API wrapper around the Koukoutu cloud service rather than a set of local models. Nothing runs on your GPU; you pay per call with credits. If you only need a static soft shadow, honestly, a Gaussian blur of the alpha channel in Photoshop is free and instant - this node's appeal is that it generates physically plausible contact and ambient shadows that track the object's shape, which is the part that's fiddly to fake by hand. It's the same job the "product photography pipeline" in the KB talks about: extract → shadow → composite → upscale, and this is the middle step you'd otherwise outsource to a designer.
How it works
It's async, like most of this pack. The node saves your image as a temp PNG (preserving the alpha channel - the transparent bits are the whole point), uploads it to the async endpoint, and polls once a second until the job finishes, with a progress bar in ComfyUI. Five-minute timeout, retries on 5xx. The model key is image-shadow-v3, which is why the example workflow is named image-shadow-v3.json.
Inputs that matter
- image - must be a transparent PNG (i.e. already cut out). Feed it an opaque photo and you're asking the model to invent shadows on pixels it can't see through; that's not what this does.
- api_key - required, from koukoutu.com/user/dev. This is a paid service; you'll burn a bit of credit per image.
- shadow_opacity - 0–1, default 0.75. How dark and strong the shadow reads.
- main_ratio - 0–100, default 80. How much of the frame your subject occupies. It's the model's sense of scale for the scene, so keep it near the truth or your shadow proportions drift.
- background_color - hex like
#ffffff. Leave it empty to get a transparent output (shadow + subject on transparent), or set it to flatten the result onto a solid colour for a quick product card. - skip_error - default on; see below.
Outputs
Two: image and message. On success the message is just "成功" and the image is your subject with the generated shadow. On failure, with skip_error on, you get your original input back unchanged plus an error message string - so if the output looks identical to the input, that's the failure mode, not a no-op.
Install
It ships with the whole pack, so install once, get all nine nodes. ComfyUI Manager → search "koukoutu", or:
cd ComfyUI/custom_nodes
git clone https://github.com/zhenzi0322/comfyui-koukoutu
pip install -r requirements.txt
Restart ComfyUI and find it under image/koukoutu. Dependencies are just requests/Pillow/numpy/torch - no models to fetch, no VRAM. Just remember it's an API node that carries a key and sends your images off-box by design; install from the official repo.
Troubleshooting
The classic gotcha is feeding in an opaque image and getting back something that looks like nothing happened. If you're confident the input is transparent, check the message output - errors are reported as numbered codes: 401 bad key, 403/409 key invalid or out of credits, 406/413 file over 15MB, 407 image under 70px, 415 wrong format, 422 bad params, 429 rate limit. The 40x/409 family means your account, not your workflow. For the rare genuinely hard case, the job can also time out after five minutes of polling - retry once before assuming the worst.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| api_key | STRING | — | |
| shadow_opacityopt | FLOAT | 0.750–1 | 阴影浓度,值范围 0-1,默认 0.75 |
| main_ratioopt | FLOAT | 800–100 | 主体占比,值范围 0-100,默认 80 |
| background_coloropt | STRING | 背景颜色(十六进制),不传则默认透明图 | |
| skip_erroropt | BOOLEAN | true | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |
| message | STRING | — |