Stable Diffusion XL - Background Replacer
Replace image backgrounds with AI-generated scenes using Stable Diffusion XL technology. Maintain subject integrity while creating new environments and contexts.
Endpoint
Request Headers
| Field | Value |
|---|---|
| API-KEY | <api-key> |
| Content-Type | application/json |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Feature type identifier. Must be BACKGROUND_REPLACER |
model | string | Yes | AI model identifier. Must be clipdrop |
promptObject | object | Yes | Configuration object containing background replacement parameters |
Prompt Object Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
imageUrl | string | Yes | Path to the image for background replacement |
prompt | string | Yes | Description of the new background scene or action |
Code Examples
- cURL
- JavaScript
- Python
curl --location 'https://api.1min.ai/api/features' \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"type": "BACKGROUND_REPLACER",
"model": "clipdrop",
"promptObject": {
"imageUrl": "images/2025_10_26_10_39_15_294_cat.png",
"prompt": "remove background"
}
}'
fetch('https://api.1min.ai/api/features', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'API-KEY': 'YOUR_API_KEY'
},
body: JSON.stringify({
type: 'BACKGROUND_REPLACER',
model: 'clipdrop',
promptObject: {
imageUrl: 'images/2025_10_26_10_39_15_294_cat.png',
prompt: 'remove background'
}
})
})
import requests
url = "https://api.1min.ai/api/features"
headers = {
"Content-Type": "application/json",
"API-KEY": "YOUR_API_KEY"
}
data = {
"type": "BACKGROUND_REPLACER",
"model": "clipdrop",
"promptObject": {
"imageUrl": "images/2025_10_26_10_39_15_294_cat.png",
"prompt": "remove background"
}
}
response = requests.post(url, headers=headers, json=data)
Interactive Playground
API Playground
https://api.1min.ai/api/featuresPath to the image file for background replacement
Background replacement instruction or description
Generated cURL Command:
curl -X POST "https://api.1min.ai/api/features" \
-H "API-KEY: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"type": "BACKGROUND_REPLACER",
"model": "clipdrop",
"promptObject": {
"imageUrl": "images/2025_10_26_10_39_15_294_cat.png",
"prompt": "remove background"
}
}'
Response Format
{
"aiRecord": {
"uuid": "b1g2r3m4-v5e6-7890-abcd-ef1234567890",
"userId": "user-12345",
"teamId": "team-67890",
"model": "clipdrop",
"type": "BACKGROUND_REPLACER",
"status": "SUCCESS",
"createdAt": "2025-01-15T14:00:00.000Z",
"aiRecordDetail": {
"promptObject": {
"imageUrl": "images/2025_10_26_10_39_15_294_cat.png",
"prompt": "remove background"
},
"resultObject": [
"images/2025_10_26_10_39_30_001_background_replaced.png"
]
},
"temporaryUrl": "https://s3.us-east-1.amazonaws.com/asset.1min.ai/development/images/2025_01_15_14_00_30_001_background_replaced.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Expires=604800..."
}
}
Use Cases
- Product Photography: Create professional product shots with studio backgrounds
- Portrait Enhancement: Replace distracting backgrounds with professional settings
- E-commerce: Generate consistent background themes for product catalogs
- Marketing Materials: Create branded environments for promotional content
- Creative Projects: Experiment with different moods and atmospheres
Tips for Best Results
- Clear Prompts: Use specific descriptions for desired backgrounds
- Subject Quality: Start with well-lit, clear subject images
- Format Selection: Choose PNG for highest quality, JPEG for smaller files
- Prompt Detail: Include lighting, style, and mood in your background description
- Review Results: Experiment with different prompt variations for optimal results