> ## Documentation Index
> Fetch the complete documentation index at: https://ailabtools.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Costume Background Removal

> Costume Background Removal API removes clothing backgrounds and isolates garments for apparel photos, e-commerce listings, and product displays.

export const FileStoragePolicy = ({uploadedFiles, responseType}) => {
  const responseFileData = {
    URL: {
      stored: "Yes",
      retention: "24 Hours",
      deletion: "Automatic"
    },
    BASE64: {
      stored: "No",
      retention: "N/A",
      deletion: "Immediate"
    }
  };
  if (!uploadedFiles && !responseType) return null;
  return <div>
      <table>
        <thead>
          <tr>
            <th>Data Type</th>
            <th>Stored</th>
            <th>Retention</th>
            <th>Training</th>
            <th>Deletion</th>
          </tr>
        </thead>
        <tbody>
          {uploadedFiles && <tr>
              <td>Uploaded Files</td>
              <td>No</td>
              <td>N/A</td>
              <td>No</td>
              <td>Immediate</td>
            </tr>}
          {responseType && responseFileData?.[responseType] && <tr>
              <td>Response Files ({responseType})</td>
              <td>{responseFileData[responseType]['stored']}</td>
              <td>{responseFileData[responseType]['retention']}</td>
              <td>No</td>
              <td>{responseFileData[responseType]['deletion']}</td>
            </tr>}
        </tbody>
      </table>

      <Tip>
        For more information, see the{" "}<a href="/docs/file-storage-policy">File Storage Policy</a> and{" "}<a href="https://www.ailabtools.com/privacy-policy" target="_blank">Privacy Policy</a>.
      </Tip>
    </div>;
};

export const BillingInstructions = ({creditsPerRequest = 1}) => {
  const creditUnitPrice = 0.0027;
  const billingTiers = [{
    price: 6,
    credits: 2000,
    costPerCredit: 0.003
  }, {
    price: 30,
    credits: 10000,
    costPerCredit: 0.003
  }, {
    price: 300,
    credits: 110000,
    costPerCredit: 0.0027
  }, {
    price: 1500,
    credits: 550000,
    costPerCredit: 0.0027
  }, {
    price: 2500,
    credits: 1000000,
    costPerCredit: 0.0025
  }];
  const formatCurrency = (value, fractionDigits = 2) => value.toLocaleString("en-US", {
    style: "currency",
    currency: "USD",
    minimumFractionDigits: fractionDigits,
    maximumFractionDigits: fractionDigits
  });
  const formatNumber = (value, fractionDigits = 0) => value.toLocaleString("en-US", {
    minimumFractionDigits: fractionDigits,
    maximumFractionDigits: fractionDigits
  });
  return <>
      <table>
        <thead>
          <tr>
            <th style={{
    textAlign: "right"
  }}>Price</th>
            <th style={{
    textAlign: "right"
  }}>Requests</th>
            <th style={{
    textAlign: "right"
  }}>Cost / Request</th>
          </tr>
        </thead>
        <tbody>
          {billingTiers.map(tier => {
    const requests = tier.credits / creditsPerRequest;
    const costPerRequest = tier.costPerCredit * creditsPerRequest;
    return <tr key={tier.credits}>
                <td style={{
      textAlign: "right"
    }}>{formatCurrency(tier.price)}</td>
                <td style={{
      textAlign: "right"
    }}>{formatNumber(requests)}</td>
                <td style={{
      textAlign: "right"
    }}>
                  {formatCurrency(costPerRequest, 4)}
                </td>
              </tr>;
  })}
        </tbody>
      </table>

      <Tip>
        Each successful API request consumes{" "}<strong>{creditsPerRequest} credits (≈{" "}{formatCurrency(creditUnitPrice * creditsPerRequest, 4)})</strong>. Failed requests are not billed.

        <ul>
          <li>
            View pricing on the{" "}<a href="https://www.ailabtools.com/price?tab=api" target="_blank">pricing page</a>{" "}or manage credits in the{" "}<a href="https://www.ailabtools.com/developer/billing" target="_blank">developer platform</a>.
          </li>
          <li>
            Need more credits or an enterprise plan? Contact{" "}<a href="mailto:business@ailabtools.com">business@ailabtools.com</a>.
          </li>
        </ul>
      </Tip>
    </>;
};

export const ExperienceLinks = ({onlineUrl, apiUrl}) => {
  return <Tip>
      Explore this API through the{" "}<a href={`https://www.ailabtools.com${onlineUrl}`} target="_blank">👉 Online Experience 👈</a>{" "}or integrate it using the{" "}<a href={apiUrl}>👉 Run with API 👈</a>.
    </Tip>;
};

## Renderings show

<div class="cm-padding-8 cm-grid-template-columns-4 cm-grid-gap-8 cm-border-2-solid-218221225100 cm-border-radius-8 cm-text-align-center">
  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/OriginalImage-1.webp" alt="Original Image" />

    <div class="cm-margin cm-word-break-break-all">Original Image</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-default-1.webp" alt="Costume Background Removal" />

    <div class="cm-margin cm-word-break-break-all">-</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-mask-1.webp" alt="Costume Background Removal" />

    <div class="cm-margin cm-word-break-break-all">mask</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-whiteBK-1.webp" alt="Costume Background Removal" />

    <div class="cm-margin cm-word-break-break-all">whiteBK</div>
  </div>
</div>

### Garment Extraction Based on Clothing Categories

<div class="cm-padding-8 cm-grid-template-columns-5 cm-grid-gap-8 cm-border-2-solid-218221225100 cm-border-radius-8 cm-text-align-center">
  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/OriginalImage-2.webp" alt="Original Image" />

    <div class="cm-margin cm-word-break-break-all">Original Image</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-hat-2.webp" alt="hat" />

    <div class="cm-margin cm-word-break-break-all">hat</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-tops-2.webp" alt="tops" />

    <div class="cm-margin cm-word-break-break-all">tops</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-skirt-2.webp" alt="skirt" />

    <div class="cm-margin cm-word-break-break-all">skirt</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-shoes-2.webp" alt="shoes" />

    <div class="cm-margin cm-word-break-break-all">shoes</div>
  </div>
</div>

<div class="cm-padding-8 cm-grid-template-columns-5 cm-grid-gap-8 cm-border-2-solid-218221225100 cm-border-radius-8 cm-text-align-center">
  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/OriginalImage-3.webp" alt="Original Image" />

    <div class="cm-margin cm-word-break-break-all">Original Image</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-tops-3.webp" alt="tops" />

    <div class="cm-margin cm-word-break-break-all">tops</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-pants-3.webp" alt="pants" />

    <div class="cm-margin cm-word-break-break-all">pants</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-bag-3.webp" alt="bag" />

    <div class="cm-margin cm-word-break-break-all">bag</div>
  </div>

  <div>
    <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/costume-background-removal/doc/ResultImage-shoes-3.webp" alt="shoes" />

    <div class="cm-margin cm-word-break-break-all">shoes</div>
  </div>
</div>

<ExperienceLinks onlineUrl="/background-removal" apiUrl="/docs/ai-cutout/general/apparel-background-removal/api" />

## Billing Instructions

<BillingInstructions creditsPerRequest={1} />

## File Storage Policy

<FileStoragePolicy uploadedFiles responseType="URL" />

## Application Scenarios

* **E-commerce Apparel Segmentation**: Enables foreground segmentation of e-commerce apparel images, allowing for background separation and replacement, and facilitating batch processing and creation of main images for e-commerce apparel.
* **Virtual Try-On Creation**: In virtual try-on scenarios such as wedding photography, traditional ethnic costumes, Hanfu, cosplay makeup, etc., the clothing is segmented through a pre-processing stage of the images, followed by outfit changes and virtual try-ons using AIGC (AI-generated content) technology.
* **Personalized Intelligent Recognition**: Allows for segmentation and masking of specified categories within images, including outerwear, tops (including inner linings), pants, skirts, hats, shoes, and bags, thereby enabling personalized clipping and processing of specified types of apparel.

## Featured Advantages

* **Multi-Type Automatic Recognition**: Automatically identifies the main apparel in an image without the need for additional specification of clothing positions, and can return masks for specified categories.
* **Applicable in Various Apparel Scenes**: Suitable for precise clipping scenarios such as human mannequin apparel, real human apparel, apparel-only images, and virtual human apparel.
* **Complex Full Category Segmentation**: Suitable for segmentation of apparel subjects in multiple apparel product categories and under complex background conditions, achieving precise segmentation across all categories.

[OriginalImage-1]: https://ai-resource.ailabtools.com/rapidapi/cutout/CostumeBackgroundRemoval/OriginalImage-1.webp

[ResultImage-default-1]: https://ai-resource.ailabtools.com/rapidapi/cutout/CostumeBackgroundRemoval/ResultImage-default-1.webp
