ModelsLab/Remove Background
background-remover-1Remove backgrounds from photos and AI-generated images instantly with a Stable Diffusion extension featuring seamless foreground extraction, supporting real photos and generated art.
API Endpoint URL
Base URL for all API requests to this endpoint.
https://modelslab.com/api/v6/image_editing/removebg_mask
API Authentication
Authentication requires a valid API key included in the request. Generate and manage your API keys from your developer dashboard. Include the key in the key parameter for all API requests.
Integration Examples
Production-ready code samples for API integration
{"image": "https://assets.modelslab.com/generations/06b20362-c0ea-4715-abcc-0bca27987f2c","only_mask": false,"inverse_mask": false,"base64": "false","seed": "0","alpha_matting": false,"post_process_mask": false,"track_id": "0","key": "YOUR_API_KEY"}
SDKs
Official SDKs
Production-ready SDKs and client libraries for all major programming languages
API Parameters
Technical specifications for API request parameters.
| Field Name | Parameter | Technical Description |
|---|---|---|
| Image | image | Link or valid base64 data following the format data:image/jpeg;base64,{your_base64_string} for the image you want your generations to resemble |
| Generate mask | only_mask | Create mask of the image |
| inverse Mask | inverse_mask | Inverse the mask of the image (black part is inversed to white and vice versa) |
| base64 | base64 | Get response as base64 string, default: false , options: true or false |
| seed | seed | Seed for reproducible results |
| alpha_matting | alpha_matting | Whether to perform alpha matting |
| post_process_mask | post_process_mask | Whether to post-process the mask image |
| track_id | track_id | ID for webhook identification |