# Remove Background > Remove backgrounds from photos and AI-generated images instantly with a Stable Diffusion extension featuring seamless foreground extraction, supporting real photos and generated art. ## Overview - **Model ID**: `background-remover-1` - **Category**: stable diffusion - **Provider**: modelslab - **Status**: model_ready - **Screenshot**: `https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/xLtKTwQhWeK4nWMoAIZoNbevO7Z0hF-metacmZ5aGRmLmpwZw==-.jpg` ## API Information This model can be used via our HTTP API. See the API documentation and usage examples below. ### Endpoint - **URL**: `https://modelslab.com/api/v6/image_editing/removebg_mask` - **Method**: POST ### Parameters - **`image`** (required): Link or valid base64 data following the format data:image/jpeg;base64,{your_base64_string} for the image you want your generations to resemble - Type: file (image/jpeg,image/png) - Example: Add image URL or Upload the image - **`only_mask`** (optional): Create mask of the image - Type: toggle - **`inverse_mask`** (optional): Inverse the mask of the image (black part is inversed to white and vice versa) - Type: toggle ## Usage Examples ### cURL ```bash curl --request POST \ --url https://modelslab.com/api/v6/image_editing/removebg_mask \ --header "Content-Type: application/json" \ --data '{ "key": "YOUR_API_KEY", "model_id": "background-remover-1", "image": "https://assets.modelslab.com/generations/06b20362-c0ea-4715-abcc-0bca27987f2c", "only_mask": false, "inverse_mask": false }' ``` ### Python ```python import requests response = requests.post( "https://modelslab.com/api/v6/image_editing/removebg_mask", headers={ "Content-Type": "application/json" }, json={ "key": "YOUR_API_KEY", "model_id": "background-remover-1", "image": "https://assets.modelslab.com/generations/06b20362-c0ea-4715-abcc-0bca27987f2c", "only_mask": False, "inverse_mask": False } ) print(response.json()) ``` ### JavaScript ```javascript fetch("https://modelslab.com/api/v6/image_editing/removebg_mask", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ "key": "YOUR_API_KEY", "model_id": "background-remover-1", "image": "https://assets.modelslab.com/generations/06b20362-c0ea-4715-abcc-0bca27987f2c", "only_mask": false, "inverse_mask": false }) }) .then(response => response.json()) .then(data => console.log(data)); ``` ## Links - [Model Playground](https://modelslab.com/models/background-remover/background-remover-1) - [API Documentation](https://docs.modelslab.com) - [ModelsLab Platform](https://modelslab.com)