Imgutils Segment
Cut anime characters out cleanly
- image
- mask
- image
Cutting a character out of an illustration is one of those jobs everyone eventually needs and nobody wants to do by hand with the lasso tool. Imgutils Segment is the one-click version, tuned for anime: it runs isnetis - an ISNet segmentation model trained for anime character extraction - and returns both a hard alpha mask and the character on a transparent background. It's part of the xiaden/comfyui-imgutils pack wrapping the deepghs/imgutils library.
If you've used rembg's isnet-anime model, this is the same family, packaged for ComfyUI. The background-removal essay in the KB makes the honest point that no matting model wins on every edge, and anime art is actually a favorable case: hard cel shading and clean outlines give the segmenter strong edges to work with, so results on typical illustrations are noticeably better than on hair-in-the-wind photography.
Inputs are minimal:
image- the image to segment.scale(default 1024, range 256–2048, step 128) - the internal processing resolution. Higher = more accurate edges but slower and more memory. 1024 is the right starting point; only bump it for very large or very detailed sources.
Outputs:
mask- a MASK (white = character, black = background). This is the output to feed an inpaint workflow, a detailer, or to composite back over a new background.image- an RGBA IMAGE with the background made transparent. This is the "I want a transparent PNG" output.
Both come from the same model run, so you're not paying twice.
What you'd actually use it for
- Transparent character cutouts for game assets, stickers, or compositing onto a new scene.
- Feeding the mask into a background swap: segment → mask → inpaint the background region.
- Dataset prep - with the caveat from the lora-training essay that a dataset of nothing but transparent-background images teaches the model that's the default; keep varied backgrounds for training sets.
Install & gotchas
cd ComfyUI/custom_nodes/
git clone https://github.com/xiaden/comfyui-imgutils.git
cd comfyui-imgutils
pip install -r requirements.txt
Restart ComfyUI. Requires ComfyUI 0.25.0+ (the pack uses the V3 node API). The isnetis weights download from HuggingFace Hub on first run into ~/.cache/huggingface/hub/ - first run is slow, offline is a no-go. Realistic expectations: fine hair strands, translucent fabrics, and semi-transparent glow effects will still shed pixels - no matting model solves those on anime either, and when they matter you're in hand-editing territory. For the 90% of cel-shaded art, this just works.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | Input image containing character to segment. | |
| scale | INT | 1024256–2048 | Processing resolution. Higher = more accurate, slower. Default 1024. |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| mask | MASK | — |
| image | IMAGE | — |