remove_background
Remove backgrounds from images using advanced dichotomous image segmentation and matting, preserving smoke, gradients, and soft artifacts. Adjustable thresholds and model selection for cel-shaded or photorealistic images.
Instructions
Uses Advanced SOTA Dichotomous Image Segmentation (DIS) + Laplacian Matting to natively extract backgrounds. Perfectly preserves smoke, gradients, and soft topological artifacts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | Absolute file path OR pure Base64 encoded PNG/JPG string representing the input image. | |
| model | No | '2d' for isnet-anime (cel-shaded NFTs), '3d' for isnet-general-use (photorealistic renders). | 2d |
| fg_threshold | No | Foreground alpha threshold (200-255). Higher = stricter core, preserves more smoke. Default 245. | |
| bg_threshold | No | Background alpha threshold (1-50). Lower = protects faint atmospheric haze. Default 10. | |
| erode_size | No | Trimap erosion kernel size (5-25). Larger = wider gradient calculation band. Default 15. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |