Skip to main content

Generate Background

POST 

/v1/generate-background

Generates a new background for an image. Generated images are 1024x1024 by default.

Input Image Limits:

  • Max size: 25MB
  • Min resolution: 64x64px
  • Max resolution: 6000x6000px

Request

Header Parameters

    Accept string

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

Body

    image_url 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.

    image_transform

    object

    scale number

    Default value: 1

    Scales the input image. Scale of 1 means the longest edge of the image fits the canvas, 1 is the default value if the background was not removed automatically. If the background was removed, the alpha around the subject is automatically trimmed so we use a scale of 0.6 to provide padding around the subject in the final image.

    x_center number

    Default value: 0.5

    Positions the horizontal center of the image within the canvas. Ranges from 0 to 1.

    y_center number

    Default value: 0.5

    Positions the vertical center of the image within the canvas. Ranges from 0 to 1.

    scene string

    Possible values: [marble, wood, industrial, linen, brick, counter]

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

    prompt string

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

    negative_prompt string

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

Responses

Success

Schema

    result_url string

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

Loading...