> ## 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.

# Hairstyle Changer

> Hairstyle Changer API transforms portrait hairstyles, including bangs, hair length, and volume, with realistic AI results.

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>
    </>;
};

<Danger>
  \[Important: API Service Retirement Notice]

  Dear Developers,

  Thank you for your continued trust and support of the AILabTools API.

  To better focus on delivering more efficient, stable, and future-ready solutions, we are announcing the retirement of this API.

  Due to its outdated architecture and limitations in performance and scalability, this API will be permanently discontinued and will no longer be available starting from the date of this announcement. Any applications or integrations that still rely on this API may experience service interruptions if no action is taken.

  We strongly recommend that you evaluate alternative solutions and plan your migration as soon as possible to ensure a smooth transition and uninterrupted service for your users.

  If you have any questions or need assistance during this transition, our support team is ready to help:
  📧 [support@ailabtools.com](mailto:support@ailabtools.com)

  We sincerely appreciate your understanding and cooperation. Thank you for being part of AILabTools. We remain committed to providing you with more powerful and reliable services.

  Best regards,

  AILabTools Support Team
</Danger>

## Renderings show

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

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

  <div class="cm-grid-template-columns-4 cm-grid-gap-8 cm-padding-8">
    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-101-1.webp" alt="Bangs" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-201-1.webp" alt="Long hair" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-301-1.webp" alt="Bangs with long hair" />

      <div class="cm-margin cm-word-break-break-all">Bangs with long hair</div>
    </div>

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-401-1.webp" alt="Medium hair increase" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-402-1.webp" alt="Light hair increase" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-403-1.webp" alt="Heavy hair increase" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-502-1.webp" alt="Light curling" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-503-1.webp" alt="Heavy curling" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-603-1.webp" alt="Short hair" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-801-1.webp" alt="Blonde" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-901-1.webp" alt="Straight hair" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-1001-1.webp" alt="Oil-free hair" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-1101-1.webp" alt="Hairline fill" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-1201-1.webp" alt="Smooth hair" />

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

    <div>
      <img class="cm-w cm-border-radius-8" src="https://ai-resource.ailabtools.com/hairstyle-changer/doc/ResultImage-1-1301-1.webp" alt="Fill hair gap" />

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

## Billing Instructions

<BillingInstructions creditsPerRequest={12} />

## File Storage Policy

<FileStoragePolicy uploadedFiles responseType="BASE64" />

## Basic Edition vs. Professional Edition Comparison.

|                                     | [Hairstyle changer](/docs/ai-portrait/effects/hairstyle-editor)                       | [Hairstyle Changer Pro](/docs/ai-portrait/effects/hairstyle-editor-pro)                    |
| :---------------------------------- | :------------------------------------------------------------------------------------ | :----------------------------------------------------------------------------------------- |
| Technology                          | Based on deep learning algorithms                                                     | Based on a stable diffusion model                                                          |
| Hairstyle                           | Supports 5 hairstyles.                                                                | Supports dozens of hairstyles (with distinct results each time for the same hairstyle).    |
| Hair color                          | ❌                                                                                     | Supports dozens of colors (with unique results each time for the same color).              |
| Degree of change                    | Fine-tune                                                                             | Completely transform                                                                       |
| Requirements for the Original Image | [Low requirements](/docs/ai-portrait/effects/hairstyle-editor/api#image-requirements) | [High requirements](/docs/ai-portrait/effects/hairstyle-editor-pro/api#image-requirements) |
| Output image                        | 1                                                                                     | 1 \~ 4                                                                                     |

## Application Scenarios

* **Portrait beautification**: Edit and modify the hairstyle in the portrait image for portrait beautification scenes to easily enhance the user's image.
* **Hair design**: Users can directly edit hairstyles and intuitively experience a variety of hair designs to enhance the personalized experience of customers in the beauty and hairdressing industry.
* **Interactive entertainment**: In short videos, social platforms, or integrated into photo album type apps, add hair style editing play to users' personalized photos to attract users' interactive participation and sharing.

## Featured Advantages

* **Fast response**: millisecond response processing speed, extremely fast presentation of the processed effect.
* **Accurate recognition**: based on deep learning algorithm, accurate face recognition.
* **Wide range of applications**: meet the needs of diverse business scenarios, applicable to users of different ages and genders.
