POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 const axios = require('axios'); const api_key = "YOUR API KEY"; const url = "https://api.segmind.com/workflows/66c0f63ddc11b94a91cd1c50-v1"; const data = { image: "publicly accessible image link", object: "the user input string" }; axios.post(url, data, { headers: { 'x-api-key': api_key, 'Content-Type': 'application/json' } }).then((response) => { console.log(response.data); });
Response
application/json
1 2 3 4 5 { "poll_url": "<base_url>/requests/<some_request_id>", "request_id": "some_request_id", "status": "QUEUED" }

You can poll the above link to get the status and output of your request.

Response
application/json
1 2 3 { "image": "image in URL Format" }

Attributes


imageimage*

objectstr*

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Automatic Object Removal from Photos using AI

This workflow removes specific objects from photos automatically.

Process:

  • User inputs an image and specifies an object to remove
  • Automatic Mask Generator creates a mask of the specified object
  • Magic Eraser uses the mask to remove the object and fill in the area seamlessly

Users only need to provide an image and name the object to remove. They can remove various objects like vehicles, people, or unwanted elements. The Magic Eraser aims to produce a natural-looking result

Potential applications:

  • Real estate: Remove cars or temporary objects from property photos
  • E-commerce: Clean up product images by removing background elements
  • Social media: Allow users to quickly edit out unwanted objects from their photos
  • Tourism: Create cleaner landmark photos by removing crowds or modern elements
  • Photo restoration: Remove damage or unwanted additions from historical images
  • Privacy protection: Automatically remove sensitive information or people from images
  • Graphic design: Quickly modify stock photos or create cleaner compositions