Skip to main content

BG Removal Only

This flow allows you to upload an image and explicitly generate the preview and full version using known recipe IDs and variants specifically designed for solid color and transparent backgrounds. This section provides a step-by-step explanation of the flow and includes API endpoints and examples.

Step 1: Image Upload

To initiate the BG Removal Only flow, you need to upload an image using the POST request to the following API endpoint:

https://daas.blend-api.com/v1/design/image-upload

The image should be uploaded using form-data, with the key named as "file". Upon successful upload, the API response will include an "id" that represents the "design instance" for further API calls.

Example:

curl -X POST -H "X-Api-Key: YOUR_API_KEY" -F "file=@image.jpg" https://daas.blend-api.com/v1/design/image-upload

Note how an API key is to be included. Navigate here for the detailed API spec.

You can also use the other upload API that lets you provide us a public URL.

Example:

curl -X POST -H "X-Api-Key: YOUR_API_KEY" -d '{"url": "A_PUBLIC_URL"}' https://daas.blend-api.com/v1/design/image-upload-from-url

Navigate here for the detailed API spec.

Step 2: Preview Generation (Optional)

You have the option to generate a preview of the image with the desired background using a known recipe ID and variant. To generate the preview, make a POST request to the following API endpoint:

https://daas.blend-api.com/v1/design/preview.webp

The request body should be a JSON object with the following properties:

  • "id": The design instance ID obtained from the image upload API.
  • "recipeId": The recipe ID associated with the desired background type.
  • "variant": The specific variant of the recipe.

Example:

curl -X POST -H "X-Api-Key: YOUR_API_KEY" -d '{"id": "DESIGN_INSTANCE_ID", "recipeId": "Solid1_1_0035", "variant": "1:1"}' https://daas.blend-api.com/v1/design/preview.webp

Navigate here for the detailed API spec.

Step 3: Full Version Generation

To generate the full version of the image with the desired background, you can proceed with a POST request to the following API endpoint:

https://daas.blend-api.com/v1/design/generated.jpeg

The request body should be a JSON object with the same properties as preview generation:

  • "id": The design instance ID obtained from the image upload API.
  • "recipeId": The recipe ID associated with the desired background type.
  • "variant": The specific variant of the recipe.

Example:

curl -X POST -H "X-Api-Key: YOUR_API_KEY" -d '{"id": "DESIGN_INSTANCE_ID", "recipeId": "Solid1_1_0035", "variant": "1:1"}' https://daas.blend-api.com/v1/design/generated.jpeg

Navigate here for the detailed API spec.

Recipe Types and Variants

To simplify the selection of recipe IDs and variants, refer to the following table for the available options:

TypeRecipe IDVariant
WhiteSolid1_1_00351:1
TransparentTransp0011:1
GreenSolid1_1_00421:1
.........

Feel free to explore the available recipe types and variants, selecting the ones that best suit your needs for generating stunning product images with different backgrounds.

Conclusion

The BG Removal Only flow empowers you to upload images and generate customized product photos with solid color or transparent backgrounds. By utilizing one of the image upload APIs, along with the preview and full version generation APIs, you can effortlessly integrate this flow into your application or service, creating visually appealing visuals that showcase your products in the best light.