1.0.1
  • 1.0.1
  • 1.0.0
  1. Create Task
1.0.1
  • 1.0.1
  • 1.0.0
  • Get Started
  • API Reference
    • Create Task
      • Image To Video
        POST
      • Instruct Edit
        POST
      • Try-On (Apparel)
        POST
      • Try-On (Accessories)
        POST
      • Lifestyle Scene
        POST
      • Swap Fashion Model
        POST
      • Background Replacer
        POST
      • Segment Image By Prompt
        POST
      • Segment Image By Type
        POST
      • Background Remover
        POST
    • Upload Asset File
      POST
    • List Preset Materials
      GET
    • Check Task Status
      GET
    • Get Download Url
      GET
    • Retrieve API Credit Usage
      GET
  • Help
    • Download File Samples
    • Error Codes
    • FAQ
  1. Create Task

Background Replacer

POST
https://api.sellerpic.ai/v1/api/generate/replaceBackground
Before creating a task, please ensure all required resources have been uploaded.
Refer to Upload Asset File
Upload file limit
Supported formats: jpg|jpeg|png|webp (no animations)
Max file size: 10MB
Max image resolution: 4096px
Mask Image: Alpha Channel Mask - Black and White, and the resolution of Product Mask and Product Image must be the same.
1-original.pngProduct Image
50860d1854e94e7a96f1db3075831235_mask_output.pngProduct Mask(Alpha Channel Mask - Black and White)
API Developer Guide
Replace TypeDescriptionRequired ParametersOutput ImagesCredit Cost
AI_BACKGROUNDReplaces the background using a preset style
Retrieve available styles (type: AI_BACKGROUND)
presetBackgroundId - ID of selected background style44
TEXT_TO_BACKGROUNDGenerates backgrounds based on text promptscustomBackgroundPrompt - Descriptive text input44
PRESET_BACKGROUND_IMAGEApplies a predefined image as background
Retrieve available images (type: BACKGROUND)
presetBackgroundId - ID of preset background image11
CUSTOM_BACKGROUND_IMAGEUses user-uploaded image as background
Upload Process:
Upload Asset File
backgroundImageKey - Key of uploaded image11
SOLID_COLOR_BACKGROUNDSets background using HEX color code (e.g. #80c699)backgroundColor - Valid HEX color string11
Concurrency Limits: 10
Refer to Task Concurrency Limits
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.sellerpic.ai/v1/api/generate/replaceBackground' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
    "replaceType": "AI_BACKGROUND",
    "productImageKey": "UPLOAD/MANAGE/SAMPLE/product/1-original.png",
    "presetBackgroundId": "1"
}'
Response Response Example
200 - Example 1
{
    "code": 0,
    "data": {
        "id": "string"
    },
    "msg": "string",
    "success": true,
    "traceId": "string"
}

Request

Header Params

Body Params application/json

Examples

Responses

🟢200OK
*/*
OK
Body

🟢201Created
🟠401Unauthorized
🟠403Forbidden
🟠404Record Not Found
Modified at 2025-08-15 10:25:12
Previous
Swap Fashion Model
Next
Segment Image By Prompt
Built with