Background Removal

The Background Removal model offers a versatile solution for removing the background from an image. By default, it replaces the background with a transparent backdrop.

You can also customize the background by specifying the RGB values and activating the bg_color parameter. Additionally, you can choose to blur the background or replace it with a different image.

This model provides a flexible tool for enhancing your images by transforming and personalizing the setting to suit your vision. For more details on this model, please refer to the Replace Background section.

Remove Background API

POST /getImagetoImage

Headers

NameValue

Content-Type

application/json

Authorization

Bearer <token>

Body

NameTypeDescription

app_id

string

-> Each model is uniquely characterized by its own app_id.

image

number

-> The image parameter specifies the URL of an existing image that will be used as a reference for the generation process.

-> If the original image dimensions exceed 1536x1536 pixels, the image will be adjusted to fit within this size while preserving the original aspect ratio.

bg_img

string

-> The bg_image parameter allows you to specify a URL for an image that will be used as the background for the generated image.

bg_color

bool

-> To use a custom background color, set the bg_color parameter to true. This will allow you to specify the desired RGB color values for the background.

r_color

int

-> The r_color parameter controls the strength of the red hue in the background color, with a range from 0 to 255. Higher values result in a more vibrant red, while lower values make the red more subdued.

g_color

int

-> The g_color parameter controls the strength of the green hue in the background color, with a range from 0 to 255. Higher values result in a more vibrant green, while lower values make the green more subdued.

b_color

int

-> The b_color parameter controls the strength of the blue hue in the background color, with a range from 0 to 255. Higher values result in a more vibrant blue, while lower values make the blue more subdued.

blur

bool

-> Enable the blur parameter to apply a blurring effect to the background of the generated image, creating a captivating and enchanting visual effect.

celery

bool

-> The celery parameter is used for queuing tasks that require extended processing time. When you enqueue a task, you receive a unique task_id. This task_id allows you to check the task's status later using the task status API, which is useful for managing and tracking long-running tasks.

Response

{
  "time_required": "",
  "error": "",
  "error_data": "",
  "input": "",
  "output": "",
  "app_id": "",
  "task_id": "",
  "status": ""
}

Run the API

To test this API, please use the following link:

Last updated