Skip to main content

API Parameter Structure

The API payload for image generation consists of several components that define the image source and how it should be modified or displayed:

Payload Fields

  • image_url: The URL of the image to be processed. This should be a valid and accessible URL pointing to the image file.

  • background: This object contains settings related to the image background.

    • prompt: This field specifies the background setting for the image. It can accept different types of values:

      • "transparent": This value will make the background of the image transparent.
      • A hex code (e.g., "#FFFFFF"): You can use a hex code to set a specific color as the background.
      • Custom prompt: This is a text prompt that describes a more complex background. The processing service will interpret this prompt to generate the intended background.
    • negative_prompt: This field can be used to specify what should not appear in the background. This is particularly useful for guiding the image processing algorithm away from undesired elements or themes.

Example Payload

Below is an example of a typical payload using this API:

{
"image_url": "https://image.url.com",
"background": {
"prompt": "#FFFFFF",
"negative_prompt": ""
}
}