Skip to main content

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​

FieldValue
API-KEY<api-key>
Content-Typeapplication/json

Parameters​

ParameterTypeRequiredDescription
typestringYesFeature type identifier. Must be BACKGROUND_REPLACER
modelstringYesAI model identifier. Must be clipdrop
promptObjectobjectYesConfiguration object containing background replacement parameters

Prompt Object Parameters​

ParameterTypeRequiredDescription
imageUrlstringYesPath to the image for background replacement
promptstringYesDescription of the new background scene or action

Code Examples​

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"
}
}'

Interactive Playground​

API Playground

https://api.1min.ai/api/features
Path 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​

  1. Clear Prompts: Use specific descriptions for desired backgrounds
  2. Subject Quality: Start with well-lit, clear subject images
  3. Format Selection: Choose PNG for highest quality, JPEG for smaller files
  4. Prompt Detail: Include lighting, style, and mood in your background description
  5. Review Results: Experiment with different prompt variations for optimal results