Skip to main content

Background

Background replacement and removal. Works on any image, generated or uploaded.

Both endpoints return a job_id with a matching GET …/status/{job_id} route, see Jobs.

POST /background/change/image/v1, replace the background of input_image, described by prompt. Commonly used mid-workflow, for example Generate → Background → Upscale to stage a product shot, then sharpen it.

curl -X POST https://api.imagepipeline.io/background/change/image/v1 \
-H "X-API-Key: $IMAGEPIPELINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_image": "https://.../product.webp",
"prompt": "on a sunlit marble kitchen counter",
"output_format": "webp"
}'
FieldTypeDefaultNotes
input_imagestring,Required. Public URL of the image to restage.
promptstring,Required. Describe the new background, e.g. beach at sunset.
use_segmentationbooleantrueIsolate the subject via BiRefNet before compositing.
subject_descriptionstring,Short description of the subject to preserve.
tone_correctionnumber,Blends the edited background tones (0.0 to 1.0).
has_textboolean,Whether the image contains visible text or labels.
seedinteger-1-1 randomizes; set a value for reproducibility.
output_formatstringwebpwebp, jpeg, or png.
callback_urlstring,Receive a webhook on completion.

Response — poll GET …/status/{job_id} until status is completed:

{
"job_id": "job_2a6d9f81",
"status": "completed",
"result_url": "https://cdn.imagepipeline.io/o/2a6d9f81.webp",
"processing_time_seconds": 31.5,
"balance_remaining_usd": 187.52
}