Skip to main content
POST
/
v1
/
generate-background
Generate Background
curl --request POST \
  --url https://api.developer.pixelcut.ai/v1/generate-background \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "image_url": "https://cdn3.pixelcut.app/product.jpg",
  "image_transform": {
    "scale": 1,
    "x_center": 0.5,
    "y_center": 0.5
  },
  "scene": "marble",
  "prompt": "<string>",
  "negative_prompt": "<string>"
}
'
{
  "result_url": "https://assets.pixelcut.app/public/result/a16646be-91c8-4e3a-b359.jpg"
}

Authorizations

X-API-KEY
string
header
required

All API requests require a valid api key. Include your token as a HTTP request header in the following format: X-API-Key: skXXXXXXXXXXXXXXXX. You can obtain an api key by signing up for developer access in your Pixelcut account.

Headers

Accept
string

Acceptable response media type(s). application/json or image/*. Default is application/json.

Body

image_url
string<url>

URL of the image. If the image is RGB the background will automatically be removed, if the image is RGBA the background will not be removed and the alpha channel will be respected.

Example:

"https://cdn3.pixelcut.app/product.jpg"

image_transform
object
scene
enum<string>

Select a preset scene type. If provided prompt and negative_prompt will be ignored.

Available options:
marble,
wood,
industrial,
linen,
brick,
counter
prompt
string<string>

A description of the desired scene used to guide the image generation process.

negative_prompt
string<string>

A comma seperated list of attributes which should be discouraged in the image generation.

Response

Success

result_url
string

A URL to access the resultant image which is valid for 1 hour. File format will be jpeg.

Example:

"https://assets.pixelcut.app/public/result/a16646be-91c8-4e3a-b359.jpg"