Make Your First API Call
To call the Background Image Generation API and remove the background of an image, you can run the following curl command through your terminal.
curl --location 'https://api.katalis.ai/service/v1/generate-image' \
--data '{
"image_url": "https://image.url.com",
"background": {
"prompt": "a professional photo of an object on a table made of dark wood, dark wood countertop, hd dark wood wallpaper, award-winning photography",
"negative_prompt": "yellow wall"
},
"size": {
"type": "square", // square, landscape, portrait
"dimension": "500x500"
},
"position": {
"type": "original", // original, center
"size": 25
}
}'
This curl command is making a POST request to the Katalis AI API's generate-image endpoint. The --location flag follows HTTP 3xx redirects. The --data flag sends the specified data in a POST request to the HTTP server.
Here's a breakdown of the data being sent:
-
"image_url": This is the URL of the image that you want to process. -
"background": This object contains two properties, prompt and negative_prompt. The prompt property is a string that describes the desired background for the image. The negative_prompt property is a string that describes what should not be in the background. -
"size": This object specifies the size of the output image. The type property can be "square", "landscape", or "portrait". The dimension property specifies the dimensions of the image in pixels. -
"position": This object specifies the position of the image. The type property can be "original" or "center". The size property specifies the size of the image.