Bria Product Cutout

Automates precise product cutouts and background removal for professional eCommerce imagery at scale.


API

If you're looking for an API, you can choose from your desired programming language.

POST
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 import requests import base64 # Use this function to convert an image file from the filesystem to base64 def image_file_to_base64(image_path): with open(image_path, 'rb') as f: image_data = f.read() return base64.b64encode(image_data).decode('utf-8') # Use this function to fetch an image from a URL and convert it to base64 def image_url_to_base64(image_url): response = requests.get(image_url) image_data = response.content return base64.b64encode(image_data).decode('utf-8') # Use this function to convert a list of image URLs to base64 def image_urls_to_base64(image_urls): return [image_url_to_base64(url) for url in image_urls] api_key = "YOUR_API_KEY" url = "https://api.segmind.com/v1/bria-product-cutout" # Request payload data = { "sku": "PROD12345", "image_url": "https://segmind-resources.s3.amazonaws.com/input/ecc737f0-3a66-4436-a93e-1ab6313cae71-62006b85ffb96123cd785999663958cc.jpeg", "force_rmbg": True, "preserve_alpha": True } headers = {'x-api-key': api_key} response = requests.post(url, json=data, headers=headers) print(response.content) # The response is the generated image
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


skustr ( default: PROD12345 )

Unique identifier for your product. Suggested format: alphanumeric code.


image_urlstr ( default: https://segmind-resources.s3.amazonaws.com/input/ecc737f0-3a66-4436-a93e-1ab6313cae71-62006b85ffb96123cd785999663958cc.jpeg )

Link to product image for processing. Check the format to ensure compatibility.


force_rmbgboolean ( default: true )

Force removes background even with existing alpha channel. Use true for cleaner separation.


preserve_alphaboolean ( default: true )

Retains original transparency if available. Set to false for a solid background.


content_moderationboolean ( default: 1 )

Applies moderation to input/output images. Use true for sensitive environments.

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.

Resources to get you started

Everything you need to know to get the most out of Bria Product Cutout

# Guide to Using the Background Removal Model Effectively

This guide walks you through key parameters and recommended settings for various use cases. Follow these best practices to achieve consistent, high-quality results.

## 1. Getting Started
1. **SKU (sku)**  
   - Optional unique identifier (e.g., “PROD12345”).  
   - Helps track assets in your system or CMS.  
2. **Image URL (image_url)**  
   - Must be a valid HTTP(s) link to your source image.  
   - Ensure the URL points to a supported format (JPEG, PNG, etc.).

## 2. Core Parameters
- **force_rmbg** (boolean, default: `true`)  
  Forces background removal even if an alpha channel exists.  
- **preserve_alpha** (boolean, default: `true`)  
  Retains original transparency. Set to `false` to composite on a solid background.  
- **content_moderation** (boolean, default: `false`)  
  Applies safety checks on input/output. Use `true` for user-generated or sensitive content.

## 3. Recommended Settings by Use Case

### A. E-commerce Product Images
- **Objective**: Clean, consistent white or transparent backgrounds for catalogs.  
- **Settings**:  
  - `force_rmbg`: `true`  
  - `preserve_alpha`: `false` (white background)  
  - `content_moderation`: `false`  
- **Tip**: Assign a unique `sku` to each image for easy inventory tracking.

### B. Graphic Design & Marketing Assets
- **Objective**: Deliver transparent PNGs for layering in ads, banners, or presentations.  
- **Settings**:  
  - `force_rmbg`: `true`  
  - `preserve_alpha`: `true`  
  - `content_moderation`: `false`  
- **Tip**: Use high-resolution source images (≥ 1,000 px) for sharper edges.

### C. User-Generated Content & Sensitive Environments
- **Objective**: Safely process avatars, profile pictures, or community uploads.  
- **Settings**:  
  - `force_rmbg`: `true`  
  - `preserve_alpha`: `true`  
  - `content_moderation`: `true`  
- **Tip**: Review moderation logs periodically to fine-tune your safety thresholds.

## 4. Best Practices
- Always verify that the `image_url` is publicly accessible.  
- Test a variety of samples (e.g., complex backgrounds, low-contrast edges) before large-scale processing.  
- Leverage batch workflows by grouping images with similar backgrounds.

## 5. Troubleshooting & Tips
- **Jagged Edges**: Increase source image resolution or manually refine masks in post-processing.  
- **Missing Details**: If fine hair or fur is lost, experiment with toggling `preserve_alpha`.  
- **Moderation Blocks**: Inspect flagged images and adjust your own filtering logic if false positives occur.

By following these guidelines and tailoring parameters to your scenario, you’ll maximize the quality and efficiency of your background removal pipeline.

Other Popular Models

Discover other models you might be interested in.

Cookie settings

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept all", you consent to our use of cookies.